Bug #19829 make test Failed in mysql_client_test *with --with-charset=utf8*
Submitted: 15 May 2006 19:31 Modified: 12 May 2009 0:35
Reporter: imacat . (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Charsets Severity:S2 (Serious)
Version:5.0.27,5.0.32.5.0.41 OS:Linux (Linux x86_64, ia64)
Assigned to: Ramil Kalimullin CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[15 May 2006 19:31] imacat .
Description:
     I was trying to compile mysql 5.0.21 on my Debian 3.1r2 x86_64, kernel 2.6.16.14, gcc 3.4.4, glibc 2.3.2.  I compiled with the following arguments:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mysql --infodir=/usr/share/info --mandir=/usr/share/man --enable-thread-safe-client --enable-assembler --with-charset=utf8 --with-extra-charsets=all --with-unix-socket-path=/var/run/mysql/mysql.sock --with-mysqld-user=mysql --without-bench --without-readline --with-csv-storage-engine

    The following is the test result.  I removed all others but mysql_client_test to make the result shorter.  I have searched and found bug#19603 seems to be similar.  But since bug#19603 lacks the symptom description, I'm not sure if they are the same thing.

    Please tell me if you need more information.  Thank you.

imacat@rinse src/mysql-5.0.21 % make test
Logging: ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/master-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Installing Slave Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/slave-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

TEST                            RESULT
-------------------------------------------------------
mysql_client_test              [ fail ]

Errors are (from /usr/local/src/mysql-5.0.21/mysql-test/var/log/mysqltest-time) :
Expected field length: -3,  got length: -3
mysql_client_test.c:775: check failed: 'field->length == length * cs->mbmaxlen'
mysqltest: At line 12: command "$MYSQL_CLIENT_TEST --getopt-ll-test=25600M" failed
(the last lines may be the most important ones)

Aborting: mysql_client_test failed in default mode. To continue, re-run with '--force'.

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
make: *** [test] Error 1
imacat@rinse src/mysql-5.0.21 %

How to repeat:
Always.
[15 May 2006 20:38] Valeriy Kravchuk
Thank you for a problem report. That test passed successfully for me on 5.0.22-BK build:

openxs@suse:~/dbs/5.0/mysql-test> ./mysql-test-run mysql_client_test
Logging: ./mysql-test-run mysql_client_test
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../libexec/mysqld --no-defaults --bootstrap --skip-grant-tables     --b
asedir=.. --datadir=mysql-test/var/master-data --skip-innodb --skip-ndbcluster --skip-bdb
Installing Slave Databases
running  ../libexec/mysqld --no-defaults --bootstrap --skip-grant-tables     --b
asedir=.. --datadir=mysql-test/var/slave-data --skip-innodb --skip-ndbcluster --skip-bdb
Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

TEST                            RESULT
-------------------------------------------------------
mysql_client_test              [ pass ]
-------------------------------------------------------

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
All 1 tests were successful.

I used the following configure options:

./configure --prefix=/home/openxs/dbs/5.0 --with-extra-charsets=all \
--with-readline --with-federated-storage-engine \
--with-archive-storage-engine --with-blackhole-storage-engine

So, please, try to build with --prefix= and --with-readline options only, run that test and inform about the results.
[15 May 2006 20:40] Valeriy Kravchuk
Oh, and as it is Debian in your case, upgrade glibc to 2.3.5 at least. It will be useful anyway (see bug #8555 e.g.).
[16 May 2006 4:58] imacat .
I have read bug#8555.  My symptom does look like that one.  In fact, the more serious issue is the lock-up on "make test".  I isolated each test, reported the clearest problem first, and was planning to report the lock-up problem later on.

If that is a GLIBC 2.3.2 + x86_64 problem, I'll just let it be.  I'm not so brave to upgrade the GLIBC as before.  Besides, I'm not running MySQL as production on this host anyway.

Thank you for your help and information.  I'll see what I can do when Debian sid come to release.
[16 May 2006 5:25] Valeriy Kravchuk
So, what about trying to build with --prefix= and --with-readline options only and running this test again? Will it make any difference for you?
[16 May 2006 13:32] imacat .
If I build with:

./configure --prefix=/usr --with-readline

Then "make test" locks-up on mysql_client_test.

imacat@rinse /tmp/mysql-5.0.21 % make test
Logging: ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/master-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Installing Slave Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/slave-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

TEST                            RESULT
-------------------------------------------------------
make: *** [test] Interrupt

imacat@rinse /tmp/mysql-5.0.21 %

Does this help?  Could you please tell me why you ask this?
[21 May 2006 12:59] Valeriy Kravchuk
I was not able to repeat with 5.0.22-BK (+ ChangeSet@1.2133, 2006-05-21 00:47:08+02:00), when configure with --prefix and --with-readline options was used:

...
lowercase_table_grant          [ pass ]
lowercase_table_qcache         [ pass ]
lowercase_view                 [ pass ]
merge                          [ pass ]
metadata                       [ pass ]
mix_innodb_myisam_binlog       [ pass ]
multi_statement                [ pass ]
multi_update                   [ pass ]
myisam-blob                    [ pass ]
myisam                         [ pass ]
mysql                          [ pass ]
mysql_client_test              [ pass ]
mysql_protocols                [ pass ]
mysqlbinlog                    [ pass ]
mysqlbinlog2                   [ pass ]
...
openxs@suse:~/work/mysql-5.0> uname -a
Linux suse 2.6.11.4-20a-default #1 Wed Mar 23 21:52:37 UTC 2005 i686 i686 i386 GNU/Linux
openxs@suse:~/work/mysql-5.0> gcc -v
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.5/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-
prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib --enable-libgcj --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit
 i586-suse-linux
Thread model: posix
gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)

So, problem can be related to gcc version, x86_64 vs i686 (but no other similar reports on your platfrom!), kenrnel version, glibc version, or just a bug that is already fixed in current sources. Please, try current sources snaphot or just wait for 5.0.22 to be officially released.
[1 Dec 2006 8:12] imacat .
Hi.  This is imacat again.  I guess I have figured out the problem here.  It seems --with-charset=utf8 is causing the problem.

    This time I'm running Debian Etch kernel 2.6.17, glibc 2.3.6, gcc 4.0.1, and another Debian Sarge kernel 2.6.16, glibc 2.3.2, gcc 3.4.3.  Both of them are x86_64.  I got the same problem with glibc 2.3.6.  But I saw the Debian team can compile MySQL 5.0.27 successfully, and when I follow their configuration parameters I succeeded.  So I tried to compare and isolate each configuration parameter.  It seems that --with-charset=utf8 is causing the problem.  I do not know if this issue is x86_64 specific, since I have not compiled MySQL 5.0.27 on i386 successfully yet, for bug ID#21469.

    The log is attached below.  Hope this helps.  Please tell me if you need any more information.

== The bad result:
imacat@atlas src/mysql-5.0.27 % ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mysql --infodir=/usr/share/info --mandir=/usr/share/man --enable-thread-safe-client --enable-assembler --with-charset=utf8 --with-extra-charsets=all --with-unix-socket-path=/var/run/mysql/mysql.sock --with-mysqld-user=mysql --without-bench --without-readline
checking build system type... x86_64-unknown-linux-gnu
...
Thank you for choosing MySQL!

imacat@atlas src/mysql-5.0.27 % make
++ echo strmov.lo strxmov.lo strxnmov.lo strnmov.lo strmake.lo strend.lo strtod.lo strnlen.lo strfill.lo is_prefix.lo int2str.lo str2int.lo strinstr.lo strcont.lo strcend.lo bcmp.lo ctype-latin1.lo bchange.lo bmove.lo bmove_upp.lo longlong2str.lo strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo ctype-big5.lo ctype-czech.lo ctype-cp932.lo ctype-eucjpms.lo ctype-euc_kr.lo ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo
...
g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o mysqlmanager command.o mysqlmanager.o manager.o log.o thread_registry.o listener.o protocol.o mysql_connection.o user_map.o messages.o commands.o instance.o instance_map.o instance_options.o buffer.o parse.o guardian.o parse_output.o  ./.libs/liboptions.a -lpthread -lpthread -lpthread -lpthread libnet.a ../../vio/libvio.a ../../mysys/libmysys.a ../../strings/libmystrings.a ../../dbug/libdbug.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
imacat@atlas src/mysql-5.0.27 % make test
Logging: ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/master-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Installing Slave Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/slave-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

TEST                            RESULT
-------------------------------------------------------
alias                          [ pass ]
...
mysql_client_test              [ fail ]

Errors are (from /usr/local/src/mysql-5.0.27/mysql-test/var/log/mysqltest-time) :
sh: line 1:  1320 Aborted                 /usr/local/src/mysql-5.0.27/tests/mysql_client_test --no-defaults --testcase --user=root --socket=/usr/local/src/mysql-5.0.27/mysql-test/var/tmp/master.sock --port=3306 --silent --getopt-ll-test=25600M >>/usr/local/src/mysql-5.0.27/mysql-test/var/log/mysql_client_test.log 2>&1
mysqltest: At line 12: command "$MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.log 2>&1" failed
(the last lines may be the most important ones)

Aborting: mysql_client_test failed in default mode. To continue, re-run with '--force'.

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
make: *** [test] Error 1
imacat@atlas src/mysql-5.0.27 %

== The good result
imacat@atlas src/mysql-5.0.27 % ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mysql --infodir=/usr/share/info --mandir=/usr/share/man --enable-thread-safe-client --enable-assembler --with-extra-charsets=all --with-unix-socket-path=/var/run/mysql/mysql.sock --with-mysqld-user=mysql --without-bench --without-readline
checking build system type... x86_64-unknown-linux-gnu
...
Thank you for choosing MySQL!

imacat@atlas src/mysql-5.0.27 % make
++ echo strmov.lo strxmov.lo strxnmov.lo strnmov.lo strmake.lo strend.lo strtod.lo strnlen.lo strfill.lo is_prefix.lo int2str.lo str2int.lo strinstr.lo strcont.lo strcend.lo bcmp.lo ctype-latin1.lo bchange.lo bmove.lo bmove_upp.lo longlong2str.lo strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo ctype-big5.lo ctype-czech.lo ctype-cp932.lo ctype-eucjpms.lo ctype-euc_kr.lo ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo
...
g++ -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o mysqlmanager command.o mysqlmanager.o manager.o log.o thread_registry.o listener.o protocol.o mysql_connection.o user_map.o messages.o commands.o instance.o instance_map.o instance_options.o buffer.o parse.o guardian.o parse_output.o  ./.libs/liboptions.a -lpthread -lpthread -lpthread -lpthread libnet.a ../../vio/libvio.a ../../mysys/libmysys.a ../../strings/libmystrings.a ../../dbug/libdbug.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
imacat@atlas src/mysql-5.0.27 % make test
Logging: ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/master-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Installing Slave Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/slave-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

TEST                            RESULT
-------------------------------------------------------
alias                          [ pass ]
...
xa                             [ pass ]
-------------------------------------------------------

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
All 381 tests were successful.

imacat@atlas src/mysql-5.0.27 %
[21 Dec 2006 17:13] Daniel Fischer
Verified as described on ia64 Linux.
[14 Mar 2007 20:43] David Favor
This is still failing in 5.1.17 (latest bkf pull).
[12 May 2007 20:08] imacat .
Hi.  This is imacat again.  I have tried the newly-released MySQL 5.0.41.  It still fails.  Is there any news on this issue?

    My environment now is: Debian Etch 4.0 r0 x86_64, kernel 2.6.18-4-amd64, gcc 4.1.2, glibc 2.3.6.  mysql_client_test succeeds without "--with-charset=utf8", but fails with "--with-charset=utf8".
[13 May 2007 6:47] imacat .
Sorry.  To be noted (you may already know), here is the last lines of the mysql-test/var/log/mysql_client_test.log.  It stops at test#173.

==================
#####################################
173 of (1/1): test_bug9735  
#####################################

 field[0]:
    name     :`a`	(expected: `a`)
    org_name :`a`	(expected: `a`)
    type     :`252`	(expected: `252`)
    table    :`t1`	(expected: `t1`)
    org_table:`t1`	(expected: `t1`)
    database :`client_test_db`	(expected: `client_test_db`)
    length   :`50331645`	(expected: `50331645`)
    maxlength:`0`
    charsetnr:`33`
    default  :`(null)`	(expected: `(null)`)

 field[1]:
    name     :`b`	(expected: `b`)
    org_name :`b`	(expected: `b`)
    type     :`252`	(expected: `252`)
    table    :`t1`	(expected: `t1`)
    org_table:`t1`	(expected: `t1`)
    daExpected field length: -3,  got length: -3
tabase :`client_test_db`	(expected: `client_test_db`)
    length   :`4294967293`	(expected: `12884901885`)
    maxlength:`0`
    charsetnr:`33`
    default  :`(null)`	(expected: `(null)`)
mysql_client_test.c:780: check failed: 'field->length == length * cs->mbmaxlen'
[26 Jun 2008 19:14] Joe Grasse
I seem to have the same issue, except that I am compiling mysql-5.1.25-rc. I am compiling on CentOS 5 x86_64, kernel 2.6.18-53.1.21.el5xen, gcc 4.1.2, glibc 2.5. mysql_client_test succeeds without "--with-charset=utf8", but fails with
"--with-charset=utf8". Also, here are the lines of the mysql_client_test.out.log.

#####################################
173 of (1/1): test_bug9735  
#####################################

 field[0]:
    name     :`a`       (expected: `a`)
    org_name :`a`       (expected: `a`)
    type     :`252`     (expected: `252`)
    table    :`t1`      (expected: `t1`)
    org_table:`t1`      (expected: `t1`)
    database :`client_test_db`  (expected: `client_test_db`)
    length   :`50331645`        (expected: `50331645`)
    maxlength:`0`
    charsetnr:`33`
    default  :`(null)`  (expected: `(null)`)

 field[1]:
    name     :`b`       (expected: `b`)
    org_name :`b`       (expected: `b`)
    type     :`252`     (expected: `252`)
    table    :`t1`      (expected: `t1`)
    org_table:`t1`      (expected: `t1`)
    database :`client_test_db`  (expected: `client_test_db`)
    length   :`4294967293`      (expected: `12884901885`)
    maxlength:`0`
    charsetnr:`33`
    default  :`(null)`  (expected: `(nuExpected field length: -3,  got length: -3
ll)`)
mysql_client_test.c:789: check failed: 'field->length == length * cs->mbmaxlen'
[12 Jan 2009 11:06] 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/62968

2728 Ramil Kalimullin	2009-01-12
      Fix for bug#19829:make test Failed in mysql_client_test
      *with --with-charset=utf8*
      
      Problem: wrong LONG BLOB field length is sent to a client 
      when multibyte server character set used.
      
      Fix: always limit field length sent to a client to 2^32,
      as we store it in 4 byte slot.
      
      Note: mysql_client_test changed accordingly.
[13 Jan 2009 6:18] Alexander Barkov
The patch http://lists.mysql.com/commits/62968 is ok to push.
[26 Feb 2009 8:34] 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/67644

2765 Ramil Kalimullin	2009-02-26
      Fix for bug#19829:make test Failed in mysql_client_test
      *with --with-charset=utf8*
      
      Problem: wrong LONG TEXT field length is sent to a client 
      when multibyte server character set used.
      
      Fix: always limit field length sent to a client to 2^32,
      as we store it in 4 byte slot.
      
      Note: mysql_client_test changed accordingly.
     @ sql/protocol.cc
        Fix for bug#19829:make test Failed in mysql_client_test 
        *with --with-charset=utf8*
          - limit field length sent to client to UINT_MAX32 as 
            it may exceeds 32 bit slot for LONG TEXT fields if
            thd_charset->mbmaxlen > 1.
     @ tests/mysql_client_test.c
        Fix for bug#19829:make test Failed in mysql_client_test
        *with --with-charset=utf8*
          - checking field members have in mind that field length
            is limited to UINT_MAX32.
[6 Mar 2009 8:22] Sveta Smirnova
Bug #43347 was marked as duplicate of this one.

Reporter of bug #43347 applied patch to 5.1.31 source tar.gz package and mysql_client_test test still fails. Same with 5.1.32 tar.gz Please note when merge.
[9 Mar 2009 14:13] Bugs System
Pushed into 5.0.79 (revid:joro@sun.com-20090309135922-a0di9ebkxoj4d4wv) (version source revid:staale.smedseng@sun.com-20090227160758-td4jot2la75f9zy1) (merge vers: 5.0.79) (pib:6)
[13 Mar 2009 19:06] Bugs System
Pushed into 5.1.33 (revid:joro@sun.com-20090313111355-7bsi1hgkvrg8pdds) (version source revid:staale.smedseng@sun.com-20090227160332-3k1kc0rao6y07cbp) (merge vers: 5.1.33) (pib:6)
[18 Mar 2009 13:19] Bugs System
Pushed into 6.0.11-alpha (revid:joro@sun.com-20090318122208-1b5kvg6zeb4hxwp9) (version source revid:ramil@mysql.com-20090226121828-kj7v8jfsbdne9ntv) (merge vers: 6.0.10-alpha) (pib:6)
[9 May 2009 16:44] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508100057-30ote4xggi4nq14v) (merge vers: 5.1.33-ndb-6.2.18) (pib:6)
[9 May 2009 17:41] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090508175813-s6yele2z3oh6o99z) (merge vers: 5.1.33-ndb-6.3.25) (pib:6)
[9 May 2009 18:39] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509073226-09bljakh9eppogec) (merge vers: 5.1.33-ndb-7.0.6) (pib:6)
[12 May 2009 0:35] Paul Dubois
Noted in 5.0.79, 5.1.33, 6.0.11 changelogs.

Incorrect length metadata could be returned for LONG TEXT columns
when a multibyte server character set was used.