"SET GLOBAL wait_timeout=60" doesn"t work as documented...

"SET GLOBAL wait_timeout=60" doesn"t work as documented...

am 10.09.2002 08:23:14 von Jeremy Zawodny

According to the docs here:

http://www.mysql.com/doc/en/SET_OPTION.html

and here:

http://www.mysql.com/doc/en/System_Variables.html

This shouldn't happen:

---snip---

[mysql@db-master1 yahoo]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2806 to server version: 4.0.4-beta-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

mysql> set global wait_timeout=60;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

mysql> Bye


---snip---

How-to-repeat: just run those commands.

That's a 4.0.4 binary built form the latest BitKeeper tree on Linux
2.4.18. It's also the database for http://remember.yahoo.com/

Thanks,

Jeremy
--
Jeremy D. Zawodny,
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12515@lists.mysql.com
To unsubscribe, e-mail

Re: "SET GLOBAL wait_timeout=60" doesn"t work as documented...

am 10.09.2002 08:29:54 von Jeremy Zawodny

On Mon, Sep 09, 2002 at 11:23:14PM -0700, Jeremy Zawodny wrote:
>
> This shouldn't happen:
>
> ---snip---
>
> [mysql@db-master1 yahoo]$ mysql -u root -p
> Enter password:
> Welcome to the MySQL monitor. Commands end with ; or \g.
> Your MySQL connection id is 2806 to server version: 4.0.4-beta-log
>
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>
> mysql> show variables like 'wait_timeout';
> +---------------+-------+
> | Variable_name | Value |
> +---------------+-------+
> | wait_timeout | 28800 |
> +---------------+-------+
> 1 row in set (0.00 sec)
>
> mysql> set global wait_timeout=60;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> show variables like 'wait_timeout';
> +---------------+-------+
> | Variable_name | Value |
> +---------------+-------+
> | wait_timeout | 28800 |
> +---------------+-------+
> 1 row in set (0.00 sec)
>
> mysql> Bye
>
>
> ---snip---
>
> How-to-repeat: just run those commands.
>

Even more mysterious is this. I reconnect as root on localhos and do
this:

---snip---

[mysql@db-master1 yahoo]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2977 to server version: 4.0.4-beta-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select @@session.wait_timeout;
+----------------+
| @@wait_timeout |
+----------------+
| 28800 |
+----------------+
1 row in set (0.00 sec)

mysql> select @@global.wait_timeout;
+----------------+
| @@wait_timeout |
+----------------+
| 60 |
+----------------+
1 row in set (0.00 sec)

mysql> Bye

---snip---

I'm confused. Why are those two different?

How-to-repeat: just do what I did. :-)

The manual says:

Global variables also are used to set up the initial values of the
corresponding thread-specific variables for new connections.

But that appears not to be true?

Jeremy
--
Jeremy D. Zawodny,
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12516@lists.mysql.com
To unsubscribe, e-mail

"SET GLOBAL wait_timeout=60" doesn"t work as documented...

am 11.09.2002 00:36:48 von Michael Widenius

Hi!

>>>>> "Jeremy" == Jeremy Zawodny writes:



Jeremy> [mysql@db-master1 yahoo]$ mysql -u root -p
Jeremy> Enter password:
Jeremy> Welcome to the MySQL monitor. Commands end with ; or \g.
Jeremy> Your MySQL connection id is 2806 to server version: 4.0.4-beta-log

Jeremy> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like 'wait_timeout';
Jeremy> +---------------+-------+
Jeremy> | Variable_name | Value |
Jeremy> +---------------+-------+
Jeremy> | wait_timeout | 28800 |
Jeremy> +---------------+-------+
Jeremy> 1 row in set (0.00 sec)

mysql> set global wait_timeout=60;
Jeremy> Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'wait_timeout';
Jeremy> +---------------+-------+
Jeremy> | Variable_name | Value |
Jeremy> +---------------+-------+
Jeremy> | wait_timeout | 28800 |
Jeremy> +---------------+-------+
Jeremy> 1 row in set (0.00 sec)

Jeremy> How-to-repeat: just run those commands.

The above is correct. In the last query you are looking at the thread
specific variable, not the startup variable.

To repeat:

mysql> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

mysql> set global wait_timeout=60;
Query OK, 0 rows affected (0.00 sec)

mysql> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 60 |
+---------------+-------+
1 row in set (0.00 sec)

And with the alternative syntax:

mysql> set @@session.wait_timeout=70;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@session.wait_timeout,@@global.wait_timeout;
+----------------+----------------+
| @@wait_timeout | @@wait_timeout |
+----------------+----------------+
| 70 | 60 |
+----------------+----------------+
1 row in set (0.00 sec)

In other words, you have two variables, 'session.wait_timeout'
andd 'global.wait_timeout' that can be set independently.

Is this clear ?

Regards,
Monty

--
For technical support contracts, goto https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Michael Widenius
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, CTO
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12530@lists.mysql.com
To unsubscribe, e-mail

Re: "SET GLOBAL wait_timeout=60" doesn"t work as documented...

am 11.09.2002 00:39:55 von Michael Widenius

Hi!

>>>>> "Jeremy" == Jeremy Zawodny writes:



Jeremy> Even more mysterious is this. I reconnect as root on localhos and do
Jeremy> this:

Jeremy> ---snip---

Jeremy> [mysql@db-master1 yahoo]$ mysql -u root -p
Jeremy> Enter password:
Jeremy> Welcome to the MySQL monitor. Commands end with ; or \g.
Jeremy> Your MySQL connection id is 2977 to server version: 4.0.4-beta-log

Jeremy> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select @@session.wait_timeout;
Jeremy> +----------------+
Jeremy> | @@wait_timeout |
Jeremy> +----------------+
Jeremy> | 28800 |
Jeremy> +----------------+
Jeremy> 1 row in set (0.00 sec)

This comes from the fact that the 'mysql' command line client
initializes wait_timeout from 'interactive_timeout' as this is an
interactive client.

The idea is that one can high a higher default timeout on interactive
clients than on program clients...

mysql> select @@global.wait_timeout;
Jeremy> +----------------+
Jeremy> | @@wait_timeout |
Jeremy> +----------------+
Jeremy> | 60 |
Jeremy> +----------------+
Jeremy> 1 row in set (0.00 sec)

The above is set as you did in your last email.

Regards,
Monty
CTO of MySQL AB

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12531@lists.mysql.com
To unsubscribe, e-mail

Re: "SET GLOBAL wait_timeout=60" doesn"t work as documented...

am 11.09.2002 11:03:44 von Jeremy Zawodny

On Wed, Sep 11, 2002 at 01:39:55AM +0300, Michael Widenius wrote:
>
>
> mysql> select @@session.wait_timeout;
> Jeremy> +----------------+
> Jeremy> | @@wait_timeout |
> Jeremy> +----------------+
> Jeremy> | 28800 |
> Jeremy> +----------------+
> Jeremy> 1 row in set (0.00 sec)
>
> This comes from the fact that the 'mysql' command line client
> initializes wait_timeout from 'interactive_timeout' as this is an
> interactive client.

Ahhh, yes!

Now I'm far less confused. :-)

Thanks,

Jeremy
--
Jeremy D. Zawodny,
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12532@lists.mysql.com
To unsubscribe, e-mail