Bug #30418 "datadict" tests (all engines) fail: Dependency on the host name for ordering
Submitted: 14 Aug 2007 18:30 Modified: 21 Nov 2007 20:22
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.1.21, 5.0 BK OS:Any
Assigned to: Matthias Leich CPU Architecture:Any

[14 Aug 2007 18:30] Joerg Bruehe
Description:
Detected in the 5.1.21 release builds.

The "*__datadict" tests replace the actual host name 
by the string "<SERVER_NAME>" to avoid test variations - good.

But this can only happen in the test client, when the server has already provided the data - the server still uses the true host name.

Now depending on the host name, in an alphabetic sorting this value may sort before or after "localhost", so the order of results still depends on the host name.

For all hosts whose name sorts after "localhost", this causes these differences:

-------------------------------------------------------
*** /PATH/mysql-test/suite/funcs_1/r/innodb__datadict.result
--- /PATH/mysql-test/suite/funcs_1/r/innodb__datadict.reject
***************
*** 421,428
  SELECT * FROM db_datadict.vu order by u;
  u     server  Server_Clean
  'root'@'127.0.0.1'    127.0.0.1'      127.0.0.1
- 'root'@'<SERVER_NAME>'        <SERVER_NAME>'  <SERVER_NAME>
  'root'@'localhost'    localhost'      localhost
  CREATE PROCEDURE db_datadict.sp_1()
  BEGIN
  SELECT * FROM db_datadict.v1;
--- 421,428
  SELECT * FROM db_datadict.vu order by u;
  u     server  Server_Clean
  'root'@'127.0.0.1'    127.0.0.1'      127.0.0.1
  'root'@'localhost'    localhost'      localhost
+ 'root'@'<SERVER_NAME>'        <SERVER_NAME>'  <SERVER_NAME>
  CREATE PROCEDURE db_datadict.sp_1()
  BEGIN
  SELECT * FROM db_datadict.v1;
***************
...
***************
*** 3311,3343
  'root'@'127.0.0.1'    NULL    SUPER   YES
  'root'@'127.0.0.1'    NULL    TRIGGER YES
  'root'@'127.0.0.1'    NULL    UPDATE  YES
- 'root'@'<SERVER_NAME>'        NULL    ALTER   YES
- 'root'@'<SERVER_NAME>'        NULL    ALTER ROUTINE   YES
- (( 23 lines deleted ))
- 'root'@'<SERVER_NAME>'        NULL    TRIGGER YES
- 'root'@'<SERVER_NAME>'        NULL    UPDATE  YES
  'root'@'localhost'    NULL    ALTER   YES
  'root'@'localhost'    NULL    ALTER ROUTINE   YES
  'root'@'localhost'    NULL    CREATE  YES
--- 3311,3316
***************
*** 3365,3370
--- 3338,3370
  'root'@'localhost'    NULL    SUPER   YES
  'root'@'localhost'    NULL    TRIGGER YES
  'root'@'localhost'    NULL    UPDATE  YES
+ 'root'@'<SERVER_NAME>'        NULL    ALTER   YES
+ 'root'@'<SERVER_NAME>'        NULL    ALTER ROUTINE   YES
+ (( 23 lines deleted ))
+ 'root'@'<SERVER_NAME>'        NULL    TRIGGER YES
+ 'root'@'<SERVER_NAME>'        NULL    UPDATE  YES
  select * from schema_privileges;
  GRANTEE       TABLE_CATALOG   TABLE_SCHEMA    PRIVILEGE_TYPE  IS_GRANTABLE
  ''@'%'        NULL    test    SELECT  NO
***************
...
***************
*** 3568,3575
    order by grantee;
  user's having select privilege        substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
  'root'@'127.0.0.1'    '127.0.0.1'
- 'root'@'<SERVER_NAME>'        '<SERVER_NAME>'
  'root'@'localhost'    'localhost'
  select all table_schema from schema_privileges limit 0,5;
  table_schema
  test
--- 3568,3575
    order by grantee;
  user's having select privilege        substring( grantee, length(SUBSTRING_INDEX(grantee,_utf8'@',1))+2 )
  'root'@'127.0.0.1'    '127.0.0.1'
  'root'@'localhost'    'localhost'
+ 'root'@'<SERVER_NAME>'        '<SERVER_NAME>'
  select all table_schema from schema_privileges limit 0,5;
  table_schema
  test
***************
***************
*** 5903,5910
  select distinct grantee from user_privileges order by grantee, privilege_type;
  grantee
  'root'@'127.0.0.1'
- 'root'@'<SERVER_NAME>'
  'root'@'localhost'
  select * from schema_privileges where table_catalog is null limit 0, 5;
  GRANTEE       TABLE_CATALOG   TABLE_SCHEMA    PRIVILEGE_TYPE  IS_GRANTABLE
  ''@'%'        NULL    test    SELECT  NO
--- 5903,5910
  select distinct grantee from user_privileges order by grantee, privilege_type;
  grantee
  'root'@'127.0.0.1'
  'root'@'localhost'
+ 'root'@'<SERVER_NAME>'
  select * from schema_privileges where table_catalog is null limit 0, 5;
  GRANTEE       TABLE_CATALOG   TABLE_SCHEMA    PRIVILEGE_TYPE  IS_GRANTABLE
  ''@'%'        NULL    test    SELECT  NO
***************
*** 5972,6004
  'root'@'127.0.0.1'
  'root'@'127.0.0.1'
  'root'@'127.0.0.1'
- 'root'@'<SERVER_NAME>'
- 'root'@'<SERVER_NAME>'
- (( 23 lines deleted ))
- 'root'@'<SERVER_NAME>'
- 'root'@'<SERVER_NAME>'
  'root'@'localhost'
  'root'@'localhost'
  'root'@'localhost'
--- 5972,5977
***************
*** 6026,6031
--- 5999,6031
  'root'@'localhost'
  'root'@'localhost'
  'root'@'localhost'
+ 'root'@'<SERVER_NAME>'
+ 'root'@'<SERVER_NAME>'
+ (( 23 lines deleted ))
+ 'root'@'<SERVER_NAME>'
+ 'root'@'<SERVER_NAME>'
  select id , character_set_name from collations order by id asc limit 10;
  id    character_set_name
  1     big5
***************

and more similar results.

Same issue for "memory__datadict", "myisam__datadict", and "ndb__datadict".

How to repeat:
Run "innodb__datadict" (or any other "*__datadict") test
on a host whose name sorts after "localhost".

Suggested fix:
Try to do without "order by" (risky, I know - results may be unstable then),
or use some other column which sorts stable.
[15 Aug 2007 21:28] Matthias Leich
--replace_result $SERVER_NAME <SERVER_NAME>
--sorted_result
SELECT * FROM db_datadict.vu order by u;

instead of

--replace_result $SERVER_NAME <SERVER_NAME>
SELECT * FROM db_datadict.vu order by u;

should help.
[24 Aug 2007 12:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/33021

ChangeSet@1.2489, 2007-08-24 14:40:47+02:00, mleich@otto.local.lan +1 -0
  Fix for
      Bug#30418 "datadict" tests (all engines) fail: Dependency on the host name for ordering
  Attention: This is not the final changeset, so please ignore the bk commit email.
[25 Aug 2007 18:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/33109

ChangeSet@1.2490, 2007-08-25 20:53:25+02:00, mleich@four.local.lan +13 -0
  Fixes for
     Bug#30418 "datadict" tests (all engines) fail: Dependency on the host name
                for ordering
     Bug#30420 "datadict" tests (all engines) fail: Release build has help tables loaded
     Bug#30438 "{memory,myisam,ndb}__datadict" tests fail: Use "InnoDB" without checking
     Bug#30440 "datadict" tests (all engines) fail: Character sets depend on configuration
  Attention: Only the build team can check if Bug#30440 is really fixed.
[25 Aug 2007 19:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/33110

ChangeSet@1.2489, 2007-08-25 21:14:52+02:00, mleich@four.local.lan +13 -0
  Fixes for
     Bug#30418 "datadict" tests (all engines) fail: Dependency on the host name
                for ordering
     Bug#30420 "datadict" tests (all engines) fail: Release build has help tables loaded
     Bug#30438 "{memory,myisam,ndb}__datadict" tests fail: Use "InnoDB" without checking
     Bug#30440 "datadict" tests (all engines) fail: Character sets depend on configuration
  Attention: Only the build team can check if Bug#30440 is really fixed.
[27 Aug 2007 18:21] Trudy Pelzer
Note that the patch (http://lists.mysql.com/commits/33110)
is for 5.0 only; it does not fix the tests for 5.1 and up
due to differences between 5.0 and 5.1+. This patch will 
be pushed to 5.0 and null-merged upward, then a new patch
will be written to fix the tests for 5.1 and up.
[28 Aug 2007 16:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/33239

ChangeSet@1.2509, 2007-08-28 18:37:17+02:00, mleich@four.local.lan +12 -0
  Fixes for
       Bug#30418 "datadict" tests (all engines) fail: Dependency on the host name
                  for ordering
       Bug#30420 "datadict" tests (all engines) fail: Release build has help tables loaded
       Bug#30438 "{memory,myisam,ndb}__datadict" tests fail: Use "InnoDB" without checking
       Bug#30440 "datadict" tests (all engines) fail: Character sets depend on configuration
  Attention: Only the build team can check if Bug#30440 is really fixed.
[30 Aug 2007 10:56] Matthias Leich
Sorry for confusing commit emails which were sent to partially
wrong email lists.
ChangeSet@1.1810.2871.68, 2007-08-28
    (http://lists.mysql.com/commits/33239)
fixes this bug for MySQL 5.0.
Fix is pushed.

ChangeSet@1.2545, 2007-08-28   
ChangeSet@1.2546, 2007-08-28
    (http://lists.mysql.com/commits/33248)
ChangeSet@1.2547, 2007-08-29
    (http://lists.mysql.com/commits/33397)
fix this bug for MySQL 5.1.
Attention:
   The test ndb__datadict fails because
   of reasons outside of the scope of this bug fix.
Fix is pushed.

There is no documentation needed.
[26 Sep 2007 13:08] Bugs System
Pushed into 5.0.50
[26 Sep 2007 13:21] Bugs System
Pushed into 5.1.23-beta
[26 Sep 2007 13:39] Paul DuBois
Test case changes. No changelog entry needed.
[12 Oct 2007 15:55] Joerg Bruehe
The leading occurrences have been corrected,
but in a custom build based on 5.0.50 these were still present:

@@ -6193,31 +6193,6 @@
 'root'@'127.0.0.1'     NULL    SHUTDOWN        YES
 'root'@'127.0.0.1'     NULL    SUPER   YES
 'root'@'127.0.0.1'     NULL    UPDATE  YES
-'root'@'<SERVER_NAME>' NULL    ALTER   YES
-'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
-... (21 lines deleted)
-'root'@'<SERVER_NAME>' NULL    SUPER   YES
-'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'root'@'localhost'     NULL    ALTER   YES
 'root'@'localhost'     NULL    ALTER ROUTINE   YES
 'root'@'localhost'     NULL    CREATE  YES
@@ -6243,6 +6218,31 @@
 'root'@'localhost'     NULL    SHUTDOWN        YES
 'root'@'localhost'     NULL    SUPER   YES
 'root'@'localhost'     NULL    UPDATE  YES
+'root'@'<SERVER_NAME>' NULL    ALTER   YES
+'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
+... (21 lines deleted)
+'root'@'<SERVER_NAME>' NULL    SUPER   YES
+'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 select *
 from information_schema.column_privileges
 where table_schema like 'db_datadict%';
@@ -6338,31 +6338,6 @@
 'root'@'127.0.0.1'     NULL    SHUTDOWN        YES
 'root'@'127.0.0.1'     NULL    SUPER   YES
 'root'@'127.0.0.1'     NULL    UPDATE  YES
-'root'@'<SERVER_NAME>' NULL    ALTER   YES
-'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
-... (21 lines deleted)
-'root'@'<SERVER_NAME>' NULL    SUPER   YES
-'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'root'@'localhost'     NULL    ALTER   YES
 'root'@'localhost'     NULL    ALTER ROUTINE   YES
 'root'@'localhost'     NULL    CREATE  YES
@@ -6388,6 +6363,31 @@
 'root'@'localhost'     NULL    SHUTDOWN        YES
 'root'@'localhost'     NULL    SUPER   YES
 'root'@'localhost'     NULL    UPDATE  YES
+'root'@'<SERVER_NAME>' NULL    ALTER   YES
+'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
+... (21 lines deleted)
+'root'@'<SERVER_NAME>' NULL    SUPER   YES
+'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'u_6_401013'@'localhost'       NULL    USAGE   NO
 select *
 from information_schema.column_privileges
@@ -6469,31 +6469,6 @@
 'root'@'127.0.0.1'     NULL    SHUTDOWN        YES
 'root'@'127.0.0.1'     NULL    SUPER   YES
 'root'@'127.0.0.1'     NULL    UPDATE  YES
-'root'@'<SERVER_NAME>' NULL    ALTER   YES
-'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
-... (21 lines deleted)
-'root'@'<SERVER_NAME>' NULL    SUPER   YES
-'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'root'@'localhost'     NULL    ALTER   YES
 'root'@'localhost'     NULL    ALTER ROUTINE   YES
 'root'@'localhost'     NULL    CREATE  YES
@@ -6519,6 +6494,31 @@
 'root'@'localhost'     NULL    SHUTDOWN        YES
 'root'@'localhost'     NULL    SUPER   YES
 'root'@'localhost'     NULL    UPDATE  YES
+'root'@'<SERVER_NAME>' NULL    ALTER   YES
+'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
+... (21 lines deleted)
+'root'@'<SERVER_NAME>' NULL    SUPER   YES
+'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 select *
 from information_schema.column_privileges
 where table_schema like 'db_datadict%';
@@ -6612,31 +6612,6 @@
 'root'@'127.0.0.1'     NULL    SHUTDOWN        YES
 'root'@'127.0.0.1'     NULL    SUPER   YES
 'root'@'127.0.0.1'     NULL    UPDATE  YES
-'root'@'<SERVER_NAME>' NULL    ALTER   YES
-'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
-... (21 lines deleted)
-'root'@'<SERVER_NAME>' NULL    SUPER   YES
-'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'root'@'localhost'     NULL    ALTER   YES
 'root'@'localhost'     NULL    ALTER ROUTINE   YES
 'root'@'localhost'     NULL    CREATE  YES
@@ -6662,6 +6637,31 @@
 'root'@'localhost'     NULL    SHUTDOWN        YES
 'root'@'localhost'     NULL    SUPER   YES
 'root'@'localhost'     NULL    UPDATE  YES
+'root'@'<SERVER_NAME>' NULL    ALTER   YES
+'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
+... (21 lines deleted)
+'root'@'<SERVER_NAME>' NULL    SUPER   YES
+'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 select *
 from information_schema.column_privileges
 where table_schema like 'db_datadict%';
@@ -6751,31 +6751,6 @@
 'root'@'127.0.0.1'     NULL    SHUTDOWN        YES
 'root'@'127.0.0.1'     NULL    SUPER   YES
 'root'@'127.0.0.1'     NULL    UPDATE  YES
-'root'@'<SERVER_NAME>' NULL    ALTER   YES
-'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
-... (21 lines deleted)
-'root'@'<SERVER_NAME>' NULL    SUPER   YES
-'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'root'@'localhost'     NULL    ALTER   YES
 'root'@'localhost'     NULL    ALTER ROUTINE   YES
 'root'@'localhost'     NULL    CREATE  YES
@@ -6801,6 +6776,31 @@
 'root'@'localhost'     NULL    SHUTDOWN        YES
 'root'@'localhost'     NULL    SUPER   YES
 'root'@'localhost'     NULL    UPDATE  YES
+'root'@'<SERVER_NAME>' NULL    ALTER   YES
+'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
+... (21 lines deleted)
+'root'@'<SERVER_NAME>' NULL    SUPER   YES
+'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 select *
 from information_schema.column_privileges
 where table_schema like 'db_datadict%';
@@ -6903,31 +6903,6 @@
 'root'@'127.0.0.1'     NULL    SHUTDOWN        YES
 'root'@'127.0.0.1'     NULL    SUPER   YES
 'root'@'127.0.0.1'     NULL    UPDATE  YES
-'root'@'<SERVER_NAME>' NULL    ALTER   YES
-'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
-... (21 lines deleted)
-'root'@'<SERVER_NAME>' NULL    SUPER   YES
-'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'root'@'localhost'     NULL    ALTER   YES
 'root'@'localhost'     NULL    ALTER ROUTINE   YES
 'root'@'localhost'     NULL    CREATE  YES
@@ -6953,6 +6928,31 @@
 'root'@'localhost'     NULL    SHUTDOWN        YES
 'root'@'localhost'     NULL    SUPER   YES
 'root'@'localhost'     NULL    UPDATE  YES
+'root'@'<SERVER_NAME>' NULL    ALTER   YES
+'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
+... (21 lines deleted)
+'root'@'<SERVER_NAME>' NULL    SUPER   YES
+'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'u_6_401015'@'localhost'       NULL    USAGE   NO
 select *
 from information_schema.column_privileges
@@ -7033,31 +7033,6 @@
 'root'@'127.0.0.1'     NULL    SHUTDOWN        YES
 'root'@'127.0.0.1'     NULL    SUPER   YES
 'root'@'127.0.0.1'     NULL    UPDATE  YES
-'root'@'<SERVER_NAME>' NULL    ALTER   YES
-'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
-... (21 lines deleted)
-'root'@'<SERVER_NAME>' NULL    SUPER   YES
-'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 'root'@'localhost'     NULL    ALTER   YES
 'root'@'localhost'     NULL    ALTER ROUTINE   YES
 'root'@'localhost'     NULL    CREATE  YES
@@ -7083,6 +7058,31 @@
 'root'@'localhost'     NULL    SHUTDOWN        YES
 'root'@'localhost'     NULL    SUPER   YES
 'root'@'localhost'     NULL    UPDATE  YES
+'root'@'<SERVER_NAME>' NULL    ALTER   YES
+'root'@'<SERVER_NAME>' NULL    ALTER ROUTINE   YES
+... (21 lines deleted)
+'root'@'<SERVER_NAME>' NULL    SUPER   YES
+'root'@'<SERVER_NAME>' NULL    UPDATE  YES
 select *
 from information_schema.column_privileges
 where table_schema like 'db_datadict%';
[16 Oct 2007 15:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35669

ChangeSet@1.2538, 2007-10-16 17:27:35+02:00, mleich@mmm.local.lan +4 -0
  Fix for
    Bug#30418 "datadict" tests (all engines) fail: Dependency on the host name for ordering
  Some notes:
  1. A hostname like "mmm" helps to reproduce the problem.
  2. Even after this bug fix the <engine>__datadict testcases will not pass
     because of
     Bug 31568 Some "information_schema" entries suddenly report a NULL default
[21 Nov 2007 12:58] Matthias Leich
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/38206

ChangeSet@1.2583, 2007-11-21 13:50:17+01:00, mleich@five.local.lan +6 -0
  This changeset fixes
     Bug#31567 "datadict" tests (all engines) fail:
               Reference protocol is non-standard build
     Bug#30418 "datadict" tests (all engines) fail:
               Dependency on the host name for ordering   
  Modifications:
     1. The standard builds (build team) do not contain
        the collation 'utf8_general_cs'.
        The common developer builds (compuile-....-max)
        contain this collation.
        Solution fitting to both build variants:
           Exclude the collation 'utf8_general_cs' from
           result sets.
     2. Use mysqltest builtin sorting of result set for
        the statement where the hostname affects the
        row order.
[21 Nov 2007 18:13] Matthias Leich
Pushed to
mysql-5.0-build
mysql-5.1-build
mysql-6.0-build.
Weakness within tests, no documentation needed.
[21 Nov 2007 18:53] Bugs System
Pushed into 5.0.54
[21 Nov 2007 18:54] Bugs System
Pushed into 5.1.23-rc
[21 Nov 2007 20:22] Paul DuBois
Test case change. No changelog entry needed.
[22 Nov 2007 17:19] Bugs System
Pushed into 6.0.4-alpha