Bug #20084 | SQL works in Query-browser; fails in Connector/NET | ||
---|---|---|---|
Submitted: | 26 May 2006 4:50 | Modified: | 2 Jun 2006 7:21 |
Reporter: | Mark Johnson (Basic Quality Contributor) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 1.0.7 | OS: | Windows (w2k/linux) |
Assigned to: | CPU Architecture: | Any |
[26 May 2006 4:50]
Mark Johnson
[26 May 2006 5:08]
Mark Johnson
The following error was logged: Message: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mj_spListRatingsOfRecipe' at line 1 Stack Trace: at MySql.Data.MySqlClient.PacketReader.CheckForError() in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\PacketReader.cs:line 149 at MySql.Data.MySqlClient.PacketReader.ReadHeader() in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\PacketReader.cs:line 117 at MySql.Data.MySqlClient.PacketReader.OpenPacket() in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\PacketReader.cs:line 131 at MySql.Data.MySqlClient.NativeDriver.ReadResult(Int64& affectedRows, Int64& lastInsertId) in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\nativedriver.cs:line 369 at MySql.Data.MySqlClient.CommandResult.ReadNextResult(Boolean isFirst) in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\CommandResult.cs:line 125 at MySql.Data.MySqlClient.CommandResult..ctor(Driver d, Boolean isBinary) in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\CommandResult.cs:line 52 at MySql.Data.MySqlClient.NativeDriver.SendQuery(Byte[] bytes, Int32 length, Boolean consume) in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\nativedriver.cs:line 330 at MySql.Data.MySqlClient.MySqlCommand.GetNextResultSet(MySqlDataReader reader) in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\command.cs:line 295 at MySql.Data.MySqlClient.MySqlDataReader.NextResult() in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\datareader.cs:line 683 at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\command.cs:line 406 at MySql.Data.MySqlClient.MySqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) in d:\Program Files\MySQL\MySQL Connector Net 1.0.7\mysqlclient.MRJ\command.cs:line 370 at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at MRJ.RecipeDB.RecipeRead.MRJ.RecipeDB.IRecipeRead.ListRatingsOfRecipe(Int32 RecipeID, DataSet& list) in g:\develop\recipe\dataTier\RecipeDB\RecipeRead.cs:line 328 However, I can, as shown, call the stored procedure from the mysql command line utility.
[26 May 2006 11:45]
Tonci Grgin
Hi Mark. Thanks for your problem report. Can you please provide me with DDL script and dump containing portion of your data?
[28 May 2006 19:47]
Tonci Grgin
Hi Mark. I would very much like you to post the entire project instead of snippet. I'm especially interested in you connect string! So, please post small but complete C# project showing your problem on data you provided.
[28 May 2006 19:53]
Tonci Grgin
Sorry, this should have been added with the rest of the text... Mark, please dump data in form sutable for import, it will shorten my test time. Changing actual numbers to 'x' is ok as long as you can produce the error on that subset of data with your test case. Example: INSERT INTO Person VALUES (1,'Diana' ,'Johnson' ,'(902) xxx-xxxx','xxx@xxx.xxx'), (2,'Mark' ,'Johnson' ,'(403) xxx-xxxx','mrj001@shaw.ca'), (3,'Stephanie','Johnson' ,'(403) xxx-xxxx','xxx@xxxxl.xxx' ), (4,'Ken' ,'DeleteMe','555-1212' ,'nobody@nowhere.com'), (5,'Jane' ,'Doe' ,NULL ,NULL), (6,'Susan' ,'Muise' ,NULL ,NULL), (7,'Barbie' ,'Doll' ,NULL ,NULL), (8,'Melodee' ,'Richards',NULL ,NULL), (9,'Shauna' ,'Welch' ,NULL ,NULL), (10,'Violi' ,'J' ,NULL ,NULL), (11,'n' ,'n' ,NULL ,NULL); INSERT INTO Ratings VALUES (8,2,5,"0000-00-00 00:00:00"), (7,2,3,"2002-04-28 00:00:00"), (8,4,3,"0000-00-00 00:00:00");
[1 Jun 2006 10:28]
Mark Johnson
bzip2 encoded tar file of project illustrating problem.
Attachment: 20084.tar.bz2 (application/x-tbz, text), 180.12 KiB.
[1 Jun 2006 10:33]
Mark Johnson
I uploaded a file demonstrating the problem. It is a bzip2 compressed tar file. Please see the README file in it. Note that the segment of code used to call this stored procedure is almost the same as that used to call other stored procedures (except for the name of the stored procedure and parameters). Other calls work, while this one fails. I suspected something peculiar to this procedure and tried a few variations on the select statement in it. You will see these in the submitted code (file RecipeRead.cs).
[1 Jun 2006 20:36]
Tonci Grgin
Hi Mark. I found what I was looking for in your connection string. Try this one: "SERVER=munja;DATABASE=Bug20084;PORT=3307;userid=root;password=; pooling=false; Allow Zero Datetime=True" << here Reference in manual: http://dev.mysql.com/doc/refman/5.0/en/connector-net-using-datetime.html Everything works just fine.
[2 Jun 2006 6:03]
Mark Johnson
Thanks. I had missed that. It works now. Please update this issue to "not a bug". (I only have Open and Closed available for status.)
[2 Jun 2006 7:21]
Tonci Grgin
Mark, glad it works!