mysql variables

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rui
Posts: 3
Joined: Sun 23 Jan 2005 10:14

mysql variables

Post by rui » Thu 12 Jun 2008 18:25

I set a new value for a mysql environment variable using tmycommand component created on runtime with this sql:
SET GLOBAL tmp_table_size := 2000000;

Then i run another query like:

SHOW VARIABLES LIKE 'tmp_table_size';

and get the OLD value not the recent one. (por example: 18250110)
I need to close my app and launch it again to see the new value setted. Why?
If i promp for the value from another instance of my app launched BEFORE it shows the OLD value too. It seems like only new conections can view the change made from previous conections.
Thanks in advance and sorry for my english.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: mysql variables

Post by Dimon » Tue 17 Jun 2008 12:33

It's a specifity of MySQL server. MySQL Reference Manual specifies:
"The change affects the corresponding session variable only for clients that connect after the change.
The global variable change does not affect the session variable for any client that is currently connected (not even that of the client that issues the SET GLOBAL statement). "
rui wrote:I need to close my app and launch it again to see the new value setted.
You can only close a connection by the TMyConnection.Disconnect method and open it anew by TMyConnection.Connect.

Post Reply