codenamejason / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
2 stars 0 forks source link

MySql stored procedures contain errors (RB-1.2 branch) #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The GetErrorXml and GetErrorsXml stored procedures created by the MySql.sql 
script contain errors:

1) Both procedures return all errors in the db instead of the particular 
error (or errors in the case of GetErrorsXml) asked for, because the input 
variables use the same names as the database fields (ErrorId and 
Application).

2) GetErrorsXml returns an incorrect number of records for the requested 
page size.

The attached patch fixes both of these problems for me, but I'm not an 
expert in MySql so the SQL could need to be tweaked.

The patch also changes the ErrorId field from binary(16) to char(36), and 
it contains appropriate changes in MySqlErrorLog.cs. I submitted a patch a 
few weeks ago to fix an inconsistency between the ErrorLog class and the 
sql script for the ErrorId field type, and at that time the easiest fix was 
to use binary(16). After attempting to debug these errors with the stored 
procedures and encountering the difficulty of executing sql queries with 
binary fields/values in the where clauses, I think it's best to use 
char(36) for the ErrorId field type.

Original issue reported on code.google.com by paul.wid...@gmail.com on 27 Feb 2010 at 9:07

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 27 Feb 2010 at 11:46

GoogleCodeExporter commented 9 years ago
this patch has been accepted.

Original comment by nberardi on 27 Feb 2010 at 11:57