Hello people, I'm Michel.
First of all I apologize for my eventually bad engRish.
In our company we develop a VB6 software which uses MySQL as database. After changing che connection string to use the 5.2w version of the ODBC driver instead of the previous 5.1, I discovered that on the server logs began to appear entries telling that PREPARED STATEMENTS are being created when our program does a query on the server.
The problem is that our application DOESN'T MAKE USE of PREPARED STATEMENTS but it works in the classic way, creating SQL query strings and opening ADODB recordsets with them. Actually these PREPARED STATEMENTS are created on an apparently random fashion, meaning that executing a given query causes a PREPARED STATEMENTS being created on the server, and by re-executing it a second time this doesn't happen.
All these PREPARED STATEMENTS being created caused an error message to pop up randomly in our application, telling that MAX_PREPARED_STMTS_COUNT was reached (the message was "Can’t create more than max_prepared_stmt_count"), as all these PREPARED STATEMENTS are being created supposedly by the ODBC driver itself but not closed and destroyed as our program doesn't manage them.
I tried to set the MAX_PREPARED_STMTS_COUNT environment variable on the MySQL server to a higher value, to prevent the error message to come out, and by experimenting with an our own utility program which moves a big quantity of records between databases I discovered that, when the data transfer begins, the MySQL server starts to eat up all the available memory, severely slowing down the machine. This happens because all of these PREPARED STATEMENTS are being created but not disposed.
So I switched back to the older ODBC driver version (5.1, as stated above), and all was fine, no PREPARED STATEMENTS were created and left opened, no RAM was eaten up and the machine exposed no slow downs or whatever.
So what I ask is: is this a problem (bug/incompatibility) of that ODBC's driver version (5.2w) or I forgot to set something in the connection string?
Here's the connection string we used to do the database connection with the 5.2w version:
DRIVER=MySQL ODBC 5.2w Driver;
USER=[user name];
PASSWORD=[password];
SERVER=[server address];
DATABASE=[database name];
PORT=3306;
OPTION=3;
What's eventually wrong with it?
I also tried 2 versions of the server (5.1.48 and 5.5.29) and the problem was present on both.
What's going on?
Thanks.