Bug #41066 status2 test fails
Submitted: 27 Nov 2008 4:39 Modified: 27 Nov 2008 9:20
Reporter: Robin Johnson Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.0.72 OS:Linux (Gentoo/2.6.28-rc2-00338-g65fc716)
Assigned to: CPU Architecture:Any
Tags: status2

[27 Nov 2008 4:39] Robin Johnson
Description:
The status2 test fails in the ps-protocol run. It does not fail during the ns-protocol run.

Logging: ./mysql-test-run.pl --force --vardir=/dev/shm/portage/dev-db/mysql-5.0.72/work/mysql/mysql-test/var-ps --ps-protocol
MySQL Version 5.0.72
Using ndbcluster when necessary, mysqld supports it
Setting mysqld to support SSL connections
Using MTR_BUILD_THREAD      = 28
Using MASTER_MYPORT         = 10280
Using MASTER_MYPORT1        = 10281
Using SLAVE_MYPORT          = 10282
Using SLAVE_MYPORT1         = 10283
Using SLAVE_MYPORT2         = 10284
Using NDBCLUSTER_PORT       = 10285
Using IM_PORT               = 10287
Using IM_MYSQLD1_PORT       = 10288
Using IM_MYSQLD2_PORT       = 10289
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
Installing Master Database
Installing Master Database
Installing Slave1 Database
Installing Master Cluster
Saving snapshot of installed databases
...
status2                        [ fail ]

--- /dev/shm/portage/dev-db/mysql-5.0.72/work/mysql/mysql-test/r/status2.result	2008-10-24 20:37:55.000000000 +0300
+++ /dev/shm/portage/dev-db/mysql-5.0.72/work/mysql/mysql-test/r/status2.reject	2008-11-27 07:11:47.239747239 +0300
@@ -55,9 +55,9 @@
 Questions	16
 Global status updated; Assert diff == 5
 FLUSH STATUS;
-SELECT 5;
-5
-5
+SELECT 4;
+4
+4
 DROP TABLE t1,t2;
 DROP PROCEDURE p1;
 DROP FUNCTION f1;

mysqltest: Result content mismatch

Stopping All Servers
Restoring snapshot of databases
Resuming Tests
...
Failed 1/501 tests, 99.80% were successful.
...

mysql-test-run in ps-protocol mode: *** Failing the test(s): status2
mysql-test-run: *** ERROR: there were failing test cases
make: *** [test-ps] Error 1

How to repeat:
Just running the mysql testcases.

Configured with:
./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libexecdir=/usr/sbin --sysconfdir=/etc/mysql --localstatedir=/var/lib/mysql --sharedstatedir=/usr/share/mysql --libdir=/usr/lib64/mysql --includedir=/usr/include/mysql --with-low-memory --with-client-ldflags=-lstdc++ --enable-thread-safe-client --with-comment=Gentoo Linux mysql-5.0.72 --without-docs --without-big-tables --enable-local-infile --with-extra-charsets=all --with-mysqld-user=mysql --with-server --with-unix-socket-path=/var/run/mysqld/mysqld.sock --without-libwrap --enable-shared --enable-static --without-debug --without-ndb-debug --with-charset=utf8 --with-collation=utf8_general_ci --with-embedded-privilege-control --with-embedded-server --with-bench --enable-assembler --with-extra-tools --with-innodb --without-readline --with-openssl --without-berkeley-db --with-geometry --with-ndbcluster --with-archive-storage-engine --with-csv-storage-engine --with-blackhole-storage-engine --with-federated-storage-engine --build=x86_64-pc-linux-gnu CFLAGS="-march=nocona -O2 -pipe -g" CXXFLAGS="-march=nocona -O2 -pipe -g"

System details:

Portage 2.2_rc16 (!/etc/portage/profile, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.28-rc2-00338-g65fc716 x86_64)
=================================================================
System uname: Linux-2.6.28-rc2-00338-g65fc716-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-glibc2.2.5
[27 Nov 2008 5:13] Robin Johnson
Ok, it's not unique to ps-protocol. I tested on a few more systems and it sometimes fails in ns-protocol as well, same diff output.
[27 Nov 2008 9:20] Valeriy Kravchuk
I can not repeat this with current 5.0.74 from bzr:

openxs@suse:/home2/openxs/dbs/5.0/mysql-test> ./mysql-test-run.pl --ps-protocol status2
Logging: ./mysql-test-run.pl --ps-protocol status2
MySQL Version 5.0.74
Using ndbcluster when necessary, mysqld supports it
Setting mysqld to support SSL connections
Binaries are debug compiled
mysql-test-run: WARNING: Could not find all required ndb binaries, all ndb tests will fail, use --skip-ndbcluster to skip testing it.
Using MTR_BUILD_THREAD      = 0
Using MASTER_MYPORT         = 9306
Using MASTER_MYPORT1        = 9307
Using SLAVE_MYPORT          = 9308
Using SLAVE_MYPORT1         = 9309
Using SLAVE_MYPORT2         = 9310
Using NDBCLUSTER_PORT       = 9311
Using IM_PORT               = 9313
Using IM_MYSQLD1_PORT       = 9314
Using IM_MYSQLD2_PORT       = 9315
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
Installing Master Database
=======================================================
Starting Tests in the 'main' suite

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

status2                        [ pass ]            135
-------------------------------------------------------
Stopping All Servers
skipped 9 bytes from file: socket (3)
All 1 tests were successful.
The servers were restarted 1 times
Spent 0.135 of 4 seconds executing testcases

Moreover, after taking a look at the current test code:

...
--echo Global status updated; Assert diff == 4
FLUSH STATUS;
let $new_questions= `SHOW GLOBAL STATUS LIKE 'questions'`;
--disable_log
let $diff= `SELECT SUBSTRING('$new_questions',10)-SUBSTRING('$org_quest
ions',10)`;
--enable_log
eval SELECT $diff;
disconnect con1;
DROP TABLE t1,t2;
...

I'd say that 4 is correct result. Looks like it was a bug in test itself that is already fixed.