[MDEV-11082] mysql_client_test: test_ps_query_cache fails with group-concat-max-len=1M Created: 2016-10-18  Updated: 2016-12-19  Resolved: 2016-10-19

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.1.18, 5.5, 10.0, 10.1
Fix Version/s: 10.1.19, 10.2.3

Type: Bug Priority: Major
Reporter: Nirbhay Choubey (Inactive) Assignee: Elena Stepanova
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-7635 update defaults and simplify mysqld c... Closed

 Description   

nirbhay@nirbhay-vbox:~/project/git-repo/mariadb/10.1/install/mysql-test$ perl mtr main.mysql_client_test --mysqld=--group-concat-max-len=1K
Logging: mtr  main.mysql_client_test --mysqld=--group-concat-max-len=1K
vardir: /home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var'...
Checking supported features...
MariaDB Version 10.1.19-MariaDB-debug
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
Installing system database...
 
==============================================================================
 
TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------
 
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
main.mysql_client_test                   [ pass ]  43368
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 43.368 of 50 seconds executing testcases
 
Completed: All 1 tests were successful.
 
nirbhay@nirbhay-vbox:~/project/git-repo/mariadb/10.1/install/mysql-test$ perl mtr main.mysql_client_test --mysqld=--group-concat-max-len=1M
Logging: mtr  main.mysql_client_test --mysqld=--group-concat-max-len=1M
vardir: /home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var'...
Checking supported features...
MariaDB Version 10.1.19-MariaDB-debug
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
Installing system database...
 
==============================================================================
 
TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------
 
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
main.mysql_client_test                   [ fail ]
        Test ended at 2016-10-18 14:32:02
 
CURRENT_TEST: main.mysql_client_test
mysqltest: At line 19: exec of '/home/nirbhay/project/git-repo/mariadb/10.1/install/bin/mysql_client_test --defaults-file=/home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var/my.cnf --testcase --vardir=/home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var --getopt-ll-test=25600M >> /home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var/log/mysql_client_test.out.log 2>&1' failed, error: 256, status: 1, errno: 2
Output from before failure:
call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'");
 
 
 
The result from queries just before the failure was:
SET @old_general_log= @@global.general_log;
SET @old_slow_query_log= @@global.slow_query_log;
call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'");
 
 - saving '/home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var/log/main.mysql_client_test/' to '/home/nirbhay/project/git-repo/mariadb/10.1/install/mysql-test/var/log/main.mysql_client_test/'
-------------------------------------------------------------------------
The servers were restarted 0 times
Spent 0.000 of 13 seconds executing testcases
 
Failure: Failed 1/1 tests, 0.00% were successful.
 
Failing test(s): main.mysql_client_test

$cat var/log/mysql_client_test.out.log
...
#####################################
209 of (1/1): test_ps_query_cache
#####################################
...
 row 2: 1, ii(2)
 row 3: 2, ii(2)/home/nirbhay/project/git-repo/mariadb/10.1/tests/mysql_client_test.c:2455: check failed: 'hits1-hits2 == 1'
MySQL error 0:
...



 Comments   
Comment by Nirbhay Choubey (Inactive) [ 2016-10-18 ]

On the contrary, the test also fails when executed manually even with group-concat-max-len=1K (default).

nirbhay@nirbhay-vbox:~/project/git-repo/mariadb/10.1/install$ ./bin/mysql_client_test --user=root --socket=/tmp/my_node1.sock test_ps_query_cache
...
#####################################
1 of (1/1): test_ps_query_cache  
#####################################
...
 row 3: 2, ii(2)/home/nirbhay/project/git-repo/mariadb/10.1/tests/mysql_client_test.c:2455: check failed: 'hits1-hits2 == 1'
MySQL error 0: 

Comment by Elena Stepanova [ 2016-10-18 ]

The tests are very dirty, they don't clean session values they set (and don't re-establish connections).
Specifically, test_ps_query_cache fails with group_concat_max_len != 1024 when executed in a sequence of tests because one of previous tests, test_bug14169, runs set session group_concat_max_len=1024 and forgets about it.
So, when test_ps_query_cache is run with a new option value, it still has 1024 in one connection and when it establishes another one to run TEST_QCACHE_ON_WITH_OTHER_CONN iteration, two connections have different values. This option is a part of query cache logic, so when it does not match, instead of the expected QC hit the query ends up inserted into the cache again, hence the problem.

With the test executed separately, the problem is somewhat similar. It sets SQL_MODE='' for the connection it establishes itself, but does not modify it for the existing one. Since nowadays the default SQL_MODE is not empty, and SQL_MODE is also a part of the query cache logic, the result is the same – insert instead of a hit.

I'll fix the part which causes the problem with group_concat_max_len, and will fix it in 10.1 only. I don't think it's realistic at the moment to clean up the whole test, and it makes no sense to fix just one thing in previous versions where it's not important anyway.

Comment by Elena Stepanova [ 2016-10-19 ]

https://github.com/MariaDB/server/commit/25848978334f9682f0b4712bf9d7c8222bab606f

Generated at Thu Feb 08 07:47:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.