Bug #51907 main.ctype_utf8mb4_ndb fails persistently
Submitted: 10 Mar 2010 12:26 Modified: 6 Apr 2010 12:58
Reporter: Luis Soares Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.5.3 OS:Any
Assigned to: CPU Architecture:Any
Tags: charsets, ndb, utf8mb4
Triage: Triaged: D3 (Medium)

[10 Mar 2010 12:26] Luis Soares
Description:
The test case main.ctype_utf8mb4_ndb fails persistently on
trunk-bugfixing (I guess the same goes for next-mr-bugfixing, 
6.0-codebase-bugfixing) with the following error:

main.ctype_utf8mb4_ndb                   [ fail ]
        Test ended at 2010-03-09 15:17:11

CURRENT_TEST: main.ctype_utf8mb4_ndb
mysqltest: In included file "./include/ctype_utf8mb4.inc": At line 110: query 'create table t1 (s1 char(20) character set koi8r) engine $engine' failed: 1005: Can't create table 'test.t1' (errno: 140)

The result from queries just before the failure was: 
< snip >
char_length(left(@a:='тест',5)) length(@a)      @a   
4       8       тест 
create table t1 ENGINE ndb select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
Table   Create Table
t1      CREATE TABLE `t1` (
  `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
select * from t1;
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
2004-01-19
drop table t1;
set names utf8mb4;
set LC_TIME_NAMES='fr_FR';
create table t1 (s1 char(20) character set latin1) engine ndb; 
insert into t1 values (date_format('2004-02-02','%M'));
select hex(s1) from t1;
hex(s1)
66E97672696572
drop table t1;

More results from queries before failure can be found in /home/lsoares/Workspace/bzr/work/bugfixing/51426/mysql-trunk-bugfixing/mysql-test/var/log/ctype_utf8mb4_ndb.log

Warnings from just before the error:
Warning 1296 Got error 743 'Unsupported character set in table or index' from NDB

NOTES
=====

  N1. PB2 does not notice this. It skips the test case
      with (following output):

main.ctype_utf8mb4_ndb                   [ skipped ]  No ndbcluster tests(--skip-ndbcluster)
main.ctype_utf8mb4_ndb                   [ skipped ]  No ndbcluster support

  N2. Some devs were unable to reproduce this.

  N3. My env:

$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"

$ uname -a
Linux mobilos 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux

How to repeat:
1. bzr clone -r revid:alik@sun.com-20100309095704-k5ytpuy0fygmhvld $BZR_REPO/mysql-trunk-bugfixing 

2. cd mysql-trunk-bugfixing

3. HAVE_CMAKE=no ./BUILD/compile-pentium64-debug-max

4. cd mysql-test

5. perl mysql-test-run.pl main.ctype_utf8mb4_ndb

(...)
main.ctype_utf8mb4_ndb                   [ fail ]
(...)
mysqltest: In included file "./include/ctype_utf8mb4.inc": At line 110: query 'create table t1 (s1 char(20) character set koi8r) engine $engine' failed: 1005: Can't create table 'test.t1' (errno: 140)
(...)
Warnings from just before the error:
Warning 1296 Got error 743 'Unsupported character set in table or index' from NDB
(...)
The servers were restarted 0 times
Spent 0.000 of 23 seconds executing testcases

Completed: Failed 1/1 tests, 0.00% were successful.

Failing test(s): main.ctype_utf8mb4_ndb
(...)

Suggested fix:
n/a
[16 Mar 2010 8:27] Alexander Nozdrin
I can not reproduce it.

Tree: mysql-trunk-bugfixing
Built with:
$ HAVE_CMAKE=no ./BUILD/compile-pentium64-debug-max --with-debug=full
[16 Mar 2010 10:33] Luis Soares
I could still hit it in current revision (trunk-bugfixing):
 - revision-id: mats@sun.com-20100315215022-fvh8muo2ulgypapx

(I have tested on a different machine from the one I used to report the bug,
 but I guess that it would be the same if I tested it in the original one).
[23 Mar 2010 14:36] Jørgen Austvik
source include/have_koi8r.inc?
[6 Apr 2010 10:18] Luis Soares
- Added include/have_koi8r.inc to the test file:

=== modified file 'mysql-test/t/ctype_utf8mb4_ndb.test'
--- mysql-test/t/ctype_utf8mb4_ndb.test 2010-03-04 07:34:44 +0000
+++ mysql-test/t/ctype_utf8mb4_ndb.test 2010-04-06 10:12:56 +0000
@@ -1,5 +1,6 @@
 --source include/have_utf8mb4.inc
 --source include/have_ndb.inc
+--source include/have_koi8r.inc
 
 let $engine= ndb;
 let $is_ndb= 1;

- Executed the test again:

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
main.ctype_utf8mb4_ndb                   [ fail ]
        Test ended at 2010-04-06 12:13:21

CURRENT_TEST: main.ctype_utf8mb4_ndb
mysqltest: In included file "./include/ctype_utf8mb4.inc": At line 110: query 'create table t1 (s1 char(20) character set koi8r) engine $engine' failed: 1005: Can't create table 'test.t1' (errno: 140)

(...)

- Details:

   tree: mysql-trunk-bugfixing
  revid: alik@sun.com-20100324081454-gucgfy0x4x7vgyp1
   host: loki12
  build: HAVE_CMAKE=no ./BUILD/compile-amd64-debug-max
command: perl mysql-test-run.pl main.ctype_utf8mb4_ndb
[6 Apr 2010 16:54] Sveta Smirnova
With HAVE-CMAKE=no test still doesn't fail for me.
[16 Apr 2010 10:17] Luis Soares
Some more details...

I start the servers:

mysql-test: ./mtr --start ctype_utf8mb4_ndb
(...)
worker[1] Port and socket path for server(s):
worker[1] mysqld.1.1  13161  /export/home2/tmp/ls229627/bzr/tests/mysql-trunk-bugfixing/mysql-test/var/tmp/mysqld.1.1.sock
worker[1] mysqld.2.1  13162  /export/home2/tmp/ls229627/bzr/tests/mysql-trunk-bugfixing/mysql-test/var/tmp/mysqld.2.1.sock
worker[1] Waiting for server(s) to exit...

Then I connect to one of them and try to create the database:

[...@loki12].../mysql-trunk-bugfixing/mysql-test: ../client/mysql -u root -S var/tmp/mysqld.1.1.sock 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.4-m3-debug-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use test
Database changed
mysql> create table t1 (s1 char(20) character set koi8r) engine ndbcluster;
ERROR 1005 (HY000): Can't create table 'test.t1' (errno: 140)
mysql> SHOW WARNINGS;
+---------+------+----------------------------------------------------------------------+
| Level   | Code | Message                                                              |
+---------+------+----------------------------------------------------------------------+
| Warning | 1296 | Got error 743 'Unsupported character set in table or index' from NDB |
| Error   | 1005 | Can't create table 'test.t1' (errno: 140)                            |
+---------+------+----------------------------------------------------------------------+
2 rows in set (0.00 sec)

Still get the same error ^.

Some more information:
mysql> SHOW VARIABLES LIKE 'character_set%';
+--------------------------+--------------------------------------------------------------------------------+
| Variable_name            | Value                                                                          |
+--------------------------+--------------------------------------------------------------------------------+
| character_set_client     | utf8                                                                           |
| character_set_connection | utf8                                                                           |
| character_set_database   | latin1                                                                         |
| character_set_filesystem | binary                                                                         |
| character_set_results    | utf8                                                                           |
| character_set_server     | latin1                                                                         |
| character_set_system     | utf8                                                                           |
| character_sets_dir       | /.../bzr/tests/mysql-trunk-bugfixing/sql/share/charsets/                    |
+--------------------------+--------------------------------------------------------------------------------+
8 rows in set (0.00 sec)

mysql> SHOW VARIABLES LIKE 'collation%';
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | utf8_general_ci   |
| collation_database   | latin1_swedish_ci |
| collation_server     | latin1_swedish_ci |
+----------------------+-------------------+
3 rows in set (0.02 sec)
[26 Apr 2010 17:58] Alfranio Correia
I am having the same problem. See below my configuration:

acorreia@acorreia-sun:~/workspace.sun/repository.mysql/bzrwork/bug-50479/mysql-trunk-bugfixing.test/mysql-test$ uname -a
Linux acorreia-sun 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 05:23:09 UTC 2010 i686 GNU/Linux

acorreia@acorreia-sun:~/workspace.sun/repository.mysql/bzrwork/bug-50479/mysql-trunk-bugfixing.test/mysql-test$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu9' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)

I've used mysql-trunk-bugfixing.
[6 Aug 2010 10:23] Konstantin Osipov
See also Bug#55799, disabling the test.