Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 8523
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: Mess1214 [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.9004
Fixed in: (no value)



Subject: Sometimes getting weird results from fetches using MySql 4.1.7
I recently upgraded to MySql 4.1.7 (with DBD 2.9004 and DBI 1.46). For some reason, I had some select queries returning empty sets or data structures with some garbage in them, depending on the spacing/quoting of my query. Sometimes switching double quotes to single quotes around a string in the query fixed the problem. Sometimes converting spaces to tabs or breaking a long line into multiple lines fixed the problem as well. All of my queries are embedded within qq() blocks. I don't know why the fetches are being picky as far as whitespace/quoting issues. Please look into this as it is a major problem. Here is an example of a problem I encountered: qq(select track_id from $track_info where track_code = "$track_code") <=== this query returned garbage qq(select track_id from $track_info where track_code = '$track_code') <=== this worked
[guest - Fri Nov 19 03:12:04 2004]: Show quoted text
> I recently upgraded to MySql 4.1.7 (with DBD 2.9004 and DBI 1.46). > For some reason, I had some select queries returning empty sets or > data structures with some garbage in them, depending on the > spacing/quoting of my query. Sometimes switching double quotes to > single quotes around a string in the query fixed the problem. > Sometimes converting spaces to tabs or breaking a long line into > multiple lines fixed the problem as well. All of my queries are > embedded within qq() blocks. I don't know why the fetches are > being picky as far as whitespace/quoting issues. Please look into > this as it is a major problem. Here is an example of a problem I > encountered: >
Did you compile DBD::mysql against the 4.7.1 client librares or is the DBD driver compiled against an older version of the client libararies. Show quoted text
> qq(select track_id from $track_info where > track_code = "$track_code") <=== this query returned garbage > > qq(select track_id from $track_info where > track_code = '$track_code') <=== this worked >
Is this a mimimal test case, or is this some sql embedded in a larger program? If not can you provide a minimal self-contained test case Have you tried cutting and pasting the query into the mysql command line client (that was compiled against the same client libraries that you compiled DBD::mysql against)? I have not had any problems with DBD::mysql with earlier version of mysql, and I don't know of any API changes that would cause the behavour that you are seeing, so, my guess is: either there is something screwey with the client libraries or even more likely is that the server is treating the queries differently than you expected either because of a bug or because of a change in the server defaults (remember that according to the SQL standard "s are only used for SQL delimited identifiers, not for strings).
sound like on of the mysql bugs.(still open in 4.1.9, but fixed in BK) http://bugs.mysql.com/bug.php?id=6511 ifclient using the 4.1 and the 4.0 mysql libraries connect to the same server, the query cache will get corrupted. (that is why changing quotes helped, your query was not answered from the cache) solutions: a) disable the query cache globally b) use the same mysql lib version for all clients untill fixed on server c) use the no cache option in the queries