[MDEV-4007] max_query_timeout is not shown upon SELECT from mysql.user Created: 2013-01-07  Updated: 2014-06-06

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.29
Fix Version/s: 5.5

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-6963 Testing for max_query_time Closed

 Description   

If I add a column to mysql.user and set a user's MAX_QUERY_TIME, it is obviously stored, since it survives server restart; but the value is not shown in the result set of SELECT from mysql.user – max_query_timeout there is NULL.

The test below is pretty much the same as in the original patch, I've only added two SELECTs, before and after server restart:

Test output:

ALTER TABLE mysql.user ADD max_query_timeout decimal(14,6) AFTER max_user_connections;
FLUSH PRIVILEGES;
GRANT USAGE ON *.* TO user1@localhost WITH MAX_QUERY_TIME 1.005;
SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
user    host    max_query_timeout
user1   localhost       NULL
connect con1,localhost,user1,,test,,;
SELECT @@max_query_time;
@@max_query_time
1.005000
disconnect con1;
# restart and reconnect
connection default;
SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
user    host    max_query_timeout
user1   localhost       NULL
connect con1,localhost,user1,,test,,;
SELECT @@global.max_query_time,@@session.max_query_time;
@@global.max_query_time @@session.max_query_time
0.000000        1.005000
disconnect con1;
 

Test code:

--enable_connect_log
 
ALTER TABLE mysql.user ADD max_query_timeout decimal(14,6) AFTER max_user_connections;
FLUSH PRIVILEGES;
 
GRANT USAGE ON *.* TO user1@localhost WITH MAX_QUERY_TIME 1.005;
SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
 
connect(con1,localhost,user1,,test,,);
SELECT @@max_query_time;
disconnect con1;
 
--echo # restart and reconnect
connection default;
source include/restart_mysqld.inc;
 
SELECT user, host, max_query_timeout FROM mysql.user WHERE user='user1';
 
connect(con1,localhost,user1,,test,,);
SELECT @@global.max_query_time,@@session.max_query_time;
disconnect con1;
 

revision-id: monty@askmonty.org-20130103201517-ovawwss2pxed09tu
revno: 3612
branch: maria-5.5-monty


Generated at Thu Feb 08 06:53:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.