Bug #4991 | Inconsistent behavior of MySqlDataReader class ? | ||
---|---|---|---|
Submitted: | 11 Aug 2004 14:43 | Modified: | 14 Oct 2004 14:20 |
Reporter: | Peter Snizek | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | MySQL 4.0.16, .NET 1.1, ByteFx 0.76 | OS: | Windows (Windows XP) |
Assigned to: | Reggie Burnett | CPU Architecture: | Any |
[11 Aug 2004 14:43]
Peter Snizek
[13 Aug 2004 11:58]
Peter Snizek
Issue closed. Problem caused by bad thread construction.
[17 Aug 2004 23:18]
Matthew Aznoe
I am having the same issue, so I am curious how the thread was being created badly.
[17 Aug 2004 23:23]
Matthew Aznoe
Also, I have recently converted from the CoreLab .NET provider to ByteFX. My code worked correctly with this issue with CoreLab, but now it is not working. This seems to indicate that it could be a problem with ByteFX and not with my code.
[18 Aug 2004 14:29]
Peter Snizek
Answer to Matthew Aznoe: I have simply removed the thread constructor and am starting the classes now as non-threads. Since then, the issue never occured again. The thing is that there are 2 threads which matter: The 1st one imports data from 2 flat files into Mysql. The 2nd thread checks if any new records available (based on what thread 1 imported). If yes, it takes the 1st entry, copies it into "spooling" tables where it is used by a reporting tool and deletes the records from the source table. Because both threads were working concurrently, I believe that it could happen that thread 2 (spooling) was faster (or earlier) than thread 1 (dataimport). What I will do is, that I will make 1 thread out of both threads and manage spooling etc.. based on self defined "events", instead of having 2 threads working concurrently. A self defined event will trigger the execution of the spooling class in future when appropriate, rather than having 2 parallel threads running dumb in circles. What I still don't understand is the behavior of the GetString method. I still don't understand why no error got thrown. Could you describe your issue? Cheers, Peter
[18 Aug 2004 19:00]
Matthew Aznoe
After further investigation, it appears the problem is not related to threading at all. The problem appears to be with returning values of type time where "00:00:00" is being returned as NULL. I will create this as a new bug.
[18 Aug 2004 23:16]
Justin Drerup
I've experienced the same problem. The reader fails and returns the following error: The DateTime represented by the string is out of range. However the reader seems to fail after returning a certain number of rows rather than on a specific record. In this case the reader failed on the 37th row. Here is the 37th Row, it doesn't appear to have a problem with the date field? +--------+-------------+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+--------+ | NewsID | CountryCode | Title | StartDate | EndDate | Text | Active | Author | +--------+-------------+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+--------+ | 36 | AU | The Cosmic Psychos hit Falls | 2000-08-25 | 2000-09-25 |<P><EM>Local Correspondent, Clive Dickerson reports from Falls Creek</EM></P> <P>Social life at Falls continues in its usual frantic way welcoming the Cosmic Psychos at the Man last Tuesday - good to see the old fellas still rockin' on and drawing the crowds! The ZZ Top look-alike Mixer added to their raunchy image...<BR> <BR>Saturday had everyone checking out who would qualify for the the Mogul Masters and the finals were held under lights on Saturday night on the summit - the event pulled big crowds again and Frying Pan patrons had a great view that most likely grew dimmer with all the alcohol as the night progressed!<BR> <BR>Unfortunately [ ! ! ] there were no big bingles or mighty stacks just a few bales but the crowd were not disappointed as the competition itself was heavy duty with big international competitors [Canadians, Frenchies, Germans] not forgetting the Buller Team and the Hotham Team. Jade Vaughan, Canadian took out first place in the Men's moguls with local Falls rider Tom Costa taking 6th place; women's Moguls finalist was Jane Sexton. Heavy night - great ...<BR> <BR>Wednesday we welcomed the Quicksilver pro Team arriving for the 1/4 pipe competition for locals and pro teams - more details later. We have a front travelling in with a promise of an even bigger snowfall for the comp but its being held at the top of the Gully Chair so will go ahead no matter what conditions. Log in next week for more Falls news .....</P>| 1 | 0 | +--------+-------------+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+--------+ ================================= public void GetNews() { // Create a reader and set to null MySqlDataReader myReader = null; // Create a connection and set to null MySqlConnection myConn = null; MySqlConnection mySqlCon = new MySqlConnection("Server=localhost;Database=btworld;User ID=dbuser;Password=password"); mySqlCon.Open(); // Assign the connection myConn = mySqlCon; // Build the sql statement string mySql = "SELECT * FROM tblNews"; // Create a command MySqlCommand myCmd = myConn.CreateCommand(); // Set the command text myCmd.CommandText = mySql; // Execute the reader myReader = myCmd.ExecuteReader(); int newsId = 0; string countryCode = null; string title = null; string startDate = null; string endDate = null; string text = null; int active = 0; int author = 0; while (myReader.Read()) { newsId = myReader.GetInt16(0); countryCode = myReader.GetValue(1).ToString(); title = myReader.GetValue(2).ToString(); startDate = myReader.GetDateTime(3).ToString(); endDate = myReader.GetDateTime(4).ToString(); text = myReader.GetValue(5).ToString(); active = myReader.GetInt32(6); author = myReader.GetInt32(7); Response.Write(newsId); } // Clean up the connection if it is still open if(myConn != null) myConn.Dispose(); }
[26 Aug 2004 17:53]
Reggie Burnett
I'm not sure if this is still an issue or not. If this is still causing someone trouble, can you post a schema and example data row that is causing the problem?
[27 Aug 2004 22:12]
Justin Drerup
Hi, I placed additional information at this posting: http://bugs.mysql.com/bug.php?id=5097 It appears that you have seen it there. Thanks.
[14 Oct 2004 14:20]
Reggie Burnett
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to 'Open'. Thank you for your interest in MySQL. Additional info: I have marked this as can't repeat because the dialogue indicated it was a problem with datetime or time fields and that the user would post as a new bug (which I believe has already occured). if anyone believes this bug should remain open, please let me know.