summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-06-07 00:31:53 +0300
committerunknown <monty@mysql.com>2005-06-07 00:31:53 +0300
commitbd47a7df597db377aeaa95b6f47f4c24b26d16f0 (patch)
tree1a560cda860f9d9f422087da93fcdc67cd9f66d0 /mysql-test
parentf21e23646991b04ff88efd669a4531a7989b6aec (diff)
parent936b9319b8219daffab3bc6650a02801bf53c8bd (diff)
downloadmariadb-git-bd47a7df597db377aeaa95b6f47f4c24b26d16f0.tar.gz
Merge with 4.1
BitKeeper/etc/logging_ok: auto-union client/sql_string.cc: Auto merged configure.in: Auto merged include/my_global.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/olap.result: Auto merged mysql-test/r/warnings.result: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/warnings.test: Auto merged mysys/raid.cc: Auto merged scripts/make_binary_distribution.sh: Auto merged sql/field.cc: Auto merged BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e: Auto merged BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_blackhole.cc: Auto merged sql/ha_heap.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_geofunc.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/item_uniq.cc: Auto merged sql/lock.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.h: Auto merged sql/procedure.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol_cursor.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_analyse.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_error.cc: Auto merged sql/sql_handler.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_map.cc: Auto merged sql/sql_olap.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_udf.cc: Auto merged sql/examples/ha_archive.cc: Auto merged sql/examples/ha_example.cc: Auto merged sql/examples/ha_tina.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/tztime.cc: Auto merged strings/ctype-win1250ch.c: Auto merged mysql-test/r/func_gconcat.result: merge & ensure that 4.1 and 5.0 source have tests in same order mysql-test/r/innodb.result: merge & ensure that 4.1 and 5.0 source have tests in same order mysql-test/t/func_gconcat.test: merge & ensure that 4.1 and 5.0 source have tests in same order mysql-test/t/innodb.test: merge & ensure that 4.1 and 5.0 source have tests in same order sql/item_func.cc: merge sql/mysqld.cc: merge sql/opt_range.cc: merge sql/sql_parse.cc: merge Give better name to goto labels sql/sql_select.cc: merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/mtr_misc.pl2
-rw-r--r--mysql-test/lib/mtr_process.pl14
-rw-r--r--mysql-test/lib/mtr_report.pl3
-rwxr-xr-xmysql-test/mysql-test-run.pl14
-rw-r--r--mysql-test/r/create.result7
-rw-r--r--mysql-test/r/ctype_cp1250_ch.result12
-rw-r--r--mysql-test/r/func_gconcat.result62
-rw-r--r--mysql-test/r/innodb.result69
-rw-r--r--mysql-test/r/olap.result2
-rw-r--r--mysql-test/r/warnings.result53
-rw-r--r--mysql-test/t/create.test12
-rw-r--r--mysql-test/t/ctype_cp1250_ch.test12
-rw-r--r--mysql-test/t/func_gconcat.test46
-rw-r--r--mysql-test/t/innodb.test102
-rw-r--r--mysql-test/t/warnings.test22
15 files changed, 298 insertions, 134 deletions
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index 5f80864d1f7..efa1b3bec21 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -25,7 +25,7 @@ sub mtr_full_hostname () {
if ( $hostname !~ /\./ )
{
my $address= gethostbyname($hostname)
- or die "Couldn't resolve $hostname : $!";
+ or mtr_error("Couldn't resolve $hostname : $!");
my $fullname= gethostbyaddr($address, AF_INET);
$hostname= $fullname if $fullname;
}
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 78758e54aa4..7bca422773c 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -17,6 +17,7 @@ sub mtr_spawn ($$$$$$);
sub mtr_stop_mysqld_servers ($);
sub mtr_kill_leftovers ();
sub mtr_record_dead_children ();
+sub mtr_exit ($);
sub sleep_until_file_created ($$$);
# static in C
@@ -784,4 +785,17 @@ sub sleep_until_file_created ($$$) {
}
+##############################################################################
+#
+# When we exit, we kill off all children
+#
+##############################################################################
+
+sub mtr_exit ($) {
+ my $code= shift;
+ local $SIG{HUP} = 'IGNORE';
+ kill('HUP', -$$);
+ exit($code);
+}
+
1;
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index cb41549422f..a258d139bb1 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -268,7 +268,8 @@ sub mtr_warning (@) {
}
sub mtr_error (@) {
- die "mysql-test-run: *** ERROR: ",join(" ", @_),"\n";
+ print STDERR "mysql-test-run: *** ERROR: ",join(" ", @_),"\n";
+ mtr_exit(1);
}
sub mtr_debug (@) {
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 52ffff088b5..7b57108466d 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -398,7 +398,7 @@ sub main () {
}
}
- exit(0);
+ mtr_exit(0);
}
##############################################################################
@@ -568,7 +568,9 @@ sub command_line_setup () {
$opt_vardir= "$glob_mysql_test_dir/var";
}
- if ( $opt_vardir !~ m,^/, )
+ # We make the path absolute, as the server will do a chdir() before usage
+ unless ( $opt_vardir =~ m,^/, or
+ ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) )
{
# Make absolute path, relative test dir
$opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
@@ -1292,9 +1294,9 @@ sub install_db ($$) {
mtr_report("Installing \u$type Databases");
open(IN, $init_db_sql)
- or error("Can't open $init_db_sql: $!");
+ or mtr_error("Can't open $init_db_sql: $!");
open(OUT, ">", $init_db_sql_tmp)
- or error("Can't write to $init_db_sql_tmp: $!");
+ or mtr_error("Can't write to $init_db_sql_tmp: $!");
while (<IN>)
{
chomp;
@@ -1568,7 +1570,7 @@ sub report_failure_and_restart ($) {
{
stop_masters_slaves();
}
- exit(1);
+ mtr_exit(1);
}
# FIXME always terminate on failure?!
@@ -2267,5 +2269,5 @@ Options not yet described, or that I want to look into more
with-openssl
HERE
- exit(1);
+ mtr_exit(1);
}
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index ae09b8d730c..be527630078 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -513,9 +513,9 @@ drop database mysqltest;
select database();
database()
NULL
-select database();
-database()
-NULL
+select database(), user();
+database() user()
+NULL mysqltest_1@localhost
use test;
create table t1 (a int, index `primary` (a));
ERROR 42000: Incorrect index name 'primary'
@@ -579,7 +579,6 @@ select * from t2;
b
1
drop table t1,t2;
-use test;
create table t1 (a int);
create table t1 select * from t1;
ERROR HY000: You can't specify target table 't1' for update in FROM clause
diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result
index 62936b84caf..7b2ca7d7e0e 100644
--- a/mysql-test/r/ctype_cp1250_ch.result
+++ b/mysql-test/r/ctype_cp1250_ch.result
@@ -7,3 +7,15 @@ SELECT a, length(a), a='', a=' ', a=' ' FROM t1;
a length(a) a='' a=' ' a=' '
0 1 1 1
DROP TABLE t1;
+CREATE TABLE t1 (
+popisek varchar(30) collate cp1250_general_ci NOT NULL default '',
+PRIMARY KEY (`popisek`)
+);
+INSERT INTO t1 VALUES ('2005-01-1');
+SELECT * FROM t1 WHERE popisek = '2005-01-1';
+popisek
+2005-01-1
+SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
+popisek
+2005-01-1
+drop table t1;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 09ff3fc5a6e..10afb61ba1d 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -343,18 +343,6 @@ GROUP_CONCAT(b ORDER BY b)
First Row
Second Row
DROP TABLE t1;
-CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
-CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
-SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
-a_id b_list
-1 1,2,3
-2 4,5
-3 NULL
-DROP TABLE t2;
-DROP TABLE t1;
CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));
INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');
CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));
@@ -462,6 +450,49 @@ SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
gc
NULL
DROP TABLE t1;
+create table t2 (a int, b int);
+insert into t2 values (1,1), (2,2);
+select b x, (select group_concat(x) from t2) from t2;
+x (select group_concat(x) from t2)
+1 1,1
+2 2,2
+drop table t2;
+create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int);
+insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
+select d,a,b from t1 order by a;
+d a b
+1 1 3
+2 1 4
+3 1 2
+5 1 1
+6 1 2
+4 2 7
+7 2 3
+8 2 3
+explain select a, group_concat(b) from t1 group by a with rollup;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort
+select a, group_concat(b) from t1 group by a with rollup;
+a group_concat(b)
+1 3,4,2,1,2
+2 7,3,3
+NULL 3,4,2,1,2,7,3,3
+select a, group_concat(distinct b) from t1 group by a with rollup;
+a group_concat(distinct b)
+1 3,4,2,1
+2 7,3
+NULL 3,4,2,1,7
+select a, group_concat(b order by b) from t1 group by a with rollup;
+a group_concat(b order by b)
+1 1,2,2,3,4
+2 3,3,7
+NULL 1,2,2,3,3,3,4,7
+select a, group_concat(distinct b order by b) from t1 group by a with rollup;
+a group_concat(distinct b order by b)
+1 1,2,3,4
+2 3,7
+NULL 1,2,3,4,7
+drop table t1;
create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select group_concat(a) from t1 group by b;
@@ -469,10 +500,3 @@ group_concat(a)
ABW
ABW
drop table t1;
-create table r2 (a int, b int);
-insert into r2 values (1,1), (2,2);
-select b x, (select group_concat(x) from r2) from r2;
-x (select group_concat(x) from r2)
-1 1,1
-2 2,2
-drop table r2;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 53dbf2a39e1..1f26aa7d7f7 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -931,7 +931,6 @@ a
1
2
truncate table t1;
-truncate table t1;
insert into t1 values(1),(2);
delete from t1;
select * from t1;
@@ -1654,6 +1653,46 @@ show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
drop table t1;
+create table t1 (c char(10), index (c,c)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c'
+create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10)) engine=innodb;
+alter table t1 add key (c1,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c2,c1,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c1,c2,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c1,c1,c2);
+ERROR 42S21: Duplicate column name 'c1'
+drop table t1;
+create table t1(a int(1) , b int(1)) engine=innodb;
+insert into t1 values ('1111', '3333');
+select distinct concat(a, b) from t1;
+concat(a, b)
+11113333
+drop table t1;
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+ERROR HY000: The used table type doesn't support FULLTEXT indexes
+DROP TABLE t1;
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
+CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+a_id b_list
+1 1,2,3
+2 4,5
+3 NULL
+DROP TABLE t2;
+DROP TABLE t1;
create table t1 (x bigint unsigned not null primary key) engine=innodb;
insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
select * from t1;
@@ -1688,24 +1727,6 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
1
drop table t1;
-create table t1 (c char(10), index (c,c)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c'
-create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
-ERROR 42S21: Duplicate column name 'c1'
-create table t1 (c1 char(10), c2 char(10)) engine=innodb;
-alter table t1 add key (c1,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c2,c1,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c1,c2,c1);
-ERROR 42S21: Duplicate column name 'c1'
-alter table t1 add key (c1,c1,c2);
-ERROR 42S21: Duplicate column name 'c1'
-drop table t1;
show status like "Innodb_buffer_pool_pages_total";
Variable_name Value
Innodb_buffer_pool_pages_total 512
@@ -2391,16 +2412,6 @@ drop table t1;
set storage_engine=MyISAM;
create table t1 (v varchar(16384)) engine=innodb;
drop table t1;
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-concat(a, b)
-11113333
-drop table t1;
-CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
-SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
-ERROR HY000: The used table type doesn't support FULLTEXT indexes
-DROP TABLE t1;
create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
insert into t1 values ('8', '6'), ('4', '7');
select min(a) from t1;
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 5ba2bc80484..c37a42d3fa7 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -88,7 +88,7 @@ TV NULL NULL 600
NULL NULL NULL 7785
explain extended select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using temporary; Using filesort
+1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort
Warnings:
Note 1003 select `test`.`t1`.`product` AS `product`,`test`.`t1`.`country_id` AS `country_id`,`test`.`t1`.`year` AS `year`,sum(`test`.`t1`.`profit`) AS `sum(profit)` from `test`.`t1` group by `test`.`t1`.`product`,`test`.`t1`.`country_id`,`test`.`t1`.`year` with rollup
select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup;
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 442d0784953..6803c3a40ef 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -181,3 +181,56 @@ drop table t1;
set table_type=MYISAM;
Warnings:
Warning 1287 'table_type' is deprecated; use 'storage_engine' instead
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+update t1 set a='abc';
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'a' at row 3
+Warning 1265 Data truncated for column 'a' at row 4
+Warning 1265 Data truncated for column 'a' at row 5
+Warning 1265 Data truncated for column 'a' at row 6
+Warning 1265 Data truncated for column 'a' at row 7
+Warning 1265 Data truncated for column 'a' at row 8
+Warning 1265 Data truncated for column 'a' at row 9
+Warning 1265 Data truncated for column 'a' at row 10
+show warnings limit 2, 1;
+Level Code Message
+Warning 1265 Data truncated for column 'a' at row 3
+show warnings limit 0, 10;
+Level Code Message
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'a' at row 3
+Warning 1265 Data truncated for column 'a' at row 4
+Warning 1265 Data truncated for column 'a' at row 5
+Warning 1265 Data truncated for column 'a' at row 6
+Warning 1265 Data truncated for column 'a' at row 7
+Warning 1265 Data truncated for column 'a' at row 8
+Warning 1265 Data truncated for column 'a' at row 9
+Warning 1265 Data truncated for column 'a' at row 10
+show warnings limit 9, 1;
+Level Code Message
+Warning 1265 Data truncated for column 'a' at row 10
+show warnings limit 10, 1;
+Level Code Message
+show warnings limit 9, 2;
+Level Code Message
+Warning 1265 Data truncated for column 'a' at row 10
+show warnings limit 0, 0;
+Level Code Message
+show warnings limit 1;
+Level Code Message
+Warning 1265 Data truncated for column 'a' at row 1
+show warnings limit 0;
+Level Code Message
+show warnings limit 1, 0;
+Level Code Message
+select * from t1 limit 0;
+a
+select * from t1 limit 1, 0;
+a
+select * from t1 limit 0, 0;
+a
+drop table t1;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index d9712a28788..487fa2ea76b 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -414,14 +414,17 @@ drop database mysqltest;
select database();
# Connect without a database
-connect (user4,localhost,mysqltest_1,,*NO-ONE*);
-select database();
+connect (user1,localhost,mysqltest_1,,*NO-ONE*);
+connection user1;
+select database(), user();
+connection default;
+disconnect user1;
+use test;
#
# Test for Bug 856 'Naming a key "Primary" causes trouble'
#
-use test;
--error 1280
create table t1 (a int, index `primary` (a));
--error 1280
@@ -478,8 +481,6 @@ drop table t1,t2;
# This tests two additional possible errors and a hang if
# an improper fix is present.
#
-connection default;
-use test;
create table t1 (a int);
--error 1093
create table t1 select * from t1;
@@ -501,3 +502,4 @@ create table t1(xyz.t1.name int);
create table t1(t1.name int);
create table t2(test.t2.name int);
drop table t1,t2;
+
diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test
index 06aea7b9979..814da628fb7 100644
--- a/mysql-test/t/ctype_cp1250_ch.test
+++ b/mysql-test/t/ctype_cp1250_ch.test
@@ -10,3 +10,15 @@ CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs;
INSERT INTO t1 VALUES ('');
SELECT a, length(a), a='', a=' ', a=' ' FROM t1;
DROP TABLE t1;
+
+#
+# Bug#9759 Empty result with 'LIKE' and cp1250_czech_cs
+#
+CREATE TABLE t1 (
+ popisek varchar(30) collate cp1250_general_ci NOT NULL default '',
+ PRIMARY KEY (`popisek`)
+);
+INSERT INTO t1 VALUES ('2005-01-1');
+SELECT * FROM t1 WHERE popisek = '2005-01-1';
+SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
+drop table t1;
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 694e0223753..96cd51f58db 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -214,21 +214,6 @@ SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a;
DROP TABLE t1;
#
-# check null values #1
-#
-
---disable_warnings
-CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES (1),(2),(3);
-CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
- CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
---enable_warnings
-INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
-SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
-DROP TABLE t2;
-DROP TABLE t1;
-
-#
# check null values #2
#
@@ -286,18 +271,31 @@ SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
DROP TABLE t1;
#
+# Bug #8656: Crash with group_concat on alias in outer table
+#
+create table t2 (a int, b int);
+insert into t2 values (1,1), (2,2);
+select b x, (select group_concat(x) from t2) from t2;
+drop table t2;
+
+#
+# Bug #7405: problems with rollup
+#
+
+create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int);
+insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
+select d,a,b from t1 order by a;
+explain select a, group_concat(b) from t1 group by a with rollup;
+select a, group_concat(b) from t1 group by a with rollup;
+select a, group_concat(distinct b) from t1 group by a with rollup;
+select a, group_concat(b order by b) from t1 group by a with rollup;
+select a, group_concat(distinct b order by b) from t1 group by a with rollup;
+drop table t1;
+
+#
# Bug #6475
#
create table t1 (a char(3), b char(20), primary key (a, b));
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
select group_concat(a) from t1 group by b;
drop table t1;
-
-#
-# Bug #8656: Crash with group_concat on alias in outer table
-#
-create table r2 (a int, b int);
-insert into r2 values (1,1), (2,2);
-select b x, (select group_concat(x) from r2) from r2;
-drop table r2;
-
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index e3edcdfa5fc..e2d098618f5 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -615,7 +615,6 @@ truncate table t1;
insert into t1 values(1),(2);
select * from t1;
truncate table t1;
-truncate table t1;
insert into t1 values(1),(2);
delete from t1;
select * from t1;
@@ -1056,8 +1055,8 @@ insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
insert t2 select * from t1;
insert t3 select * from t1;
checksum table t1, t2, t3, t4 quick;
-checksum table t1, t2, t3;
-checksum table t1, t2, t3 extended;
+checksum table t1, t2, t3, t4;
+checksum table t1, t2, t3, t4 extended;
#show table status;
drop table t1,t2,t3;
@@ -1177,28 +1176,6 @@ show status like "binlog_cache_disk_use";
drop table t1;
#
-# range optimizer problem
-#
-
-create table t1 (x bigint unsigned not null primary key) engine=innodb;
-insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
-select * from t1;
-select count(*) from t1 where x>0;
-select count(*) from t1 where x=0;
-select count(*) from t1 where x<0;
-select count(*) from t1 where x < -16;
-select count(*) from t1 where x = -16;
-explain select count(*) from t1 where x > -16;
-
-# The following result should be (2). To be fixed when we add 'unsigned flag' to
-# Field::store(longlong)
-select count(*) from t1 where x > -16;
-select * from t1 where x > -16;
-select count(*) from t1 where x = 18446744073709551601;
-
-drop table t1;
-
-#
# Bug #6126: Duplicate columns in keys gives misleading error message
#
--error 1060
@@ -1220,6 +1197,62 @@ alter table t1 add key (c1,c2,c1);
alter table t1 add key (c1,c1,c2);
drop table t1;
+#
+# Bug #4082: integer truncation
+#
+
+create table t1(a int(1) , b int(1)) engine=innodb;
+insert into t1 values ('1111', '3333');
+select distinct concat(a, b) from t1;
+drop table t1;
+
+#
+# BUG#7709 test case - Boolean fulltext query against unsupported
+# engines does not fail
+#
+
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+--error 1214;
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+DROP TABLE t1;
+
+#
+# check null values #1
+#
+
+--disable_warnings
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
+ CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+--enable_warnings
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+DROP TABLE t2;
+DROP TABLE t1;
+
+#
+# range optimizer problem
+#
+
+create table t1 (x bigint unsigned not null primary key) engine=innodb;
+insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
+select * from t1;
+select count(*) from t1 where x>0;
+select count(*) from t1 where x=0;
+select count(*) from t1 where x<0;
+select count(*) from t1 where x < -16;
+select count(*) from t1 where x = -16;
+explain select count(*) from t1 where x > -16;
+
+# The following result should be (2). To be fixed when we add 'unsigned flag' to
+# Field::store(longlong)
+select count(*) from t1 where x > -16;
+select * from t1 where x > -16;
+select count(*) from t1 where x = 18446744073709551601;
+drop table t1;
+
+
# Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...).
show status like "Innodb_buffer_pool_pages_total";
@@ -1302,25 +1335,6 @@ create table t1 (v varchar(16384)) engine=innodb;
drop table t1;
#
-# Bug #4082: integer truncation
-#
-
-create table t1(a int(1) , b int(1)) engine=innodb;
-insert into t1 values ('1111', '3333');
-select distinct concat(a, b) from t1;
-drop table t1;
-
-#
-# BUG#7709 test case - Boolean fulltext query against unsupported
-# engines does not fail
-#
-
-CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
---error 1214;
-SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
-DROP TABLE t1;
-
-#
# BUG#11039 Wrong key length in min()
#
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index 69284b4c6e4..314432af83e 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -129,3 +129,25 @@ drop table t1;
# Test for deprecated table_type variable
#
set table_type=MYISAM;
+
+#
+# Tests for show warnings limit a, b
+#
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+# should generate 10 warnings
+update t1 set a='abc';
+show warnings limit 2, 1;
+show warnings limit 0, 10;
+show warnings limit 9, 1;
+show warnings limit 10, 1;
+show warnings limit 9, 2;
+show warnings limit 0, 0;
+show warnings limit 1;
+show warnings limit 0;
+show warnings limit 1, 0;
+# make sure behaviour is consistent with select ... limit
+select * from t1 limit 0;
+select * from t1 limit 1, 0;
+select * from t1 limit 0, 0;
+drop table t1;