Problems with catalog function "SQLColumns" with new ODBC Driver 3.51.10 - CPU goes up to
am 06.01.2005 08:46:10 von Emmanuel KARTMANNI was using MySQL Database Server 4.0.22 on Windows 2000 with MyODBC 3.51.06
and everything worked fine.
I downloaded the latest ODBC Driver (3.51.10) and I use an ODBC client to
get a table description (e.g. Query Tool from George
Poulose: http://gpoulose.home.att.net/) - Whenever I click on table to
display table structure, the CPU goes up to 100% for some time, and (if the
CPU/Memory doesn't run out - crashes!), the table structure is displayed.
Doing this on a production system has devastating effects - timeouts and
error messages everywhere!
Looking at the mysql log file, I see the requests issued by the new ODBC
Driver
(for database "mydatabase", table "mytable"):
040831 16:21:28 53 Connect
on mydatabase
53 Query SHOW DATABASES
53 Query SELECT DATABASE()
040831 16:21:37 53 Query show tables
040831 16:21:48 53 Query SHOW KEYS FROM mydatabase.`mytable`
53 Query show table status from `mydatabase` like 'mytable%'
53 Query SHOW FIELDS FROM mydatabase.`mytable` like '%'
53 Query SELECT f1,f2,f3,f4,f5 FROM mydatabase.`mytable`
The last query (a SELECT with neither a "WHERE" clause nor a "LIMIT" clause)
causes the CPU/Memory to be wasted and the machine to slow down or even
crash -
if your table contains many rows (I have tables with millions of rows!).
Internally, the catalog function "SQLColumns" from ODBC 1.0 API is called.
Looking at the source code, I found that function "SQLColumns" (file
MyODBC-3.51.09\driver\catalog.c, line 687) calls function
"mysql_list_dbcolumns" (file MyODBC-3.51.09\driver\catalog.c, line 610),
which generates the SELECT statement.
Is there a workaround/patch/fix for this? My sysadmin keep on crashing our
production systems just by clicking on the wrong button... Help!
Emmanuel K.
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org