Bug #5322 | Problems with catalog function "SQLColumns" with new ODBC Driver 3.51.09 | ||
---|---|---|---|
Submitted: | 31 Aug 2004 18:10 | Modified: | 11 Apr 2005 19:07 |
Reporter: | Emmanuel KARTMANN | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 3.51.09 | OS: | Windows (Windows 2000) |
Assigned to: | Vasily Kishkin | CPU Architecture: | Any |
[31 Aug 2004 18:10]
Emmanuel KARTMANN
[11 Sep 2004 22:23]
marc slemko
It appears that the "select everything from the table" behaviour is a hack that was thrown in to deal with the fact that mysql_list_fields doesn't support having a database name being passed to it. If there is no database name, mysql_list_fields is called which appears to behave properly. If there is a database name included then this hack is taken, which makes the driver completely unusable for me. The hack doesn't even work correctly, because for things such as varchar columns it returns the length as the length of the largest value currently stored, which may be much smaller than the length permitted... especially if you are starting with an empty table! This would break even more if you did a LIMIT 1. This is a pretty serious bug for any real use of the ODBC driver.
[15 Sep 2004 12:15]
Emmanuel KARTMANN
I see the reason why there is a SELECT - thanks for the hint. What about patching the code with a reasonable LIMIT value (e.g. LIMIT 100). The hack would work, and have reasonable value for most cases (unless you have huge tables with bigger values at the end...). We could just add this line: strxmov(select,select," LIMIT 100",NullS); After line 658 in catalog.c (I tried it - it solves MY problem i.e. no more CPU 100% for hours...). Regards, Emmanuel
[23 Mar 2005 16:11]
Emmanuel KARTMANN
Seems like the bug has been fixed in MyODBC 3.51.11 - I don't crash my system anymore with this version... Great! Regards, E.
[8 Jun 2005 12:58]
Emmanuel KARTMANN
MyODBC 3.51.11 has fixed the bug - surprisingly mentioned as number 8198: http://bugs.mysql.com/bug.php?id=8198 Duplicated bugs - but fixed! Thanks! E.