diff options
author | unknown <bell@sanja.is.com.ua> | 2005-10-28 10:12:36 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-10-28 10:12:36 +0300 |
commit | ab2389ef5a55a7c4bd02870f809477803e7ff8e1 (patch) | |
tree | c0a710cd157405baf40b3e18db1740f006bc16e8 /mysql-test | |
parent | c1852b1202af4ebbde04d5f774458991e024a82a (diff) | |
parent | a397d1f7149dcdeac86e9e4870780dcd8e99a908 (diff) | |
download | mariadb-git-ab2389ef5a55a7c4bd02870f809477803e7ff8e1.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-owner7-5.0
sql/item.cc:
Auto merged
sql/sql_update.cc:
Auto merged
Diffstat (limited to 'mysql-test')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 31 | ||||
-rw-r--r-- | mysql-test/r/ctype_cp1250_ch.result | 23 | ||||
-rw-r--r-- | mysql-test/r/date_formats.result | 8 | ||||
-rw-r--r-- | mysql-test/r/insert_select.result | 18 | ||||
-rw-r--r-- | mysql-test/r/myisam.result | 32 | ||||
-rw-r--r-- | mysql-test/r/select.result | 8 | ||||
-rw-r--r-- | mysql-test/r/update.result | 31 | ||||
-rw-r--r-- | mysql-test/t/ctype_cp1250_ch.test | 21 | ||||
-rw-r--r-- | mysql-test/t/date_formats.test | 8 | ||||
-rw-r--r-- | mysql-test/t/insert_select.test | 22 | ||||
-rw-r--r-- | mysql-test/t/myisam.test | 19 | ||||
-rw-r--r-- | mysql-test/t/mysql_client_test.test | 4 | ||||
-rw-r--r-- | mysql-test/t/select.test | 9 | ||||
-rw-r--r-- | mysql-test/t/update.test | 13 |
14 files changed, 230 insertions, 17 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 6ed068c02d3..02e97a59cce 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -473,6 +473,13 @@ sub command_line_setup () { my $im_mysqld1_port= 9312; my $im_mysqld2_port= 9314; + if ( $ENV{'MTR_BUILD_THREAD'} ) + { + $opt_master_myport= $ENV{'MTR_BUILD_THREAD'} * 40 + 8120; + $opt_slave_myport= $opt_master_myport + 16; + $opt_ndbcluster_port= $opt_master_myport + 24; + } + # Read the command line # Note: Keep list, and the order, in sync with usage at end of this file @@ -882,7 +889,9 @@ sub executable_setup () { { $path_client_bindir= mtr_path_exists("$glob_basedir/client_release", "$glob_basedir/bin"); - $exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt"); + $exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt", + "$path_client_bindir/mysqld", + "$path_client_bindir/mysqld-debug",); $path_language= mtr_path_exists("$glob_basedir/share/english/"); $path_charsetsdir= mtr_path_exists("$glob_basedir/share/charsets"); } @@ -944,9 +953,18 @@ sub executable_setup () { "$glob_basedir/share/english/"); $path_charsetsdir= mtr_path_exists("$glob_basedir/share/mysql/charsets", "$glob_basedir/share/charsets"); - $exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld", - "$glob_basedir/bin/mysqld"); + if ( $glob_win32 ) + { + $exe_mysqld= mtr_exe_exists ("$glob_basedir/bin/mysqld-nt", + "$glob_basedir/bin/mysqld", + "$glob_basedir/bin/mysqld-debug",); + } + else + { + $exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld", + "$glob_basedir/bin/mysqld"); + } $exe_im= mtr_exe_exists("$glob_basedir/libexec/mysqlmanager", "$glob_basedir/bin/mysqlmanager"); if ( $glob_use_embedded_server ) @@ -1040,6 +1058,13 @@ sub environment_setup () { chomp($ENV{$key}); } } + + # We are nice and report a bit about our settings + print "Using MTR_BUILD_THREAD = ",$ENV{MTR_BUILD_THREAD} || 0,"\n"; + print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n"; + print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n"; + print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n"; + print "Using NDBCLUSTER_PORT = $opt_ndbcluster_port\n"; } diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 7b2ca7d7e0e..533bfb8cb53 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -19,3 +19,26 @@ SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; popisek 2005-01-1 drop table t1; +set names cp1250; +CREATE TABLE t1 +( +id INT AUTO_INCREMENT PRIMARY KEY, +str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '', +UNIQUE KEY (str) +); +INSERT INTO t1 VALUES (NULL, 'a'); +INSERT INTO t1 VALUES (NULL, 'aa'); +INSERT INTO t1 VALUES (NULL, 'aaa'); +INSERT INTO t1 VALUES (NULL, 'aaaa'); +INSERT INTO t1 VALUES (NULL, 'aaaaa'); +INSERT INTO t1 VALUES (NULL, 'aaaaaa'); +INSERT INTO t1 VALUES (NULL, 'aaaaaaa'); +select * from t1 where str like 'aa%'; +id str +2 aa +3 aaa +4 aaaa +5 aaaaa +6 aaaaaa +7 aaaaaaa +drop table t1; diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 74ab1e35534..f8189266e50 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -495,3 +495,11 @@ f1 f2 Warnings: Warning 1292 Truncated incorrect date value: '2003-04-05 g' Warning 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567' +create table t1 (f1 datetime); +insert into t1 (f1) values ("2005-01-01"); +insert into t1 (f1) values ("2005-02-01"); +select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M"); +d1 d2 +02 February +01 January +drop table t1; diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index 17f65d96abc..434dddb3049 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -668,3 +668,21 @@ ERROR 42S22: Unknown column 't2.a' in 'field list' insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b; ERROR 42S22: Unknown column 't2.b' in 'field list' drop table t1,t2,t3; +create table t1(f1 varchar(5) key); +insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1; +insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1; +insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1; +select * from t1; +f1 +2000 +2001 +2002 +drop table t1; +create table t1(x int, y int); +create table t2(x int, z int); +insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x); +insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z); +ERROR 42S22: Unknown column 'z' in 'field list' +insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x); +ERROR 42S22: Unknown column 't2.x' in 'field list' +drop table t1,t2; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index f484a937b27..b4265a99604 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -669,6 +669,38 @@ show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 a 1 a A 10 NULL NULL YES BTREE drop table t1; +set myisam_stats_method=nulls_ignored; +show variables like 'myisam_stats_method'; +Variable_name Value +myisam_stats_method nulls_ignored +create table t1 ( +a char(3), b char(4), c char(5), d char(6), +key(a,b,c,d) +); +insert into t1 values ('bcd','def1', NULL, 'zz'); +insert into t1 values ('bcd','def2', NULL, 'zz'); +insert into t1 values ('bce','def1', 'yuu', NULL); +insert into t1 values ('bce','def2', NULL, 'quux'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 2 NULL NULL YES BTREE +t1 1 a 2 b A 4 NULL NULL YES BTREE +t1 1 a 3 c A 4 NULL NULL YES BTREE +t1 1 a 4 d A 4 NULL NULL YES BTREE +delete from t1; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a A 0 NULL NULL YES BTREE +t1 1 a 2 b A 0 NULL NULL YES BTREE +t1 1 a 3 c A 0 NULL NULL YES BTREE +t1 1 a 4 d A 0 NULL NULL YES BTREE +set myisam_stats_method=DEFAULT; set storage_engine=MyISAM; drop table if exists t1,t2,t3; --- Testing varchar --- diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index cd7c70b603c..76a8b5a11e7 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2700,6 +2700,14 @@ a b c d 1 2 2 1 1 2 3 1 DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); INSERT INTO t1 VALUES ('Paris'); diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index d2aa051c299..71de6830963 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -263,8 +263,8 @@ test delete from t1 where count(*)=1; ERROR HY000: Invalid use of group function drop table t1; -create table t1 ( a int, index (a) ); -insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); +create table t1 ( a int, b int default 0, index (a) ); +insert into t1 (a) values (0),(0),(0),(0),(0),(0),(0),(0); flush status; select a from t1 order by a limit 1; a @@ -278,15 +278,16 @@ Handler_read_prev 0 Handler_read_rnd 0 Handler_read_rnd_next 0 flush status; -update t1 set a=unix_timestamp() order by a limit 1; +update t1 set a=9999 order by a limit 1; +update t1 set b=9999 order by a limit 1; show status like 'handler_read%'; Variable_name Value Handler_read_first 1 Handler_read_key 0 Handler_read_next 0 Handler_read_prev 0 -Handler_read_rnd 1 -Handler_read_rnd_next 0 +Handler_read_rnd 2 +Handler_read_rnd_next 9 flush status; delete from t1 order by a limit 1; show status like 'handler_read%'; @@ -318,7 +319,21 @@ Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 1 Handler_read_rnd_next 9 -select count(*) from t1; -count(*) -5 +select * from t1; +a b +0 0 +0 0 +0 0 +0 0 +0 0 +update t1 set a=a+10,b=1 order by a limit 3; +update t1 set a=a+11,b=2 order by a limit 3; +update t1 set a=a+12,b=3 order by a limit 3; +select * from t1 order by a; +a b +11 2 +21 2 +22 3 +22 3 +23 3 drop table t1; diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test index ea4b35a44a3..2d1e5f0bf9d 100644 --- a/mysql-test/t/ctype_cp1250_ch.test +++ b/mysql-test/t/ctype_cp1250_ch.test @@ -23,4 +23,25 @@ SELECT * FROM t1 WHERE popisek = '2005-01-1'; SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; drop table t1; +# +# Bug#13347: empty result from query with like and cp1250 charset +# +set names cp1250; +CREATE TABLE t1 +( + id INT AUTO_INCREMENT PRIMARY KEY, + str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '', + UNIQUE KEY (str) +); + +INSERT INTO t1 VALUES (NULL, 'a'); +INSERT INTO t1 VALUES (NULL, 'aa'); +INSERT INTO t1 VALUES (NULL, 'aaa'); +INSERT INTO t1 VALUES (NULL, 'aaaa'); +INSERT INTO t1 VALUES (NULL, 'aaaaa'); +INSERT INTO t1 VALUES (NULL, 'aaaaaa'); +INSERT INTO t1 VALUES (NULL, 'aaaaaaa'); +select * from t1 where str like 'aa%'; +drop table t1; + # End of 4.1 tests diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index f76f51fd12d..c007c2f5205 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -261,4 +261,12 @@ select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1, str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2; --enable_ps_protocol +# +# Bug #14016 +# +create table t1 (f1 datetime); +insert into t1 (f1) values ("2005-01-01"); +insert into t1 (f1) values ("2005-02-01"); +select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M"); +drop table t1; # End of 4.1 tests diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 7116a25ff39..5dd6f338865 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -202,4 +202,26 @@ insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b; insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b; drop table t1,t2,t3; +# +# Bug #12695 Item_func_isnull::update_used_tables() did not update +# const_item_cache +create table t1(f1 varchar(5) key); +insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1; +insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1; +insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1; +select * from t1; +drop table t1; + +# +# Bug #13392 values() fails with 'ambiguous' or returns NULL +# with ON DUPLICATE and SELECT +create table t1(x int, y int); +create table t2(x int, z int); +insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x); +--error 1054 +insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z); +--error 1054 +insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x); +drop table t1,t2; + # End of 4.1 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 73afcab5e27..2612917de87 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -629,6 +629,25 @@ show index from t1; drop table t1; +# WL#2609, CSC#XXXX: MyISAM +set myisam_stats_method=nulls_ignored; +show variables like 'myisam_stats_method'; + +create table t1 ( + a char(3), b char(4), c char(5), d char(6), + key(a,b,c,d) +); +insert into t1 values ('bcd','def1', NULL, 'zz'); +insert into t1 values ('bcd','def2', NULL, 'zz'); +insert into t1 values ('bce','def1', 'yuu', NULL); +insert into t1 values ('bce','def2', NULL, 'quux'); +analyze table t1; +show index from t1; +delete from t1; +analyze table t1; +show index from t1; + +set myisam_stats_method=DEFAULT; # End of 4.1 tests # diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index ccf5e0bf66a..66b57dd5fb7 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -6,7 +6,7 @@ # var/log/mysql_client_test.trace --disable_result_log ---exec echo $MYSQL_CLIENT_TEST ---exec $MYSQL_CLIENT_TEST +--exec echo $MYSQL_CLIENT_TEST --getopt-ll-test=25600M +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M # End of 4.1 tests diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index a3d83c531d2..d38371577d9 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2244,6 +2244,15 @@ SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; DROP TABLE IF EXISTS t1, t2; +# +# Bug #13855 select distinct with group by caused server crash +# +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +drop table t1,t2; # End of 4.1 tests # diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 13ced76079f..9235d30c500 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -228,15 +228,16 @@ delete from t1 where count(*)=1; drop table t1; # BUG#12915: Optimize "DELETE|UPDATE ... ORDER BY ... LIMIT n" to use an index -create table t1 ( a int, index (a) ); -insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); +create table t1 ( a int, b int default 0, index (a) ); +insert into t1 (a) values (0),(0),(0),(0),(0),(0),(0),(0); flush status; select a from t1 order by a limit 1; show status like 'handler_read%'; flush status; -update t1 set a=unix_timestamp() order by a limit 1; +update t1 set a=9999 order by a limit 1; +update t1 set b=9999 order by a limit 1; show status like 'handler_read%'; flush status; @@ -253,7 +254,11 @@ flush status; delete from t1 order by a limit 1; show status like 'handler_read%'; -select count(*) from t1; +select * from t1; +update t1 set a=a+10,b=1 order by a limit 3; +update t1 set a=a+11,b=2 order by a limit 3; +update t1 set a=a+12,b=3 order by a limit 3; +select * from t1 order by a; drop table t1; # End of 4.1 tests |