Error with temporary table

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
supercafelo
Posts: 4
Joined: Mon 12 Mar 2012 15:22

Error with temporary table

Post by supercafelo » Thu 13 Dec 2012 17:16

---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

CristianP
Posts: 69
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: Error with temporary table

Post by CristianP » Fri 14 Dec 2012 14:21

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

AndreyZ

Re: Error with temporary table

Post by AndreyZ » Tue 18 Dec 2012 08:25

Hello,

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

supercafelo
Posts: 4
Joined: Mon 12 Mar 2012 15:22

Re: Error with temporary table

Post by supercafelo » Thu 27 Dec 2012 09:28

Hello, I downloaded the 6.1.2 version of the driver and the error is fixed.
Thank you.

AndreyZ

Re: Error with temporary table

Post by AndreyZ » Thu 27 Dec 2012 10:06

Thank you for the confirmation. If any other questions come up, please contact us.

Post Reply