Bug #4338 mysql-test-run fails if compiled with non-latin1 character set
Submitted: 30 Jun 2004 0:13 Modified: 2 Sep 2004 9:38
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.3 OS:Linux (SuSE Linux 9.0)
Assigned to: Alexander Barkov CPU Architecture:Any

[30 Jun 2004 0:13] Shuichi Tamagawa
Description:
After compiling with non-latin1 character set (eg. --with-charset=ujis), mysql-test-run failes because of "llegal mix of collations" in many test cases (eg. 'alias'). It looks like, while --default-character-set is set as latin1 in mysql-test-run script, the character set which was specified as the option of ./configure is set for client character set variable of test suite.

Although users can set ujis for server character set variables by editing mysql-test-run script(line 230), the test result will be different from the existing ***.result file for some test cases which returns character set name as a result.

Yes, users can execute the mysql-test-run with --record option to update the ***.result files, but in this case they have to read all the result file and verify it :(

How to repeat:
After getting a copy of souce tree using BitKeeper...
shell> cd mysql-4.1
shell> bk -r edit
shell> aclocal; autoheader; autoconf; automake
shell> cd innobase; aclocal; autoheader; autoconf; automake
shell> cd bdb/dist; sh s_all
shell> ./configure --with-charset=ujis --with-extra-charsers=all #add your favorit option here
shell> make
shell> cd mysql-test
shell> ./mysql-test-run

Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../libexec/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=.. --datadir=mysql-test/var/master-data --skip-innodb --skip-ndbcluster --skip-bdb
Installing Slave Databases
running  ../libexec/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=.. --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
------------------------------------------
alias                          [ fail ]

Errors are (from /usr/local/mysql/41020/mysql-test/var/log/mysqltest-time) :
/usr/local/mysql/41020/bin/mysqltest: At line 65: query 'SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie' failed: 1271: Illegal mix of collations for operation 'field'
(the last lines may be the most important ones)

Aborting: alias failed. To continue, re-run with '--force'.

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished

# you can also check the character set variables by adding a line - show variables like 'char%'

Suggested fix:
Use latin1 for client character set variables of the test suite by default even though it was compiled with non-latin1 character set option, or document this behavior.
[6 Jul 2004 14:14] Alexander Barkov
We should just set client character set alway to latin1
rather than  rely on the incompiled value.

I will fix this shortly.
[2 Sep 2004 9:38] Alexander Barkov
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