Bug #7637 Test failure: 'user_limits': 'max_connections' not enforced / var. not set (64b)
Submitted: 3 Jan 2005 15:02 Modified: 26 Jan 2005 17:02
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-pre OS:Unix (various)
Assigned to: Dmitry Lenev CPU Architecture:Any

[3 Jan 2005 15:02] Joerg Bruehe
Description:
Using and build a pull of Dec 31 on the platforms, test 'user_limits' fails on several (but not all):

user_limits                    [ fail ]

Errors are (from /home/mysqldev/buildqnx/test/mysql-debug-5.0.3-alpha-pc-nto-qnx6.2.1-i386/mysql-test/var/log/mysqltest-time) :
/home/mysqldev/buildqnx/test/mysql-debug-5.0.3-alpha-pc-nto-qnx6.2.1-i386/bin/mysqltest: At line 68: query 'connect (mcph3' succeeded - should have failed with errno 1226...
/home/mysqldev/buildqnx/test/mysql-debug-5.0.3-alpha-pc-nto-qnx6.2.1-i386/bin/mysqltest: At line 155: Result length mismatch
(the last lines may be the most important ones)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** r/user_limits.result        Fri Dec 31 20:00:11 2004
--- r/user_limits.reject        Fri Dec 31 23:13:42 2004
***************
*** 39,45 ****
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
- ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections' resource (current value: 2)
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
--- 39,44 ----
***************
*** 73,79 ****
  grant usage on *.* to mysqltest_1@localhost;
  select @@session.max_user_connections, @@global.max_user_connections;
  @@session.max_user_connections        @@global.max_user_connections
! 2     2
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
--- 72,78 ----
  grant usage on *.* to mysqltest_1@localhost;
  select @@session.max_user_connections, @@global.max_user_connections;
  @@session.max_user_connections        @@global.max_user_connections
! 3     2
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
-------------------------------------------------------

This report is from QNX, I will add other platforms when I encounter their detailed results in the log scan.

How to repeat:
Run the test suite.
[3 Jan 2005 18:24] Joerg Bruehe
Classification of platforms (covering only 'debug' builds):

a) This failure occurs on buildqnx, cane-linuxthreads, powermacg5.

b) This test passed on bsd53, build, cane, ds9, hammer, ita2-rhas21, nocona-icc-glibc23, pegasos1, powermacg4 (!), quadita2-glibc23.

c) The test was not taken (compile/link errors or test crashes) on the remaining 22 platforms.
[17 Jan 2005 11:52] Joerg Bruehe
With the current build, the situation has become more complex, as more platforms now succeed inbuilding and attempt to take the test. This entry describes the state based on changeset
ChangeSet
  1.1771 05/01/13 15:10:12 lenz@mysql.com +1 -0
  - keep 5.0.3-alpha version string (after-merge fix)

1) The original failure occurs unchanged on QNX:
-------------------------------------------------------
*** r/user_limits.result        Thu Jan 13 19:38:55 2005
--- r/user_limits.reject        Fri Jan 14 00:43:04 2005
***************
*** 39,45 ****
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
- ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections' resource (current value: 2)
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
--- 39,44 ----
***************
*** 73,79 ****
  grant usage on *.* to mysqltest_1@localhost;
  select @@session.max_user_connections, @@global.max_user_connections;
  @@session.max_user_connections        @@global.max_user_connections
! 2     2
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
--- 72,78 ----
  grant usage on *.* to mysqltest_1@localhost;
  select @@session.max_user_connections, @@global.max_user_connections;
  @@session.max_user_connections        @@global.max_user_connections
! 3     2
  select * from t1;
  i
  connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
-------------------------------------------------------
Difference is identical for both debug and pro build, the others failed to compile or link.

Pegasos1 shows the first part only, and only in a standard build:
-------------------------------------------------------
   1080 *** r/user_limits.result        Thu Jan 13 19:38:55 2005
   1081 --- r/user_limits.reject        Fri Jan 14 05:02:40 2005
   1082 ***************
   1083 *** 39,45 ****
   1084   select * from t1;
   1085   i
   1086   connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
   1087 - ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections' resource (current value: 2)
   1088   select * from t1;
   1089   i
   1090   connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
   1091 --- 39,44 ----
   1092 -------------------------------------------------------
Here, cluster, debug, and pro pass the test.

2) Several platforms show a different (but IMO related) failure pattern:
-------------------------------------------------------
     23 *** r/user_limits.result        Thu Jan 13 19:38:55 2005
     24 --- r/user_limits.reject        Thu Jan 13 23:10:52 2005
     25 ***************
     26 *** 81,87 ****
     27   grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
     28   select @@session.max_user_connections, @@global.max_user_connections;
     29   @@session.max_user_connections        @@global.max_user_connections
     30 ! 3     2
     31   connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
     32   ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: 3)
     33   set global max_user_connections= 0;
     34 --- 81,87 ----
     35   grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
     36   select @@session.max_user_connections, @@global.max_user_connections;
     37   @@session.max_user_connections        @@global.max_user_connections
     38 ! 0     2
     39   connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
     40   ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: 3)
     41   set global max_user_connections= 0;
     42 -------------------------------------------------------
This can be observed on
aix52 (64 bit only!), butch (64), hp3750 (64), hpita2 (64), hpux11 (64), octane2 (64), sunfire100b (64), and sunfire100c (64).

3) The test passes on
aix52 (32 bit only!), barney, bitch, production (during Bootstrap), bsd53, build, butch (32 bit only), cane, ds9, etpglb0, hammer, hp3750 (32), hpux11 (32), intelxeon3, ita2, nocona, octane2 (32), powermacg4, powermacg5, quadita2, sol9x86, sunfire100b (32), and sunfire100c (32).
[26 Jan 2005 17:02] Dmitry Lenev
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

ChangeSet@1.1766.35.1, 2005-01-20 00:54:01+03:00, dlenev@brandersnatch.localdomain
  Fix for bug #7637: "Test failure: 'user_limits' on QNX and 64-bit systems"
  
  Made user_limits.test scheduling independant (this solves failure on QNX).
  
  Made sys_var_max_user_conn variable int sized. Changed 
  max_user_connections from ulong to uint to be able to use it in 
  sys_var_max_user_conn::value_ptr() (solves failures on 64-bit platforms).