parush / elmah

Automatically exported from code.google.com/p/elmah
0 stars 0 forks source link

ELMAH_GetErrorsXml stored proc returns data beyond the last page #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a small web which I develop in Visual Studio 8.
I have added Elmah.
I log errors to a SQL erver 2005.

When I run elmah.axd I get an OK output.
However when I click the "download log" it starts downloading errorlog.csv 
forever.
I have tried to let the download go on for an hour but it still continues 
to download data.

I have traced via HTTP watch. 
The result: 

Sent:677 
Received: 2973758 (this goes up and up and up)
Method: GET 
Result: 200 
Type= text/csv; header=present; charset=utf-8 
URL = http://localhost:1440/SMweb/elmah.axd/download 

The Elmah.error table contains 17 rows. Four of them is for this web 
site. 

I attach the data.

/k

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by rosqui...@yahoo.com on 6 Feb 2008 at 12:22

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, missed this:
Elmah.dll version 1.0.9414.1441
Windows XP sp2

/k

Original comment by rosqui...@yahoo.com on 6 Feb 2008 at 12:24

GoogleCodeExporter commented 9 years ago
The results.rpt seems to have truncated data and I was really hoping to use it 
to 
load a SQL database to repro the same case. Do you think you could use the SQL 
Management Studio to export the table into an Access database and which I can 
then 
import on my end? That would help a lot.

Original comment by azizatif on 7 Feb 2008 at 9:26

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 7 Feb 2008 at 9:27

GoogleCodeExporter commented 9 years ago
Here you have.

Thanks for helping.

/k

Original comment by rosqui...@yahoo.com on 7 Feb 2008 at 12:44

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the data upload. I have been able to successfully import the data on 
my 
end reproduce your issue. The fault appears to be in the ELMAH_GetErrorsXml 
stored 
procedure and seems to revolve around the first SELECT (see below) statement:

-- Get the ID of the first error for the requested page

SET @StartRowIndex = @PageIndex * @PageSize + 1
print @StartRowIndex
SET ROWCOUNT @StartRowIndex

SELECT  
    @FirstTimeUTC = TimeUTC,
    @FirstSequence = Sequence
FROM 
    ELMAH_Error
WHERE   
    Application = @Application
ORDER BY 
    TimeUTC DESC, 
    Sequence DESC

It seems to be returning always a row, even if the page index is beyond the 
last 
possible page. You can easily see the effects of this by running a query that 
sets 
the page index to a very large number that is beyond the last possible page.

You'll hear back once I have a fix. For now just wanted to share this finding.

Original comment by azizatif on 7 Feb 2008 at 1:30

GoogleCodeExporter commented 9 years ago
I have changed the title of issue since is more generally related to the SQL 
200x 
script and pretty much affects paging through data anywhere.

Original comment by azizatif on 7 Feb 2008 at 1:59

GoogleCodeExporter commented 9 years ago
I have attached a proposed path to the ELMAH_GetErrorsXml stored procedure. I 
have 
also separately attached a SQL script file that ALTERs the stored procedure and 
which can be used for immediate testing.

kurtsune (/k), I'd appreciate your feedback here whether it addresses the issue.

Original comment by azizatif on 7 Feb 2008 at 2:08

Attachments:

GoogleCodeExporter commented 9 years ago
I changed  the procedure.
I clicked the download.
It now works.
I get my 4 errors in the csv.

Many thanks!
Have a nice holiday.

/k

Original comment by rosqui...@yahoo.com on 8 Feb 2008 at 10:20

GoogleCodeExporter commented 9 years ago
Thanks for providing all the details to help get to the bottom of this issue. 
Fixed 
in r260.

Original comment by azizatif on 8 Feb 2008 at 6:51