diff options
author | unknown <mskold@mysql.com> | 2004-07-19 09:09:40 +0200 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2004-07-19 09:09:40 +0200 |
commit | d590b04708aabaff242aa292ec7a5e6daeefa91a (patch) | |
tree | 7d9d3e0ea159dcabc2536db375506db1144416bc /mysql-test | |
parent | 9e38156bedd2fbcb547b19c90800797c0eb65a9e (diff) | |
parent | be922a58e91ec1df465ec2451787549d6aadbbcf (diff) | |
download | mariadb-git-d590b04708aabaff242aa292ec7a5e6daeefa91a.tar.gz |
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/local/home/marty/MySQL/mysql-4.1-ndb
mysql-test/mysql-test-run.sh:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
Diffstat (limited to 'mysql-test')
42 files changed, 517 insertions, 314 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 8b86f88fda9..2fb168607b6 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -370,7 +370,7 @@ while test $# -gt 0; do $ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://developer.kde.org/~sewardj ." exit 1 fi - VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16" + VALGRIND="$VALGRIND --tool=memcheck --alignment=8 --leak-check=yes --num-callers=16" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb" SLEEP_TIME_AFTER_RESTART=10 diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 1441b3c3600..5d50a3da666 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -123,7 +123,7 @@ grant all on mysqltest.t1 to mysqltest_1@localhost; alter table t1 rename t2; ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2' revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; create table t1 (n1 int not null, n2 int, n3 int, n4 float, unique(n1), diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 6ac32232b2b..10c5d6cc0b8 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -38,7 +38,7 @@ time_zone_transition_type user show tables; Tables_in_test -update mysql.user set password=old_password("gambling2") where user="test"; +update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; set password=old_password('gambling3'); show tables; @@ -60,5 +60,5 @@ time_zone_transition_type user show tables; Tables_in_test -delete from mysql.user where user="test"; +delete from mysql.user where user=_binary"test"; flush privileges; diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result index e2dc8c1be66..0da76c556e2 100644 --- a/mysql-test/r/ctype_create.result +++ b/mysql-test/r/ctype_create.result @@ -1,15 +1,37 @@ SET @@character_set_server=latin5; -CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251; -USE db1; -CREATE DATABASE db2; -SHOW CREATE DATABASE db1; +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251; +USE mysqltest1; +CREATE DATABASE mysqltest2; +SHOW CREATE DATABASE mysqltest1; Database Create Database -db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET cp1251 */ -SHOW CREATE DATABASE db2; +mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp1251 */ +SHOW CREATE DATABASE mysqltest2; Database Create Database -db2 CREATE DATABASE `db2` /*!40100 DEFAULT CHARACTER SET latin5 */ -DROP DATABASE db2; -USE db1; +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin5 */ +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin5 +DROP TABLE mysqltest2.t1; +ALTER DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin7 +DROP DATABASE mysqltest2; +CREATE DATABASE mysqltest2 CHARACTER SET latin2; +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin2 +DROP DATABASE mysqltest2; +USE mysqltest1; CREATE TABLE t1 (a char(10)); SHOW CREATE TABLE t1; Table Create Table @@ -32,4 +54,4 @@ t1 CREATE TABLE `t1` ( `a` char(10) collate latin1_german1_ci default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci DROP TABLE t1; -DROP DATABASE db1; +DROP DATABASE mysqltest1; diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index d40360b9337..805f731f0ec 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -136,3 +136,9 @@ SET character_set_connection=binary; SELECT 'тест' as s; s тест +SET NAMES binary; +CREATE TABLE `good` (a int); +ERROR HY000: Invalid utf8 character string: '' +SET NAMES utf8; +CREATE TABLE `good` (a int); +ERROR HY000: Invalid utf8 character string: '` (a int)' diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index cb6fbecb6e8..2fd654da434 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -1655,3 +1655,110 @@ Z,z,Ź,ź,Ż,ż,Ž,ž ǁ ǂ ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ +AA,Aa,aA,aa +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,J,i,j,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ +IJ,Ij,iJ,ij +IJ,ij +ı +Ɨ +Ɩ +Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj +LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj +NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ +Ɯ +Ʊ +U,V,u,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index f91691853b9..1baf9d8e01c 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -192,9 +192,9 @@ length(quote(concat(char(0),"test"))) select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))) 27E0E3E6E7E8EAEB27 -select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"); -unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") -foobar 1234567890ABCDEF 4Vx +select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL); +unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") unhex(NULL) +foobar 1234567890ABCDEF 4Vx NULL select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456")); hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456")) 01 12 0123 1234 012345 123456 diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 671132428c5..d3db2cc5151 100644 --- a/mysql-test/r/func_system.result +++ b/mysql-test/r/func_system.result @@ -46,7 +46,7 @@ create table t1 (version char(40)) select database(), user(), version() as 'vers show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `database()` char(34) character set utf8 NOT NULL default '', + `database()` char(34) character set utf8 default NULL, `user()` char(77) character set utf8 NOT NULL default '', `version` char(40) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 0ae4ec8dee1..aa6c0c3f505 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1,4 +1,5 @@ drop table if exists t1; +SET NAMES binary; delete from mysql.user where user='mysqltest_1'; delete from mysql.db where user='mysqltest_1'; flush privileges; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index 6f341e12344..31e506d2679 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -1,3 +1,4 @@ +SET NAMES binary; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result index b890f2e454e..892f1d940a6 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -198,6 +198,7 @@ Qcache_hits 8 show status like "Qcache_not_cached"; Variable_name Value Qcache_not_cached 8 +set names binary; delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index b4b78dc4b5b..39ec9ff4eb9 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -447,7 +447,7 @@ update t1, t2 set t1.b=1 where t1.a=t2.a; update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a; revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; create table t1 (a int, primary key (a)); create table t2 (a int, primary key (a)); diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 04c95271aad..d630730d96f 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -389,12 +389,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02; a @arg00 a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second where ? = first.b or first.a = second.a or second.b = ? '; @@ -402,12 +402,12 @@ execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 test_sequence ------ subquery tests ------ diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index dfb147d0795..8cba3501a73 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -548,14 +548,14 @@ def in_s 8 21 1 Y 32768 0 8 def in_row_s 8 21 1 Y 32768 0 8 scalar_s exists_s in_s in_row_s 2.0000 0 1 0 -2.0000 0 1 0 18.0000 1 0 1 +2.0000 0 1 0 18.0000 1 0 1 execute stmt1 ; scalar_s exists_s in_s in_row_s 2.0000 0 1 0 -2.0000 0 1 0 18.0000 1 0 1 +2.0000 0 1 0 18.0000 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; @@ -572,8 +572,8 @@ def ref 253 1024 0 Y 0 31 63 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 63 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -581,8 +581,8 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -617,15 +617,15 @@ def in_s 8 21 1 Y 32768 0 8 def in_row_s 8 21 1 Y 32768 0 8 scalar_s exists_s in_s in_row_s 2 0 1 0 -2 0 1 0 18 1 0 1 +2 0 1 0 18 1 0 1 execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; scalar_s exists_s in_s in_row_s 2 0 1 0 -2 0 1 0 18 1 0 1 +2 0 1 0 18 1 0 1 set @stmt= concat('explain ',@stmt); prepare stmt1 from @stmt ; @@ -643,8 +643,8 @@ def ref 253 1024 0 Y 0 31 63 def rows 8 10 1 N 32801 0 8 def Extra 253 255 44 N 1 31 63 id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where @@ -653,8 +653,8 @@ id select_type table type possible_keys key key_len ref rows Extra execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 -1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 +1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 6 DERIVED t2 ALL NULL NULL NULL NULL 2 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index fab0b552b48..8fc035b0aef 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -432,12 +432,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02; a @arg00 a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second where ? = first.b or first.a = second.a or second.b = ? '; @@ -445,12 +445,12 @@ execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 test_sequence ------ subquery tests ------ @@ -1615,12 +1615,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02; a @arg00 a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second where ? = first.b or first.a = second.a or second.b = ? '; @@ -1628,12 +1628,12 @@ execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 test_sequence ------ subquery tests ------ diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index ac0b38951c0..eeabd114b91 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -389,12 +389,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02; a @arg00 a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second where ? = first.b or first.a = second.a or second.b = ? '; @@ -402,12 +402,12 @@ execute stmt1 using @arg00, @arg01, @arg02; a ? a 1 ABC 1 2 ABC 1 +3 ABC 1 +4 ABC 1 2 ABC 2 2 ABC 3 -2 ABC 4 -3 ABC 1 3 ABC 3 -4 ABC 1 +2 ABC 4 4 ABC 4 test_sequence ------ subquery tests ------ diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index b60cad18c54..eef986d8f8c 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -76,17 +76,17 @@ create table t1 (n int); insert into t1 values(3456); insert into mysql.user (Host, User, Password) VALUES ("10.10.10.%", "blafasel2", password("blafasel2")); -select select_priv,user from mysql.user where user = 'blafasel2'; +select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user N blafasel2 -update mysql.user set Select_priv = "Y" where User="blafasel2"; -select select_priv,user from mysql.user where user = 'blafasel2'; +update mysql.user set Select_priv = "Y" where User= _binary"blafasel2"; +select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user Y blafasel2 select n from t1; n 3456 -select select_priv,user from mysql.user where user = 'blafasel2'; +select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user Y blafasel2 drop table t1; diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/r/rpl_do_grant.result index 983cdf46620..ff3e059503c 100644 --- a/mysql-test/r/rpl_do_grant.result +++ b/mysql-test/r/rpl_do_grant.result @@ -4,11 +4,11 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -delete from mysql.user where user='rpl_do_grant'; -delete from mysql.db where user='rpl_do_grant'; +delete from mysql.user where user=_binary'rpl_do_grant'; +delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; grant select on *.* to rpl_do_grant@localhost; grant drop on test.* to rpl_do_grant@localhost; @@ -17,10 +17,10 @@ Grants for rpl_do_grant@localhost GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost' GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost' set password for rpl_do_grant@localhost=password("does it work?"); -select password<>'' from mysql.user where user='rpl_do_grant'; -password<>'' +select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; +password<>_binary'' 1 -delete from mysql.user where user='rpl_do_grant'; -delete from mysql.db where user='rpl_do_grant'; +delete from mysql.user where user=_binary'rpl_do_grant'; +delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; flush privileges; diff --git a/mysql-test/r/rpl_ignore_grant.result b/mysql-test/r/rpl_ignore_grant.result index 5e970e71d0b..5169cc8e888 100644 --- a/mysql-test/r/rpl_ignore_grant.result +++ b/mysql-test/r/rpl_ignore_grant.result @@ -4,11 +4,11 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; grant select on *.* to rpl_ignore_grant@localhost; grant drop on test.* to rpl_ignore_grant@localhost; @@ -18,20 +18,20 @@ GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost' GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost' show grants for rpl_ignore_grant@localhost; ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost' -select count(*) from mysql.user where user='rpl_ignore_grant'; +select count(*) from mysql.user where user=_binary'rpl_ignore_grant'; count(*) 0 -select count(*) from mysql.db where user='rpl_ignore_grant'; +select count(*) from mysql.db where user=_binary'rpl_ignore_grant'; count(*) 0 grant select on *.* to rpl_ignore_grant@localhost; set password for rpl_ignore_grant@localhost=password("does it work?"); -select password<>'' from mysql.user where user='rpl_ignore_grant'; -password<>'' +select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant'; +password<>_binary'' 0 -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 8aa071b3ca1..3bea4c4509d 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -395,6 +395,7 @@ show create database test_$1; ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1' drop table test_$1.t1; drop database test_$1; +set names binary; delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; delete from mysql.db diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 5ab36dacaaf..77339473142 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1891,3 +1891,11 @@ abc b 3 4 deallocate prepare stmt1; DROP TABLE t1, t2, t3; +CREATE TABLE `t1` ( `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t1 values (1); +CREATE TABLE `t2` ( `b` int(11) default NULL, `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t2 values (1,2); +select t000.a, count(*) `C` FROM t1 t000 GROUP BY t000.a HAVING count(*) > ALL (SELECT count(*) FROM t2 t001 WHERE t001.a=1); +a C +1 1 +drop table t1,t2; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 1f09a20abc5..3fbe842ce49 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -126,3 +126,5 @@ columns_priv CREATE TABLE `columns_priv` ( `Column_priv` set('Select','Insert','Update','References') NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Column privileges' +show tables; +Tables_in_test diff --git a/mysql-test/r/system_mysql_db_refs.result b/mysql-test/r/system_mysql_db_refs.result index e15934b03ac..ac072505bc9 100644 --- a/mysql-test/r/system_mysql_db_refs.result +++ b/mysql-test/r/system_mysql_db_refs.result @@ -18,44 +18,44 @@ create table test_columns_priv select * from mysql.columns_priv; delete from test_columns_priv; insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name); select -if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
-if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
-if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
-if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
-if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
-from test_db
-left join test_host on test_db.Host=test_host.Host
-left join test_user on test_db.Host=test_user.Host
-left join test_tables_priv on test_db.Host=test_tables_priv.Host
+if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host, +if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host, +if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host, +if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host, +if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host +from test_db +left join test_host on test_db.Host=test_host.Host +left join test_user on test_db.Host=test_user.Host +left join test_tables_priv on test_db.Host=test_tables_priv.Host left join test_columns_priv on test_db.Host=test_columns_priv.Host; test_db_Host test_host_Host test_user_Host test_tables_priv_Host test_columns_priv_Host ok ok ok ok ok select -if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
-if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
-if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
-if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
-from test_db
-left join test_host on test_db.Db=test_host.Db
-left join test_tables_priv on test_db.Db=test_tables_priv.Db
+if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db, +if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db, +if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db, +if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db +from test_db +left join test_host on test_db.Db=test_host.Db +left join test_tables_priv on test_db.Db=test_tables_priv.Db left join test_columns_priv on test_db.Db=test_columns_priv.Db; test_db_Db test_host_Db test_tables_priv_Db est_columns_priv_Db ok ok ok ok -select
-if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
-if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
-if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
-if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_db
-left join test_user on test_db.User=test_user.User
-left join test_tables_priv on test_db.User=test_tables_priv.User
+select +if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User, +if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User, +if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, +if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User +from test_db +left join test_user on test_db.User=test_user.User +left join test_tables_priv on test_db.User=test_tables_priv.User left join test_columns_priv on test_db.User=test_columns_priv.User; test_db_User test_user_User test_tables_priv_User test_columns_priv_User ok ok ok ok -select
-if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
-if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_tables_priv
+select +if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, +if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User +from test_tables_priv left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name; test_tables_priv_User test_columns_priv_User ok ok diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 122dcaa6c49..5fed85d7f50 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -123,7 +123,7 @@ connection user1; alter table t1 rename t2; connection root; revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; # diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 7585ff0f608..32c1479ae04 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -42,7 +42,7 @@ show tables; # check if old password version also works -update mysql.user set password=old_password("gambling2") where user="test"; +update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; #connect (con1,localhost,test,gambling2,""); @@ -68,5 +68,5 @@ show tables; # remove user 'test' so that other tests which may use 'test' # do not depend on this test. -delete from mysql.user where user="test"; +delete from mysql.user where user=_binary"test"; flush privileges; diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test index bd8c22bb4f6..6d7ed6fc205 100644 --- a/mysql-test/t/ctype_create.test +++ b/mysql-test/t/ctype_create.test @@ -13,25 +13,48 @@ SET @@character_set_server=latin5; -CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251; -USE db1; -CREATE DATABASE db2; +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251; +USE mysqltest1; +CREATE DATABASE mysqltest2; # # This should be cp1251 # -SHOW CREATE DATABASE db1; +SHOW CREATE DATABASE mysqltest1; # -# This should take the default latin5 value from server level. +# Database "mysqltest2" should take the default latin5 value from +# the server level. +# Afterwards, table "d2.t1" should inherit the default latin5 value from +# the database "mysqltest2", using database option hash. # -SHOW CREATE DATABASE db2; -DROP DATABASE db2; +SHOW CREATE DATABASE mysqltest2; +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +DROP TABLE mysqltest2.t1; + +# +# Now we check if the database charset is updated in +# the database options hash when we ALTER DATABASE. +# +ALTER DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +DROP DATABASE mysqltest2; + +# +# Now we check if the database charset is removed from +# the database option hash when we DROP DATABASE. +# +CREATE DATABASE mysqltest2 CHARACTER SET latin2; +CREATE TABLE mysqltest2.t1 (a char(10)); +SHOW CREATE TABLE mysqltest2.t1; +DROP DATABASE mysqltest2; # # Check that table value uses database level by default # -USE db1; +USE mysqltest1; CREATE TABLE t1 (a char(10)); SHOW CREATE TABLE t1; DROP TABLE t1; @@ -50,4 +73,4 @@ DROP TABLE t1; # # # -DROP DATABASE db1; +DROP DATABASE mysqltest1; diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 45cc0cebfb3..de6332f272c 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -97,3 +97,13 @@ SELECT 'тест' as s; SET NAMES utf8; SET character_set_connection=binary; SELECT 'тест' as s; + +# +# Test that we allow only well-formed UTF8 identitiers +# +SET NAMES binary; +--error 1300 +CREATE TABLE `good` (a int); +SET NAMES utf8; +--error 1300 +CREATE TABLE `good` (a int); diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 6ff1407247f..0ab46a5a637 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -178,4 +178,5 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; --select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index cc8d8a88437..61d0326f7dd 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -78,7 +78,7 @@ select quote(concat('abc\'', '\\cba')); select quote(1/0), quote('\0\Z'); select length(quote(concat(char(0),"test"))); select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); -select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"); +select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL); select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456")); select length(unhex(md5("abrakadabra"))); diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 6bd2fa0c703..c112a0e0c1d 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -5,6 +5,8 @@ drop table if exists t1; --enable_warnings +SET NAMES binary; + # # Test that SSL options works properly # diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index 1fc1ed78385..3a9afa7453b 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -1,3 +1,5 @@ +SET NAMES binary; + # # GRANT tests that require several connections # (usually it's GRANT, reconnect as another user, try something) diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test index 7806253124e..a82cd732802 100644 --- a/mysql-test/t/grant_cache.test +++ b/mysql-test/t/grant_cache.test @@ -126,6 +126,15 @@ show status like "Qcache_not_cached"; # Cleanup connection root; +# +# A temporary 4.1 workaround to make this test pass if +# mysql was compiled with other than latin1 --with-charset=XXX. +# Without "set names binary" the below queries fail with +# "Illegal mix of collations" error. +# In 5.0 we will change grant tables to use NCHAR(N) instead +# of "CHAR(N) BINARY", and use cast-to-nchar: N'mysqltest_1'. +# +set names binary; delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 492856f9280..c2814606aa2 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -405,7 +405,7 @@ update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a; connection root; revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; # diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 5f0ff528b2b..2c86c30f820 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -369,7 +369,6 @@ revoke all privileges on test.t1 from drop_user@localhost ; --error 1295 prepare stmt3 from ' drop user drop_user@localhost '; drop user drop_user@localhost; ---error 1141 #### table related commands ## describe diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 445bd579279..2e0ba2fff25 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -110,14 +110,14 @@ create table t1 (n int); insert into t1 values(3456); insert into mysql.user (Host, User, Password) VALUES ("10.10.10.%", "blafasel2", password("blafasel2")); -select select_priv,user from mysql.user where user = 'blafasel2'; -update mysql.user set Select_priv = "Y" where User="blafasel2"; -select select_priv,user from mysql.user where user = 'blafasel2'; +select select_priv,user from mysql.user where user = _binary'blafasel2'; +update mysql.user set Select_priv = "Y" where User= _binary"blafasel2"; +select select_priv,user from mysql.user where user = _binary'blafasel2'; save_master_pos; connection slave; sync_with_master; select n from t1; -select select_priv,user from mysql.user where user = 'blafasel2'; +select select_priv,user from mysql.user where user = _binary'blafasel2'; connection master1; drop table t1; save_master_pos; diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/t/rpl_do_grant.test index 89ff1afb5c9..27a22874497 100644 --- a/mysql-test/t/rpl_do_grant.test +++ b/mysql-test/t/rpl_do_grant.test @@ -4,16 +4,16 @@ source include/master-slave.inc; # do not be influenced by other tests. connection master; -delete from mysql.user where user='rpl_do_grant'; -delete from mysql.db where user='rpl_do_grant'; +delete from mysql.user where user=_binary'rpl_do_grant'; +delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; save_master_pos; connection slave; sync_with_master; # if these DELETE did nothing on the master, we need to do them manually on the # slave. -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; # test replication of GRANT @@ -31,12 +31,12 @@ set password for rpl_do_grant@localhost=password("does it work?"); save_master_pos; connection slave; sync_with_master; -select password<>'' from mysql.user where user='rpl_do_grant'; +select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; # clear what we have done, to not influence other tests. connection master; -delete from mysql.user where user='rpl_do_grant'; -delete from mysql.db where user='rpl_do_grant'; +delete from mysql.user where user=_binary'rpl_do_grant'; +delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; save_master_pos; connection slave; diff --git a/mysql-test/t/rpl_ignore_grant.test b/mysql-test/t/rpl_ignore_grant.test index 2fd7f186b3e..9b012d08df3 100644 --- a/mysql-test/t/rpl_ignore_grant.test +++ b/mysql-test/t/rpl_ignore_grant.test @@ -6,16 +6,16 @@ source include/master-slave.inc; # do not be influenced by other tests. connection master; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; save_master_pos; connection slave; sync_with_master; # as these DELETE were not replicated, we need to do them manually on the # slave. -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; # test non-replication of GRANT @@ -29,8 +29,8 @@ sync_with_master; --error 1141 #("no such grant for user") show grants for rpl_ignore_grant@localhost; # check it another way -select count(*) from mysql.user where user='rpl_ignore_grant'; -select count(*) from mysql.db where user='rpl_ignore_grant'; +select count(*) from mysql.user where user=_binary'rpl_ignore_grant'; +select count(*) from mysql.db where user=_binary'rpl_ignore_grant'; # test non-replication of SET PASSWORD # first force creation of the user on slave (because as the user does not exist @@ -42,16 +42,16 @@ set password for rpl_ignore_grant@localhost=password("does it work?"); save_master_pos; connection slave; sync_with_master; -select password<>'' from mysql.user where user='rpl_ignore_grant'; +select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant'; # clear what we have done, to not influence other tests. connection master; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; save_master_pos; connection slave; sync_with_master; -delete from mysql.user where user='rpl_ignore_grant'; -delete from mysql.db where user='rpl_ignore_grant'; +delete from mysql.user where user=_binary'rpl_ignore_grant'; +delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 58694356943..ac0c9a43010 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -299,6 +299,7 @@ drop table test_$1.t1; drop database test_$1; connection default; +set names binary; delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; delete from mysql.db diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 0c093c4ae3e..eb4b1f33b14 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1212,3 +1212,13 @@ execute stmt1; select * from t3; deallocate prepare stmt1; DROP TABLE t1, t2, t3; + +# +# Aggregate function comparation with ALL/ANY/SOME subselect +# +CREATE TABLE `t1` ( `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t1 values (1); +CREATE TABLE `t2` ( `b` int(11) default NULL, `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t2 values (1,2); +select t000.a, count(*) `C` FROM t1 t000 GROUP BY t000.a HAVING count(*) > ALL (SELECT count(*) FROM t2 t001 WHERE t001.a=1); +drop table t1,t2; diff --git a/mysql-test/t/system_mysql_db.test b/mysql-test/t/system_mysql_db.test index bd69297b739..a6d683489c3 100644 --- a/mysql-test/t/system_mysql_db.test +++ b/mysql-test/t/system_mysql_db.test @@ -1,8 +1,13 @@ -#
-# This test must examine integrity of system database "mysql"
-#
-
--- disable_query_log
-use mysql;
--- enable_query_log
--- source include/system_db_struct.inc
+# +# This test must examine integrity of system database "mysql" +# + +-- disable_query_log +use mysql; +-- enable_query_log +-- source include/system_db_struct.inc +-- disable_query_log +use test; +-- enable_query_log +# keep results same with system_mysql_db_fix +show tables; diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index a81772c74e4..6c44535e3b7 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -1,83 +1,76 @@ -#
+# # This is the test for mysql_fix_privilege_tables -#
+# --- disable_result_log
--- disable_query_log
-
-use test;
-
-# create system tables as in mysql-3.20
-
-CREATE TABLE db (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(32) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,Db,User),
- KEY User (User)
-)
-type=ISAM;
+-- disable_result_log +-- disable_query_log -INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
-INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
+use test; -CREATE TABLE host (
- Host char(60) binary DEFAULT '' NOT NULL,
- Db char(32) binary DEFAULT '' NOT NULL,
- Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,Db)
-)
-type=ISAM;
+# create system tables as in mysql-3.20 -CREATE TABLE user (
- Host char(60) binary DEFAULT '' NOT NULL,
- User char(16) binary DEFAULT '' NOT NULL,
- Password char(16),
- Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
- PRIMARY KEY Host (Host,User)
-)
-type=ISAM;
+CREATE TABLE db ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(32) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + PRIMARY KEY Host (Host,Db,User), + KEY User (User) +) +type=ISAM; + +INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y'); + +CREATE TABLE host ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(32) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + PRIMARY KEY Host (Host,Db) +) +type=ISAM; + +CREATE TABLE user ( + Host char(60) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Password char(16), + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, + PRIMARY KEY Host (Host,User) +) +type=ISAM; + +INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y'); +INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N'); -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
-INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
-
-- exec $MYSQL_FIX_SYSTEM_TABLES --database=test --- enable_query_log
--- enable_result_log
-
--- source include/system_db_struct.inc
-
--- disable_query_log
-
-DROP TABLE db;
-DROP TABLE host;
-DROP TABLE user;
-DROP TABLE func;
-DROP TABLE tables_priv;
-DROP TABLE columns_priv;
-DROP TABLE help_category; -DROP TABLE help_keyword; -DROP TABLE help_relation; -DROP TABLE help_topic; -
--- enable_query_log
+-- enable_query_log +-- enable_result_log + +-- source include/system_db_struct.inc + +-- disable_query_log + +DROP TABLE db, host, user, func, tables_priv, columns_priv, help_category, help_keyword, help_relation, help_topic, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type; + +-- enable_query_log +# check that we droped all system tables +show tables; diff --git a/mysql-test/t/system_mysql_db_refs.test b/mysql-test/t/system_mysql_db_refs.test index 4c6557ba5c7..9e2c5a20b54 100644 --- a/mysql-test/t/system_mysql_db_refs.test +++ b/mysql-test/t/system_mysql_db_refs.test @@ -1,102 +1,101 @@ -#
-# This test must examine integrity of current system database
-#
-
-set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries";
-
-#
-# If this part is wrong, most likely you've done wrong modification of system database "mysql"
-#
-
-create table test_db select * from mysql.db;
-delete from test_db;
+# +# This test must examine integrity of current system database +# + +set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries"; + +# +# If this part is wrong, most likely you've done wrong modification of system database "mysql" +# + +create table test_db select * from mysql.db; +delete from test_db; --disable_warnings -insert into test_db (Host,Db,User) values (@name,@name,@name);
+insert into test_db (Host,Db,User) values (@name,@name,@name); --enable_warnings -
-create table test_host select * from mysql.host;
-delete from test_host;
+ +create table test_host select * from mysql.host; +delete from test_host; --disable_warnings -insert into test_host (Host,Db) values (@name,@name);
+insert into test_host (Host,Db) values (@name,@name); --enable_warnings -
-create table test_user select * from mysql.user;
-delete from test_user;
+ +create table test_user select * from mysql.user; +delete from test_user; --disable_warnings -insert into test_user (Host,User) values (@name,@name);
+insert into test_user (Host,User) values (@name,@name); --enable_warnings -
-create table test_func select * from mysql.func;
-delete from test_func;
+ +create table test_func select * from mysql.func; +delete from test_func; --disable_warnings -insert into test_func (name) values (@name);
+insert into test_func (name) values (@name); --enable_warnings -
-create table test_tables_priv select * from mysql.tables_priv;
-delete from test_tables_priv;
+ +create table test_tables_priv select * from mysql.tables_priv; +delete from test_tables_priv; --disable_warnings -insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name);
+insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name); --enable_warnings -
-create table test_columns_priv select * from mysql.columns_priv;
-delete from test_columns_priv;
+ +create table test_columns_priv select * from mysql.columns_priv; +delete from test_columns_priv; --disable_warnings -insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
+insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name); --enable_warnings -
-# 'Host' field must be the same for all the tables:
-
+ +# 'Host' field must be the same for all the tables: + select - if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
- if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
- if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
- if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
- if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
- -from test_db
-left join test_host on test_db.Host=test_host.Host
-left join test_user on test_db.Host=test_user.Host
-left join test_tables_priv on test_db.Host=test_tables_priv.Host
-left join test_columns_priv on test_db.Host=test_columns_priv.Host;
-
-# 'Db' field must be the same for all the tables:
-
+ if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host, + if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host, + if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host, + if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host, + if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host + +from test_db +left join test_host on test_db.Host=test_host.Host +left join test_user on test_db.Host=test_user.Host +left join test_tables_priv on test_db.Host=test_tables_priv.Host +left join test_columns_priv on test_db.Host=test_columns_priv.Host; + +# 'Db' field must be the same for all the tables: + +select + if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db, + if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db, + if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db, + if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db + +from test_db +left join test_host on test_db.Db=test_host.Db +left join test_tables_priv on test_db.Db=test_tables_priv.Db +left join test_columns_priv on test_db.Db=test_columns_priv.Db; + +# 'User' field must be the same for all the tables: + +select + if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User, + if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User, + if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, + if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User + +from test_db +left join test_user on test_db.User=test_user.User +left join test_tables_priv on test_db.User=test_tables_priv.User +left join test_columns_priv on test_db.User=test_columns_priv.User; + +# 'Table_name' field must be the same for all the tables: + select - if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
- if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
- if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
- if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
- -from test_db
-left join test_host on test_db.Db=test_host.Db
-left join test_tables_priv on test_db.Db=test_tables_priv.Db
-left join test_columns_priv on test_db.Db=test_columns_priv.Db;
-
-# 'User' field must be the same for all the tables:
-
-select
- if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
- if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
- if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
- if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
- -from test_db
-left join test_user on test_db.User=test_user.User
-left join test_tables_priv on test_db.User=test_tables_priv.User
-left join test_columns_priv on test_db.User=test_columns_priv.User;
-
-# 'Table_name' field must be the same for all the tables:
-
-select
- if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
- if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
-from test_tables_priv
-left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
-
-drop table test_columns_priv;
-drop table test_tables_priv;
-drop table test_func;
-drop table test_host;
-drop table test_user;
-drop table test_db;
+ if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User, + if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User +from test_tables_priv +left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name; +drop table test_columns_priv; +drop table test_tables_priv; +drop table test_func; +drop table test_host; +drop table test_user; +drop table test_db; |