Page 1 of 1

Error with temporary table

Posted: Thu 13 Dec 2012 17:16
by supercafelo
---SPANISH---
Hola,

He cambiado de la version 5 a la version 6 con Delphi XE3 y tengo problemas con la conexión a la BD.
El problema consiste en que el nuevo driver me da un "connection_id" diferente para cada query.
Esto me provoca que todas las tablas temporales que uso con MySQL dejen de funcionar.
Esto no pasaba con el driver anterior.

---ENGLISH---
Hi,

I changed from version 5 to version 6 with Delphi XE3 and I have trouble connecting to the database.
The problem is that the new driver gives me a "connection_id" different for each query.
This causes malfunction in the temporary tables.
This problem was not produced with the previous driver.


Example:

// MysqlServer 5.5.15 Windows Server 2008 64 bits
SQLConnection.DriverName := 'DevartMySQLDirect';
SQLConnection.LibraryName := 'dbexpmda40.dll';
SQLConnection.VendorLib := 'not used';
SQLConnection.GetDriverFunc := 'getSQLDriverMySQLDirect';
SQLConnection.Params.Clear;
SQLConnection.Params.Add('User_Name=root');
SQLConnection.Params.Add('Password=mypass');
SQLConnection.Params.Add('HostName=localhost');
SQLConnection.Params.Add('Database=mysql');
SQLConnection.Open;

query.Close;
query.SQL.Text := ' select connection_id() as id';
query.Open;
showmessage('Conection 1 --> ' + query.FieldByName('id').AsString);

query.Close;
query.SQL.Text := ' select connection_id() as id';
query.Open;
showmessage('Conection 2 --> ' + query.FieldByName('id').AsString);

query.Close;
query.SQL.Text := ' CREATE TEMPORARY TABLE tmp (field1 int not null default 0)';
query.ExecSQL;

query.Close;
query.SQL.Text := ' Select * from tmp';
query.Open; // Error, tmp table doesn't exist

Re: Error with temporary table

Posted: Fri 14 Dec 2012 14:21
by CristianP
Hi,

seems to be a closed connection after each execution.
What I see new in 6 is new threads opened and closed for each execution.
I hope this is related with my lost connection problem and solved both at the same time.

Best Regards,
Cristian Peta

Re: Error with temporary table

Posted: Tue 18 Dec 2012 08:25
by AndreyZ
Hello,

We have already fixed this problem. This fix will be included in the next dbExpress driver for MySQL build.

Re: Error with temporary table

Posted: Thu 27 Dec 2012 09:28
by supercafelo
Hello, I downloaded the 6.1.2 version of the driver and the error is fixed.
Thank you.

Re: Error with temporary table

Posted: Thu 27 Dec 2012 10:06
by AndreyZ
Thank you for the confirmation. If any other questions come up, please contact us.