summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/alter_table.result14
-rw-r--r--mysql-test/r/backup.result2
-rw-r--r--mysql-test/r/bdb.result9
-rw-r--r--mysql-test/r/bigint.result2
-rw-r--r--mysql-test/r/bool.result11
-rw-r--r--mysql-test/r/case.result8
-rw-r--r--mysql-test/r/create.result125
-rw-r--r--mysql-test/r/ctype_many.result27
-rw-r--r--mysql-test/r/delete.result1
-rw-r--r--mysql-test/r/derived.result17
-rw-r--r--mysql-test/r/distinct.result5
-rw-r--r--mysql-test/r/drop.result5
-rw-r--r--mysql-test/r/flush.result5
-rw-r--r--mysql-test/r/fulltext.result3
-rw-r--r--mysql-test/r/fulltext_multi.result1
-rw-r--r--mysql-test/r/fulltext_order_by.result1
-rw-r--r--mysql-test/r/func_crypt.result11
-rw-r--r--mysql-test/r/func_equal.result2
-rw-r--r--mysql-test/r/func_in.result2
-rw-r--r--mysql-test/r/func_set.result17
-rw-r--r--mysql-test/r/func_str.result3
-rw-r--r--mysql-test/r/gcc296.result16
-rw-r--r--mysql-test/r/group_by.result5
-rw-r--r--mysql-test/r/innodb-deadlock.result3
-rw-r--r--mysql-test/r/innodb.result7
-rw-r--r--mysql-test/r/innodb_cache.result2
-rw-r--r--mysql-test/r/innodb_handler.result2
-rw-r--r--mysql-test/r/insert.result19
-rw-r--r--mysql-test/r/insert_select.result17
-rw-r--r--mysql-test/r/isam.result18
-rw-r--r--mysql-test/r/join_outer.result1
-rw-r--r--mysql-test/r/key.result1
-rw-r--r--mysql-test/r/merge.result16
-rw-r--r--mysql-test/r/multi_update.result28
-rw-r--r--mysql-test/r/myisam.result54
-rw-r--r--mysql-test/r/null.result2
-rw-r--r--mysql-test/r/null_key.result3
-rw-r--r--mysql-test/r/odbc.result2
-rw-r--r--mysql-test/r/olap.result18
-rw-r--r--mysql-test/r/order_by.result35
-rw-r--r--mysql-test/r/packet.result25
-rw-r--r--mysql-test/r/query_cache.result2
-rw-r--r--mysql-test/r/rename.result2
-rw-r--r--mysql-test/r/row.result3
-rw-r--r--mysql-test/r/rpl000001.result1
-rw-r--r--mysql-test/r/rpl000002.result2
-rw-r--r--mysql-test/r/rpl000003.result17
-rw-r--r--mysql-test/r/rpl000004.result5
-rw-r--r--mysql-test/r/rpl000005.result1
-rw-r--r--mysql-test/r/rpl000006.result2
-rw-r--r--mysql-test/r/rpl000008.result28
-rw-r--r--mysql-test/r/rpl000009.result104
-rw-r--r--mysql-test/r/rpl000010.result2
-rw-r--r--mysql-test/r/rpl000011.result1
-rw-r--r--mysql-test/r/rpl000012.result10
-rw-r--r--mysql-test/r/rpl000013.result3
-rw-r--r--mysql-test/r/rpl_alter.result22
-rw-r--r--mysql-test/r/rpl_empty_master_crash.result1
-rw-r--r--mysql-test/r/rpl_failsafe.result1
-rw-r--r--mysql-test/r/rpl_log_pos.result4
-rw-r--r--mysql-test/r/rpl_redirect.result1
-rw-r--r--mysql-test/r/rpl_replicate_do.result2
-rw-r--r--mysql-test/r/rpl_rotate_logs.result2
-rw-r--r--mysql-test/r/rpl_skip_error.result1
-rw-r--r--mysql-test/r/rpl_temporary.result73
-rw-r--r--mysql-test/r/sel000001.result7
-rw-r--r--mysql-test/r/sel000002.result9
-rw-r--r--mysql-test/r/sel000003.result8
-rw-r--r--mysql-test/r/sel000031.result12
-rw-r--r--mysql-test/r/sel000032.result12
-rw-r--r--mysql-test/r/select.result35
-rw-r--r--mysql-test/r/show_check.result64
-rw-r--r--mysql-test/r/subselect.result169
-rw-r--r--mysql-test/r/temp_table.result2
-rw-r--r--mysql-test/r/type_blob.result42
-rw-r--r--mysql-test/r/type_date.result2
-rw-r--r--mysql-test/r/type_enum.result4
-rw-r--r--mysql-test/r/type_float.result34
-rw-r--r--mysql-test/r/type_ranges.result170
-rw-r--r--mysql-test/r/type_set.result4
-rw-r--r--mysql-test/r/union.result3
-rw-r--r--mysql-test/r/update.result7
-rw-r--r--mysql-test/r/user_var.result2
-rw-r--r--mysql-test/r/varbinary.result2
-rw-r--r--mysql-test/r/variables.result8
-rw-r--r--mysql-test/r/warnings.result22
86 files changed, 936 insertions, 517 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index cba486109ac..456dfa860df 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -50,10 +50,10 @@ PRIMARY KEY (GROUP_ID,LANG_ID),
KEY NAME (NAME));
ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null;
SHOW FULL COLUMNS FROM t1;
-Field Type Null Key Default Extra Privileges Comment
-GROUP_ID int(10) unsigned PRI 0 select,insert,update,references
-LANG_ID smallint(5) unsigned PRI 0 select,insert,update,references
-NAME char(80) character set latin1 MUL select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+GROUP_ID int(10) unsigned binary PRI 0 select,insert,update,references
+LANG_ID smallint(5) unsigned binary PRI 0 select,insert,update,references
+NAME char(80) latin1 MUL select,insert,update,references
DROP TABLE t1;
create table t1 (n int);
insert into t1 values(9),(3),(12),(10);
@@ -118,7 +118,7 @@ create table t1 (i int unsigned not null auto_increment primary key);
alter table t1 rename t2;
alter table t2 rename t1, add c char(10) comment "no comment";
show columns from t1;
-Field Type Null Key Default Extra
-i int(10) unsigned PRI NULL auto_increment
-c char(10) character set latin1 YES NULL
+Field Type Collation Null Key Default Extra
+i int(10) unsigned binary PRI NULL auto_increment
+c char(10) latin1 YES NULL
drop table t1;
diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result
index 43d57d2d4f7..e4f41517f94 100644
--- a/mysql-test/r/backup.result
+++ b/mysql-test/r/backup.result
@@ -1,5 +1,5 @@
set SQL_LOG_BIN=0;
-drop table if exists t1;
+drop table if exists t1, t2, t3;
create table t1(n int);
backup table t1 to '../bogus';
Table Op Msg_type Msg_text
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index ef4dfc307bf..2c7d3136369 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -797,7 +797,6 @@ select * from t1 where i=1 and j=2;
i j
1 2
drop table t1;
-drop table if exists t1, t2, t3, t4, t5, t6, t7;
create table t1
(
branch_id int auto_increment primary key,
@@ -806,7 +805,6 @@ branch_active int not null default 1,
unique branch_name(branch_name),
index branch_active(branch_active)
) type=bdb;
-drop table if exists t2 ;
create table t2
(
target_id int auto_increment primary key,
@@ -815,7 +813,6 @@ target_active int not null default 1,
unique target_name(target_name),
index target_active(target_active)
) type=bdb;
-drop table if exists t3 ;
create table t3
(
platform_id int auto_increment primary key,
@@ -824,7 +821,6 @@ platform_active int not null default 1,
unique platform_name(platform_name),
index platform_active(platform_active)
) type=bdb;
-drop table if exists t4 ;
create table t4
(
product_id int auto_increment primary key,
@@ -834,7 +830,6 @@ product_active int not null default 1,
unique product_name(product_name),
index product_active(product_active)
) type=bdb;
-drop table if exists t5 ;
create table t5
(
product_file_id int auto_increment primary key,
@@ -847,7 +842,6 @@ file_included int not null default 1,
unique product_file(product_id,file_name),
index file_included(file_included)
) type=bdb;
-drop table if exists t6 ;
create table t6
(
file_platform_id int auto_increment primary key,
@@ -860,7 +854,6 @@ build_filename varchar(255) not null,
archive_filename varchar(255) not null,
unique file_platform(product_file_id,platform_id,branch_id)
) type=bdb;
-drop table if exists t8 ;
create table t8
(
archive_id int auto_increment primary key,
@@ -872,7 +865,6 @@ status_id int not null default 1,
unique archive(branch_id,target_id,platform_id,product_id),
index status_id(status_id)
) type=bdb;
-drop table if exists t7 ;
create table t7
(
build_id int auto_increment primary key,
@@ -1057,7 +1049,6 @@ KINMU_DATE
select T1.KINMU_DATE from t1 T1 ,t2 T2 where T1.SYAIN_NO = '12345' and T1.KINMU_DATE = '200106' and T2.SYAIN_NO = T1.SYAIN_NO;
KINMU_DATE
DROP TABLE t1,t2;
-drop table if exists t1;
create table t1 (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb;
insert into t1 values (1,1), (1,2);
select * from t1 where a = 1;
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 6afa74d20e2..8bc383c6f4c 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 65536 2147483647 -2147483648 2147483648 4294967296
@@ -7,7 +8,6 @@ select 9223372036854775807,-009223372036854775808;
select +9999999999999999999,-9999999999999999999;
+9999999999999999999 -9999999999999999999
10000000000000000000 -10000000000000000000
-drop table if exists t1;
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1;
diff --git a/mysql-test/r/bool.result b/mysql-test/r/bool.result
index cb82c6baa0f..890c85dc946 100644
--- a/mysql-test/r/bool.result
+++ b/mysql-test/r/bool.result
@@ -46,10 +46,9 @@ SELECT @a, @b;
@a @b
0 6
DROP TABLE t1;
-drop table if exists t;
-create table t(a int, b int);
-insert into t values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
-select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t;
+create table t1 (a int, b int);
+insert into t1 values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
+select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t1;
A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N
0 N 1 N 0 1 1 N N N
@@ -60,7 +59,7 @@ N 1 N 0 N N N 1 0 0
0 1 1 0 0 1 1 1 0 0
1 0 0 1 0 1 1 1 0 0
1 1 0 0 1 0 0 1 0 0
-select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t;
+select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1;
A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N
0 N 1 N 0 1 1 N N N
@@ -71,4 +70,4 @@ N 1 N 0 N N N 1 0 0
0 1 1 0 0 1 1 1 0 0
1 0 0 1 0 1 1 1 0 0
1 1 0 0 1 0 0 1 0 0
-drop table t;
+drop table t1;
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index 18241a8fcc1..914e05efa7a 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -63,3 +63,11 @@ nothing 2
one 1
two 1
drop table t1;
+create table t1 (row int not null, col int not null, val varchar(255) not null);
+insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium'),(3,1,'green'),(3,2,'small');
+select max(case col when 1 then val else null end) as color from t1 group by row;
+color
+orange
+yellow
+green
+drop table t1;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 0be0d624fca..5228ae50a83 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3;
create table t1 (b char(0));
insert into t1 values (""),(null);
select * from t1;
@@ -13,12 +13,15 @@ select * from t1;
b
-drop table if exists t1;
+drop table t1;
create table t2 type=heap select * from t1;
Table 'test.t1' doesn't exist
create table t2 select auto+1 from t1;
Table 'test.t1' doesn't exist
drop table if exists t1,t2;
+Warnings:
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
create table t1 (b char(0) not null, index(b));
The used table handler can't index column 'b'
create table t1 (a int not null auto_increment,primary key (a)) type=heap;
@@ -48,6 +51,8 @@ drop table 1ea10;
create table t1 (t1.index int);
drop table t1;
drop database if exists test_$1;
+Warnings:
+Note 1008 Can't drop database 'test_$1'. Database doesn't exist
create database test_$1;
create table test_$1.$test1 (a$1 int, $b int, c$ int);
insert into test_$1.$test1 values (1,2,3);
@@ -70,47 +75,53 @@ drop table t1,t2;
create table t1(x varchar(50) );
create table t2 select x from t1 where 1=2;
describe t1;
-Field Type Null Key Default Extra
-x varchar(50) character set latin1 YES NULL
+Field Type Collation Null Key Default Extra
+x varchar(50) latin1 YES NULL
describe t2;
-Field Type Null Key Default Extra
-x char(50) character set latin1 YES NULL
+Field Type Collation Null Key Default Extra
+x char(50) latin1 YES NULL
drop table t2;
create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
describe t2;
-Field Type Null Key Default Extra
-a datetime 0000-00-00 00:00:00
-b time 00:00:00
-c date 0000-00-00
-d bigint(17) 0
-e double(18,1) 0.0
-f bigint(17) 0
+Field Type Collation Null Key Default Extra
+a datetime latin1 0000-00-00 00:00:00
+b time latin1 00:00:00
+c date latin1 0000-00-00
+d bigint(17) binary 0
+e double(18,1) binary 0.0
+f bigint(17) binary 0
drop table t2;
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
describe t2;
-Field Type Null Key Default Extra
-d date 0000-00-00
-t time 00:00:00
-dt datetime 0000-00-00 00:00:00
+Field Type Collation Null Key Default Extra
+d date latin1 0000-00-00
+t time latin1 00:00:00
+dt datetime latin1 0000-00-00 00:00:00
drop table t1,t2;
create table t1 (a tinyint);
create table t2 (a int) select * from t1;
describe t1;
-Field Type Null Key Default Extra
-a tinyint(4) YES NULL
+Field Type Collation Null Key Default Extra
+a tinyint(4) binary YES NULL
describe t2;
-Field Type Null Key Default Extra
-a int(11) YES NULL
+Field Type Collation Null Key Default Extra
+a int(11) binary YES NULL
drop table if exists t2;
create table t2 (a int, a float) select * from t1;
Duplicate column name 'a'
drop table if exists t2;
+Warnings:
+Note 1051 Unknown table 't2'
create table t2 (a int) select a as b, a+1 as b from t1;
Duplicate column name 'b'
drop table if exists t2;
+Warnings:
+Note 1051 Unknown table 't2'
create table t2 (b int) select a as b, a+1 as b from t1;
Duplicate column name 'b'
drop table if exists t1,t2;
+Warnings:
+Note 1051 Unknown table 't2'
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
Table Create Table
@@ -161,3 +172,75 @@ drop table if exists t1;
create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b));
drop table if exists t1,t2;
+create table t1(id int not null, name char(20));
+insert into t1 values(10,'mysql'),(20,'monty- the creator');
+create table t2(id int not null);
+insert into t2 values(10),(20);
+create table t3 like t1;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `id` int(11) NOT NULL default '0',
+ `name` char(20) default NULL
+) TYPE=MyISAM CHARSET=latin1
+select * from t3;
+id name
+create table if not exists t3 like t1;
+Warnings:
+Warning 1050 Table 't3' already exists
+select @@warning_count;
+@@warning_count
+1
+create temporary table t3 like t2;
+show create table t3;
+Table Create Table
+t3 CREATE TEMPORARY TABLE `t3` (
+ `id` int(11) NOT NULL default '0'
+) TYPE=MyISAM CHARSET=latin1
+select * from t3;
+id
+drop table t3;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `id` int(11) NOT NULL default '0',
+ `name` char(20) default NULL
+) TYPE=MyISAM CHARSET=latin1
+select * from t3;
+id name
+drop table t2, t3;
+drop database if exists test_$1;
+Warnings:
+Note 1008 Can't drop database 'test_$1'. Database doesn't exist
+create database test_$1;
+create table test_$1.t3 like t1;
+create temporary table t3 like test_$1.t3;
+show create table t3;
+Table Create Table
+t3 CREATE TEMPORARY TABLE `t3` (
+ `id` int(11) NOT NULL default '0',
+ `name` char(20) default NULL
+) TYPE=MyISAM CHARSET=latin1
+create table t2 like t3;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL default '0',
+ `name` char(20) default NULL
+) TYPE=MyISAM CHARSET=latin1
+select * from t2;
+id name
+create table t3 like t1;
+create table t3 like test_$1.t3;
+Table 't3' already exists
+create table non_existing_database.t1 like t1;
+Got one of the listed errors
+create table t3 like non_existing_table;
+Unknown table 'non_existing_table'
+create temporary table t3 like t1;
+Table 't3' already exists
+create table t3 like `a/a`;
+Incorrect table name 'a/a'
+drop table t1, t2, t3;
+drop table t3;
+drop database test_$1;
diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result
index 45fe91c096d..91a43634bcb 100644
--- a/mysql-test/r/ctype_many.result
+++ b/mysql-test/r/ctype_many.result
@@ -1,45 +1,45 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
comment CHAR(32) ASCII NOT NULL,
-koi8_ru_f CHAR(32) CHARACTER SET koi8_ru NOT NULL
+koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL
) CHARSET=latin5;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`comment` char(32) character set latin1 NOT NULL default '',
- `koi8_ru_f` char(32) character set koi8_ru NOT NULL default ''
+ `koi8_ru_f` char(32) character set koi8r NOT NULL default ''
) TYPE=MyISAM CHARSET=latin5
ALTER TABLE t1 CHANGE comment comment CHAR(32) CHARACTER SET latin2 NOT NULL;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`comment` char(32) character set latin2 NOT NULL default '',
- `koi8_ru_f` char(32) character set koi8_ru NOT NULL default ''
+ `koi8_ru_f` char(32) character set koi8r NOT NULL default ''
) TYPE=MyISAM CHARSET=latin5
ALTER TABLE t1 ADD latin5_f CHAR(32) NOT NULL;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`comment` char(32) character set latin2 NOT NULL default '',
- `koi8_ru_f` char(32) character set koi8_ru NOT NULL default '',
- `latin5_f` char(32) character set latin5 NOT NULL default ''
+ `koi8_ru_f` char(32) character set koi8r NOT NULL default '',
+ `latin5_f` char(32) NOT NULL default ''
) TYPE=MyISAM CHARSET=latin5
ALTER TABLE t1 CHARSET=latin2;
ALTER TABLE t1 ADD latin2_f CHAR(32) NOT NULL;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `comment` char(32) character set latin2 NOT NULL default '',
- `koi8_ru_f` char(32) character set koi8_ru NOT NULL default '',
+ `comment` char(32) NOT NULL default '',
+ `koi8_ru_f` char(32) character set koi8r NOT NULL default '',
`latin5_f` char(32) character set latin5 NOT NULL default '',
- `latin2_f` char(32) character set latin2 NOT NULL default ''
+ `latin2_f` char(32) NOT NULL default ''
) TYPE=MyISAM CHARSET=latin2
ALTER TABLE t1 DROP latin2_f, DROP latin5_f;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `comment` char(32) character set latin2 NOT NULL default '',
- `koi8_ru_f` char(32) character set koi8_ru NOT NULL default ''
+ `comment` char(32) NOT NULL default '',
+ `koi8_ru_f` char(32) character set koi8r NOT NULL default ''
) TYPE=MyISAM CHARSET=latin2
INSERT INTO t1 (koi8_ru_f,comment) VALUES ('a','LAT SMALL A');
INSERT INTO t1 (koi8_ru_f,comment) VALUES ('b','LAT SMALL B');
@@ -336,6 +336,11 @@ CYR CAPIT SOFT SIGN ø Ь
CYR CAPIT E ü Э
CYR CAPIT YU à Ю
CYR CAPIT YA ñ Я
+ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL;
+UPDATE t1 SET bin_f=koi8_ru_f;
+SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1;
+COUNT(DISTINCT bin_f) COUNT(DISTINCT koi8_ru_f) COUNT(DISTINCT utf8_f)
+116 58 57
SELECT koi8_ru_f,MIN(comment) FROM t1 GROUP BY 1;
koi8_ru_f MIN(comment)
a LAT CAPIT A
@@ -1056,7 +1061,7 @@ CYR SMALL YA CYR CAPIT YA
CYR SMALL YA CYR SMALL YA
SELECT t11.comment,t12.comment
FROM t1 t11,t1 t12
-WHERE t11.koi8_ru_f=CONVERT(t12.utf8_f USING koi8_ru)
+WHERE t11.koi8_ru_f=CONVERT(t12.utf8_f USING koi8r)
ORDER BY t12.utf8_f,t11.comment,t12.comment;
comment comment
LAT CAPIT A LAT CAPIT A
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 351798b0509..4fa85ea9cbc 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -24,7 +24,6 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
delete from t1 where a=27;
drop table t1;
-drop table if exists t;
CREATE TABLE `t` (
`i` int(10) NOT NULL default '0',
`i2` int(10) NOT NULL default '0',
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 03e00b206b2..4f16e239e15 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -1,4 +1,11 @@
drop table if exists t1,t2,t3;
+select * from (select 2 from DUAL) b;
+2
+2
+SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
+Unknown column 'a' in 'field list'
+SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
+Unknown column 'a' in 'field list'
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null);
@@ -53,7 +60,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY x1 ALL NULL NULL NULL NULL 4
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
2 DERIVED x1 ALL NULL NULL NULL NULL 4
-drop table if exists t1.t2,t3;
+drop table if exists t2,t3;
select * from (select 1) as a;
1
1
@@ -116,10 +123,16 @@ explain select count(*) from t1 as tt1, (select * from t1) as tt2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2 DERIVED tt1 index NULL a 4 NULL 10000 Using index
-drop table if exists t1;
+drop table t1;
SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
(SELECT * FROM (SELECT 1 as a) as a )
1
select * from (select 1 as a) b left join (select 2 as a) c using(a);
a a
1 NULL
+SELECT * FROM (SELECT 1 UNION SELECT a) b;
+Unknown column 'a' in 'field list'
+SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
+Unknown column 'a' in 'field list'
+SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
+Unknown column 'a' in 'field list'
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index aefcba9ed9d..ae1d9588bc7 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -326,7 +326,6 @@ AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2));
id
2
drop table t1,t2,t3;
-drop table if exists t1;
create table t1 (a int not null, b int not null, t time);
insert into t1 values (1,1,"00:06:15"),(1,2,"00:06:15"),(1,2,"00:30:15"),(1,3,"00:06:15"),(1,3,"00:30:15");
select a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
@@ -410,7 +409,7 @@ INSERT INTO t2 VALUES (33,6,'Kevin','0','kevin@stileproject.com',1,'',0,'http://
SELECT DISTINCT t1.*, t2.* FROM t1 LEFT JOIN t2 ON (t2.userid = t1.touserid);
privatemessageid folderid userid touserid fromuserid title message dateline showsignature iconid messageread readtime receipt deleteprompt multiplerecipients userid usergroupid username password email styleid parentemail coppauser homepage icq aim yahoo signature adminemail showemail invisible usertitle customtitle joindate cookieuser daysprune lastvisit lastactivity lastpost posts timezoneoffset emailnotification buddylist ignorelist pmfolders receivepm emailonpm pmpopup avatarid avatarrevision options birthday maxposts startofweek ipaddress referrerid nosessionhash autorefresh messagepopup inforum ratenum ratetotal allowrate
128 0 33 33 8 :D 996121863 1 0 2 996122850 2 0 0 33 6 Kevin 0 kevin@stileproject.com 1 0 http://www.stileproject.com 1 1 0 Administrator 0 996120694 1 -1 1030996168 1031027028 1030599436 36 -6 0 1 0 1 0 0 15 0000-00-00 -1 1 64.0.0.0 0 1 -1 0 0 4 19 1
-DROP TABLE IF EXISTS t1,t2;
+DROP TABLE t1,t2;
CREATE TABLE t1 (a int primary key, b int, c int);
INSERT t1 VALUES (1,2,3);
CREATE TABLE t2 (a int primary key, b int, c int);
@@ -418,4 +417,4 @@ INSERT t2 VALUES (3,4,5);
SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c;
a b
1 4
-DROP TABLE IF EXISTS t1,t2;
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index 178c3a8cb4f..a9048b65d51 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -1,5 +1,4 @@
drop table if exists t1;
-drop table if exists t1;
drop table t1;
Unknown table 't1'
create table t1(n int);
@@ -13,6 +12,8 @@ select * from t1;
n
1
drop database if exists mysqltest;
+Warnings:
+Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
create database mysqltest;
drop database if exists mysqltest;
create database mysqltest;
@@ -25,6 +26,8 @@ drop database if exists mysqltest;
create database mysqltest;
drop database mysqltest;
drop database if exists mysqltest;
+Warnings:
+Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
flush tables with read lock;
create database mysqltest;
Got one of the listed errors
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index 7080f2b6145..4e7e4769f1b 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -1,6 +1,6 @@
-drop table if exists t1;
+drop table if exists t1,t2;
+drop database if exists mysqltest;
create temporary table t1(n int not null primary key);
-drop table if exists t2;
create table t2(n int);
insert into t2 values(3);
select * from t1;
@@ -11,7 +11,6 @@ drop table t2;
Table 't2' was locked with a READ lock and can't be updated
drop table t2;
unlock tables;
-drop database if exists mysqltest;
create database mysqltest;
create table mysqltest.t1(n int);
insert into mysqltest.t1 values (23);
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index a991981bf21..1382c31d145 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -141,7 +141,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`ticket` int(11) default NULL,
- `inhalt` text character set latin1,
+ `inhalt` text,
KEY `tig` (`ticket`),
FULLTEXT KEY `tix` (`inhalt`)
) TYPE=MyISAM CHARSET=latin1
@@ -206,7 +206,6 @@ select 8 from t1;
8
8
drop table t1;
-drop table if exists t1;
create table t1 (a text, fulltext key (a));
insert into t1 values ('aaaa');
repair table t1;
diff --git a/mysql-test/r/fulltext_multi.result b/mysql-test/r/fulltext_multi.result
index 72b7102fd3f..968b00020e2 100644
--- a/mysql-test/r/fulltext_multi.result
+++ b/mysql-test/r/fulltext_multi.result
@@ -1,4 +1,3 @@
-use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a int(11) NOT NULL auto_increment,
diff --git a/mysql-test/r/fulltext_order_by.result b/mysql-test/r/fulltext_order_by.result
index c0e72ff789f..bfee9eba280 100644
--- a/mysql-test/r/fulltext_order_by.result
+++ b/mysql-test/r/fulltext_order_by.result
@@ -1,4 +1,3 @@
-use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result
index ad3a64ccd1d..461ae1e7e09 100644
--- a/mysql-test/r/func_crypt.result
+++ b/mysql-test/r/func_crypt.result
@@ -1,6 +1,15 @@
select length(encrypt('foo', 'ff')) <> 0;
length(encrypt('foo', 'ff')) <> 0
1
-select old_password('test'),length(password("1")),length(encrypt('test')),encrypt('test','aa');
+select password("a",""), password("a",NULL), password("","a"), password(NULL,"a");
+password("a","") password("a",NULL) password("","a") password(NULL,"a")
+*2517f7235d68d4ba2e5019c93420523101157a792c01 NULL NULL
+select password("aaaaaaaaaaaaaaaa","a"), password("a","aaaaaaaaaaaaaaaa");
+password("aaaaaaaaaaaaaaaa","a") password("a","aaaaaaaaaaaaaaaa")
+*2cd3b9a44e9a9994789a30f935c92f45a96c5472f381 *37c7c5c794ff144819f2531bf03c57772cd84e40db09
+select old_password('test'), length(password("1")), length(encrypt('test')), encrypt('test','aa');
old_password('test') length(password("1")) length(encrypt('test')) encrypt('test','aa')
378b243e220ca493 45 13 aaqPiZY5xR5l.
+select old_password(""), old_password(NULL), password(""), password(NULL);
+old_password("") old_password(NULL) password("") password(NULL)
+ NULL NULL
diff --git a/mysql-test/r/func_equal.result b/mysql-test/r/func_equal.result
index 32a911eedf8..352b76f2744 100644
--- a/mysql-test/r/func_equal.result
+++ b/mysql-test/r/func_equal.result
@@ -1,3 +1,4 @@
+drop table if exists t1,t2;
select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL;
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1
@@ -10,7 +11,6 @@ select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
select "A"<=>"B","A"<=>NULL,NULL<=>"A";
"A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0
-drop table if exists t1,t2;
create table t1 (id int, value int);
create table t2 (id int, value int);
insert into t1 values (1,null);
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 01d70c7c4c6..006dc8abef0 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
select 1 in (1,2,3);
1 in (1,2,3)
1
@@ -34,7 +35,6 @@ select 3.5 in (1.5,NULL,3.5);
select 10.5 in (1.5,NULL,3.5);
10.5 in (1.5,NULL,3.5)
NULL
-drop table if exists t1;
CREATE TABLE t1 (a int, b int, c int);
insert into t1 values (1,2,3), (1,NULL,3);
select 1 in (a,b,c) from t1;
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index 5305c16c5d9..ab72e42eca9 100644
--- a/mysql-test/r/func_set.result
+++ b/mysql-test/r/func_set.result
@@ -25,3 +25,20 @@ find_in_set("","a,b,c") find_in_set("","a,b,c,") find_in_set("",",a,b,c")
select find_in_set("abc","abc"),find_in_set("ab","abc"),find_in_set("abcd","abc");
find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
1 0 0
+drop table if exists t1,t2;
+create table t1 (id int(10) not null unique);
+create table t2 (id int(10) not null primary key,
+val int(10) not null);
+insert into t1 values (1),(2),(4);
+insert into t2 values (1,1),(2,1),(3,1),(4,2);
+select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
+id elt(two.val,'one','two')
+1 one
+2 one
+4 two
+select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
+id elt(two.val,'one','two')
+1 one
+2 one
+4 two
+drop table t1,t2;
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index d0358aad6ba..b3468586f32 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -170,6 +170,9 @@ quote(concat('abc\'', '\\cba'))
select quote(1/0), quote('\0\Z');
quote(1/0) quote('\0\Z')
NULL '\0\Z'
+select length(quote(concat(char(0),"test")));
+length(quote(concat(char(0),"test")))
+8
select reverse("");
reverse("")
diff --git a/mysql-test/r/gcc296.result b/mysql-test/r/gcc296.result
index 8f78f70cc1f..628bbbf3f93 100644
--- a/mysql-test/r/gcc296.result
+++ b/mysql-test/r/gcc296.result
@@ -1,5 +1,5 @@
-drop table if exists obory;
-CREATE TABLE obory (
+drop table if exists t1;
+CREATE TABLE t1 (
kodoboru varchar(10) default NULL,
obor tinytext,
aobor tinytext,
@@ -7,14 +7,14 @@ UNIQUE INDEX kodoboru (kodoboru),
FULLTEXT KEY obor (obor),
FULLTEXT KEY aobor (aobor)
);
-INSERT INTO obory VALUES ('0101000000','aaa','AAA');
-INSERT INTO obory VALUES ('0102000000','bbb','BBB');
-INSERT INTO obory VALUES ('0103000000','ccc','CCC');
-INSERT INTO obory VALUES ('0104000000','xxx','XXX');
-select * from obory;
+INSERT INTO t1 VALUES ('0101000000','aaa','AAA');
+INSERT INTO t1 VALUES ('0102000000','bbb','BBB');
+INSERT INTO t1 VALUES ('0103000000','ccc','CCC');
+INSERT INTO t1 VALUES ('0104000000','xxx','XXX');
+select * from t1;
kodoboru obor aobor
0101000000 aaa AAA
0102000000 bbb BBB
0103000000 ccc CCC
0104000000 xxx XXX
-drop table obory;
+drop table t1;
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 696d8200b70..aa3de48c09e 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1,6 +1,6 @@
+drop table if exists t1,t2,t3;
SELECT 1 FROM (SELECT 1) as a GROUP BY SUM(1);
Invalid use of group function
-drop table if exists t1,t2,t3;
CREATE TABLE t1 (
spID int(10) unsigned,
userID int(10) unsigned,
@@ -42,7 +42,7 @@ SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1
userid MIN(t1.score+0.0)
1 1.0
2 2.0
-drop table test.t1,test.t2;
+drop table t1,t2;
CREATE TABLE t1 (
PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
payDate date DEFAULT '0000-00-00' NOT NULL,
@@ -390,7 +390,6 @@ CONCAT(a, b) count(*)
abcdef 1
hijklm 2
DROP TABLE t1;
-drop table if exists t1;
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
insert into t1 values (1,2,1,4),(1,2,2,4),(1,2,3,4),(1,2,4,4),(1,1,1,4),(1,1,2,4),(1,1,3,4),(1,1,4,4),(1,3,1,4),(1,3,2,4),(1,3,3,4),(1,3,4,4);
select One, Two, sum(Four) from t1 group by One,Two;
diff --git a/mysql-test/r/innodb-deadlock.result b/mysql-test/r/innodb-deadlock.result
index db7155f14fb..e1b3e38b243 100644
--- a/mysql-test/r/innodb-deadlock.result
+++ b/mysql-test/r/innodb-deadlock.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1 (id integer, x integer) type=INNODB;
insert into t1 values(0, 0);
set autocommit=0;
@@ -18,7 +18,6 @@ id x
0 2
commit;
drop table t1;
-drop table if exists t1, t2;
create table t1 (id integer, x integer) type=INNODB;
create table t2 (b integer, a integer) type=INNODB;
insert into t1 values(0, 0), (300, 300);
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 82e678416ad..f5bbf082730 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -805,7 +805,7 @@ create table t1 (a char(20), index (a(5))) type=innodb;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` char(20) character set latin1 default NULL,
+ `a` char(20) default NULL,
KEY `a` (`a`)
) TYPE=InnoDB CHARSET=latin1
drop table t1;
@@ -918,8 +918,8 @@ id select_type table type possible_keys key key_len ref rows Extra
drop table t1;
create table t1 (t int not null default 1, key (t)) type=innodb;
desc t1;
-Field Type Null Key Default Extra
-t int(11) MUL 1
+Field Type Collation Null Key Default Extra
+t int(11) binary MUL 1
drop table t1;
CREATE TABLE t1 (
number bigint(20) NOT NULL default '0',
@@ -1021,7 +1021,6 @@ id code name
7 4 Matt
COMMIT;
DROP TABLE t1;
-drop table if exists t1,t2;
create table t1 (n int(10), d int(10)) type=innodb;
create table t2 (n int(10), d int(10)) type=innodb;
insert into t1 values(1,1),(1,2);
diff --git a/mysql-test/r/innodb_cache.result b/mysql-test/r/innodb_cache.result
index 47abcb45fe5..7d351a13e16 100644
--- a/mysql-test/r/innodb_cache.result
+++ b/mysql-test/r/innodb_cache.result
@@ -1,4 +1,4 @@
-drop table if exists t1, t2, t3;
+drop table if exists t1,t2,t3;
flush status;
set autocommit=0;
create table t1 (a int not null) type=innodb;
diff --git a/mysql-test/r/innodb_handler.result b/mysql-test/r/innodb_handler.result
index a55114a0e3d..dc6a265fb29 100644
--- a/mysql-test/r/innodb_handler.result
+++ b/mysql-test/r/innodb_handler.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1 (a int, b char(10), key a(a), key b(a,b)) type=innodb;
insert into t1 values
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 2ffa9d88618..ebd34dd7668 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -48,10 +48,19 @@ sid id
skr 1
skr 2
test 1
+insert into t1 values ('rts',NULL),('rts',NULL),('test',NULL);
+select * from t1;
+sid id
+rts 1
+rts 2
+skr 1
+skr 2
+test 1
+test 2
drop table t1;
-drop database if exists foo;
-create database foo;
-use foo;
+drop database if exists test_$1;
+create database test_$1;
+use test_$1;
create table t1 (c int);
-insert into foo.t1 set foo.t1.c = '1';
-drop database foo;
+insert into test_$1.t1 set test_$1.t1.c = '1';
+drop database test_$1;
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index e24c3179a0c..9a65eaee573 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -21,8 +21,7 @@ payoutID
20
22
drop table t1,t2;
-DROP TABLE IF EXISTS crash1,crash2;
-CREATE TABLE `crash1` (
+CREATE TABLE `t1` (
`numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment,
@@ -37,7 +36,7 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) TYPE=MyISAM;
-CREATE TABLE `crash2` (
+CREATE TABLE `t2` (
`numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment,
@@ -52,17 +51,17 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) TYPE=MyISAM;
-INSERT INTO crash2
+INSERT INTO t2
(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
(9,1,56,'test','joce','2001-07-25 13:50:53'
,3649052399,0);
-INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip)
-SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM crash2
+INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
+SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%';
Variable_name Value
bulk_insert_buffer_size 8388608
-INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip)
-SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM crash2
+INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
+SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC;
-DROP TABLE IF EXISTS crash1,crash2;
+DROP TABLE IF EXISTS t1,t2;
diff --git a/mysql-test/r/isam.result b/mysql-test/r/isam.result
index e8f7898f1eb..7871e899773 100644
--- a/mysql-test/r/isam.result
+++ b/mysql-test/r/isam.result
@@ -38,6 +38,8 @@ Incorrect table definition; There can only be one auto column and it must be def
create table t1 (ordid int(8), unique (ordid)) type=isam;
Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL
drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
create table t2 type=isam select * from t1;
@@ -62,15 +64,15 @@ Table Op Msg_type Msg_text
test.t2 check error Table 't2' was not locked with LOCK TABLES
test.t1 check status OK
show columns from t1;
-Field Type Null Key Default Extra
-a int(11) PRI 0
-b int(11) MUL 0
-c int(11) 0
+Field Type Collation Null Key Default Extra
+a int(11) binary PRI 0
+b int(11) binary MUL 0
+c int(11) binary 0
show full columns from t1;
-Field Type Null Key Default Extra Privileges Comment
-a int(11) PRI 0 select,insert,update,references
-b int(11) MUL 0 select,insert,update,references
-c int(11) 0 select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+a int(11) binary PRI 0 select,insert,update,references
+b int(11) binary MUL 0 select,insert,update,references
+c int(11) binary 0 select,insert,update,references
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 a A 4 NULL NULL BTREE
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index b89a6696727..8abe6d517ee 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -181,7 +181,6 @@ SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 L
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
drop table t1,t2;
-drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
cod_asig int(11) DEFAULT '0' NOT NULL,
desc_larga_cat varchar(80) DEFAULT '' NOT NULL,
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 1cd9c9dfe79..9e1f743d132 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -147,7 +147,6 @@ t1 0 e 1 e A 0 NULL NULL BTREE
t1 0 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE
drop table t1;
-DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
UNIQUE (c,i));
INSERT INTO t1 (c) VALUES (NULL),(NULL);
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index d0e595d6551..9199f291c08 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -172,7 +172,7 @@ show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` int(11) NOT NULL default '0',
- `b` char(20) character set latin1 default NULL,
+ `b` char(20) default NULL,
KEY `a` (`a`)
) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(t1,t2)
create table t4 (a int not null, b char(10), key(a)) type=MERGE UNION=(t1,t2);
@@ -181,6 +181,8 @@ Can't open file: 't4.MRG'. (errno: 143)
create table t5 (a int not null, b char(10), key(a)) type=MERGE UNION=(test.t1,test_2.t2);
Incorrect table definition; All MERGE tables must be in the same database
drop table if exists t5,t4,t3,t1,t2;
+Warnings:
+Note 1051 Unknown table 't5'
create table t1 (c char(10)) type=myisam;
create table t2 (c char(10)) type=myisam;
create table t3 (c char(10)) union=(t1,t2) type=merge;
@@ -262,7 +264,6 @@ create table t1 (a int not null) type=merge;
select * from t1;
a
drop table t1;
-drop table if exists t3, t2, t1;
create table t1 (a int not null, b int not null, key(a,b));
create table t2 (a int not null, b int not null, key(a,b));
create table t3 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2);
@@ -274,7 +275,6 @@ a b
1 1
1 2
drop table t3,t1,t2;
-drop table if exists t6, t5, t4, t3, t2, t1;
create table t1 (a int not null, b int not null auto_increment, primary key(a,b));
create table t2 (a int not null, b int not null auto_increment, primary key(a,b));
create table t3 (a int not null, b int not null, key(a,b)) UNION=(t1,t2) INSERT_METHOD=NO;
@@ -533,15 +533,14 @@ CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '
INSERT INTO t1 VALUES (1,1), (2,1);
CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
INSERT INTO t2 VALUES (1,2), (2,2);
-CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
-select max(b) from t where a = 2;
+CREATE TABLE t3 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
+select max(b) from t3 where a = 2;
max(b)
NULL
select max(b) from t1 where a = 2;
max(b)
1
-drop table if exists t,t1,t2;
-drop table if exists t1, t2, t3, t4, t5, t6;
+drop table if exists t3,t1,t2;
create table t1 (a int not null);
create table t2 (a int not null);
insert into t1 values (1);
@@ -561,7 +560,6 @@ a
1
2
drop table if exists t6, t3, t1, t2, t4, t5;
-DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
fileset_id tinyint(3) unsigned NOT NULL default '0',
file_code varchar(32) NOT NULL default '',
@@ -595,4 +593,4 @@ EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2
AND file_code = '0000000115' LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY,files PRIMARY 33 const,const 1
-DROP TABLE IF EXISTS t2, t1;
+DROP TABLE t2, t1;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 8cf035343b1..4dbb3c8adb1 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -96,7 +96,7 @@ id mydate
5 2002-05-12 00:00:00
6 2002-06-22 00:00:00
7 2002-07-22 00:00:00
-DROP TABLE IF EXISTS t1,t2,t3;
+DROP TABLE t1,t2,t3;
CREATE TABLE IF NOT EXISTS `t1` (
`id` int(11) NOT NULL auto_increment,
`tst` text,
@@ -125,7 +125,7 @@ ID ParId tst tst1
1 1 MySQL MySQL AB
2 2 MSSQL Microsoft
3 3 ORACLE ORACLE
-drop table if exists t1, t2 ;
+drop table t1, t2 ;
create table t1 (n numeric(10));
create table t2 (n numeric(10));
insert into t2 values (1),(2),(4),(8),(16),(32);
@@ -235,4 +235,28 @@ select * from t2;
n d
1 30
1 30
+UPDATE t1 a ,t2 b SET a.d=b.d,b.d=30 WHERE a.n=b.n;
+select * from t1;
+n d
+1 30
+3 2
+select * from t2;
+n d
+1 30
+1 30
+DELETE t1, t2 FROM t1 a,t2 b where a.n=b.n;
+select * from t1;
+n d
+3 2
+select * from t2;
+n d
drop table t1,t2;
+CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a'),(10,''),(11,''),(12,''),(13,'');
+CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a');
+CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
+INSERT INTO t3 VALUES (1,'jedan'),(2,'dva');
+update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj;
+update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj;
+drop table t1,t2,t3;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 6b9c3a53305..23610be36c4 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
CREATE TABLE t1 (
STRING_DATA char(255) default NULL,
KEY string_data (STRING_DATA)
@@ -83,7 +83,6 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
-drop table if exists t1;
create table t1 ( t1 char(255), key(t1(250)));
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
@@ -121,7 +120,6 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
-drop table if exists t1;
create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
@@ -286,7 +284,7 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
-drop table if exists t1;
+drop table t1;
CREATE TABLE `t1` (
`post_id` mediumint(8) unsigned NOT NULL auto_increment,
`topic_id` mediumint(8) unsigned NOT NULL default '0',
@@ -318,3 +316,51 @@ CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
ALTER TABLE t1 ADD INDEX t1 (a, b, c);
Specified key was too long. Max key length is 500
DROP TABLE t1;
+CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
+INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
+create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
+INSERT into t2 values (1,1,1), (2,2,2);
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize 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 b 1 b A 5 NULL NULL YES BTREE
+t1 1 c 1 c A 5 NULL NULL YES BTREE
+t1 1 a 1 a A 1 NULL NULL BTREE
+t1 1 a 2 b A 5 NULL NULL YES BTREE
+t1 1 c_2 1 c A 5 NULL NULL YES BTREE
+t1 1 c_2 2 a A 5 NULL NULL BTREE
+explain select * from t1,t2 where t1.a=t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 5
+1 SIMPLE t2 ALL a NULL NULL NULL 2 Using where
+explain select * from t1,t2 force index(a) where t1.a=t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL a NULL NULL NULL 2
+1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
+explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL a NULL NULL NULL 2
+1 SIMPLE t1 ref a a 4 t2.a 3
+explain select * from t1,t2 where t1.b=t2.b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL b NULL NULL NULL 2
+1 SIMPLE t1 ref b b 5 t2.b 1 Using where
+explain select * from t1,t2 force index(c) where t1.a=t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 5
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
+explain select * from t1 where a=0 or a=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
+explain select * from t1 force index (a) where a=0 or a=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 4 NULL 4 Using where
+explain select * from t1 where c=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c,c_2 c 5 const 1 Using where
+explain select * from t1 use index() where c=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+drop table t1,t2;
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index cdea66cbf58..91af34b6681 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null;
NULL NULL isnull(null) isnull(1/0) isnull(1/0 = null) ifnull(null,1) ifnull(null,"TRUE") ifnull("TRUE","ERROR") 1/0 is null 1 is not null
NULL NULL 1 1 1 1 TRUE TRUE 1 1
@@ -34,7 +35,6 @@ NULL AND 0 0 and NULL
select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton("");
inet_ntoa(null) inet_aton(null) inet_aton("122.256") inet_aton("122.226.") inet_aton("")
NULL NULL NULL NULL NULL
-drop table if exists t1;
create table t1 (x int);
insert into t1 values (null);
select * from t1 where x != 0;
diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result
index 484437959a0..ce3af6c37cd 100644
--- a/mysql-test/r/null_key.result
+++ b/mysql-test/r/null_key.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1 (a int, b int not null,unique key (a,b),index(b)) type=myisam;
insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6);
explain select * from t1 where a is null;
@@ -136,7 +136,6 @@ select * from t1 where b like "6%";
a b c
6 6 0
drop table t1;
-DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
id int(10) unsigned NOT NULL auto_increment,
uniq_id int(10) unsigned default NULL,
diff --git a/mysql-test/r/odbc.result b/mysql-test/r/odbc.result
index 30366762cd0..c0b2ada0053 100644
--- a/mysql-test/r/odbc.result
+++ b/mysql-test/r/odbc.result
@@ -1,7 +1,7 @@
+drop table if exists t1;
select {fn length("hello")}, { date "1997-10-20" };
{fn length("hello")} 1997-10-20
5 1997-10-20
-drop table if exists t1;
create table t1 (a int not null auto_increment,b int not null,primary key (a,b));
insert into t1 SET A=NULL,B=1;
insert into t1 SET a=null,b=2;
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 52bd83df5ed..428d1052d19 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -1,6 +1,6 @@
-drop table if exists sales;
-create table sales ( product varchar(32), country varchar(32), year int, profit int);
-insert into sales values ( 'Computer', 'India',2000, 1200),
+drop table if exists t1;
+create table t1 ( product varchar(32), country varchar(32), year int, profit int);
+insert into t1 values ( 'Computer', 'India',2000, 1200),
( 'TV', 'United States', 1999, 150),
( 'Calculator', 'United States', 1999,50),
( 'Computer', 'United States', 1999,1500),
@@ -14,14 +14,14 @@ insert into sales values ( 'Computer', 'India',2000, 1200),
( 'Computer', 'India', 1999,1200),
( 'Computer', 'United States', 2000,1500),
( 'Calculator', 'United States', 2000,75);
-select product, country , year, sum(profit) from sales group by product, country, year with cube;
+select product, country , year, sum(profit) from t1 group by product, country, year with cube;
This version of MySQL doesn't yet support 'CUBE'
-explain select product, country , year, sum(profit) from sales group by product, country, year with cube;
+explain select product, country , year, sum(profit) from t1 group by product, country, year with cube;
This version of MySQL doesn't yet support 'CUBE'
-select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
This version of MySQL doesn't yet support 'ROLLUP'
-explain select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+explain select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
This version of MySQL doesn't yet support 'ROLLUP'
-select product, country , year, sum(profit) from sales group by product, country, year with cube union all select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+select product, country , year, sum(profit) from t1 group by product, country, year with cube union all select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
This version of MySQL doesn't yet support 'CUBE'
-drop table sales;
+drop table t1;
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 5645961a178..9bacae92945 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -222,7 +222,6 @@ DateOfAction TransactionID
1999-07-27 834
1999-07-27 840
drop table t1,t2,t3;
-drop table if exists t1;
CREATE TABLE t1 (
member_id int(11) NOT NULL auto_increment,
inschrijf_datum varchar(20) NOT NULL default '',
@@ -506,3 +505,37 @@ SELECT titre,t1.numeropost,auteur,icone,nbrep,'0',date,vue,ouvert,lastauteur,des
titre numeropost auteur icone nbrep 0 date vue ouvert lastauteur dest
test 1 joce 0 0 0 0000-00-00 00:00:00 0 1 bug
drop table t1,t2;
+CREATE TABLE t1 (
+FieldKey varchar(36) NOT NULL default '',
+LongVal bigint(20) default NULL,
+StringVal mediumtext,
+KEY FieldKey (FieldKey),
+KEY LongField (FieldKey,LongVal),
+KEY StringField (FieldKey,StringVal(32))
+);
+INSERT INTO t1 VALUES ('0',3,'0'),('0',2,'1'),('0',1,'2'),('1',2,'1'),('1',1,'3'), ('1',0,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('3',2,'1'),('3',1,'2'),('3','3','3');
+EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref FieldKey,LongField,StringField LongField 36 const 2 Using where
+SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
+FieldKey LongVal StringVal
+1 0 2
+1 1 3
+1 2 1
+EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range FieldKey,LongField,StringField FieldKey 36 NULL 4 Using where; Using filesort
+SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
+FieldKey LongVal StringVal
+3 1 2
+3 2 1
+3 3 3
+EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range FieldKey,LongField,StringField LongField 36 NULL 4 Using where
+SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
+FieldKey LongVal StringVal
+3 1 2
+3 2 1
+3 3 3
+DROP TABLE t1;
diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result
new file mode 100644
index 00000000000..e994e4d63da
--- /dev/null
+++ b/mysql-test/r/packet.result
@@ -0,0 +1,25 @@
+set global max_allowed_packet=100;
+set max_allowed_packet=100;
+set global net_buffer_length=100;
+set net_buffer_length=100;
+SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
+len
+1024
+select repeat('a',200);
+repeat('a',200)
+NULL
+select @@net_buffer_length, @@max_allowed_packet;
+@@net_buffer_length @@max_allowed_packet
+1024 80
+SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
+Got a packet bigger than 'max_allowed_packet'
+set global max_allowed_packet=default;
+set max_allowed_packet=default;
+set global net_buffer_length=default;
+set net_buffer_length=default;
+SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
+len
+100
+select length(repeat('a',200));
+length(repeat('a',200))
+200
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index a37313a150a..17c9c8edbd2 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -2,6 +2,7 @@ flush query cache;
flush query cache;
reset query cache;
flush status;
+drop database if exists mysqltest;
drop table if exists t1,t2,t3,t11,t21, mysqltest.t1;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
@@ -531,6 +532,7 @@ i
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
+update t1 set i=(select distinct 1 from (select * from t2) a);
drop table t1, t2, t3;
use mysql;
select * from db;
diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result
index b2bb659502a..e422fbe49c1 100644
--- a/mysql-test/r/rename.result
+++ b/mysql-test/r/rename.result
@@ -37,3 +37,5 @@ select * from t3;
3 table 3
3 table 3
drop table if exists t1,t2,t3,t4;
+Warnings:
+Note 1051 Unknown table 't4'
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 1d606fc370c..f3522e05380 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
select row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3));
row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3))
1
@@ -88,7 +89,6 @@ ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL))
NULL
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4);
Cardinality error (more/less than 2 columns)
-drop table if exists t1;
create table t1 ( a int, b int, c int);
insert into t1 values (1,2,3), (2,3,1), (3,2,1), (1,2,NULL);
select * from t1 where ROW(1,2,3)=ROW(a,b,c);
@@ -127,7 +127,6 @@ ROW(1,2,3) IN(row(a,b,c), row(1,2,3))
drop table t1;
select ROW(1,1);
Cardinality error (more/less than 1 columns)
-drop table if exists t1;
create table t1 (i int);
select 1 from t1 where ROW(1,1);
Cardinality error (more/less than 1 columns)
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index 5cee2e6deff..dd569944f0e 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1,t2,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
diff --git a/mysql-test/r/rpl000002.result b/mysql-test/r/rpl000002.result
index 819f43da103..56e34b4874f 100644
--- a/mysql-test/r/rpl000002.result
+++ b/mysql-test/r/rpl000002.result
@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1;
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
@@ -18,7 +17,6 @@ Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 9999 2 1
drop table t1;
stop slave;
-drop table if exists t2;
create table t2(id int auto_increment primary key, created datetime);
set timestamp=12345;
insert into t2 set created=now();
diff --git a/mysql-test/r/rpl000003.result b/mysql-test/r/rpl000003.result
deleted file mode 100644
index 7c63ada9cdf..00000000000
--- a/mysql-test/r/rpl000003.result
+++ /dev/null
@@ -1,17 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-drop table if exists t1;
-create table t1(n int primary key);
-insert into t1 values (1),(2),(2);
-Duplicate entry '2' for key 1
-insert into t1 values (3);
-select * from t1;
-n
-1
-2
-3
-drop table t1;
diff --git a/mysql-test/r/rpl000004.result b/mysql-test/r/rpl000004.result
index a677eac36d4..067696345e4 100644
--- a/mysql-test/r/rpl000004.result
+++ b/mysql-test/r/rpl000004.result
@@ -5,18 +5,13 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set SQL_LOG_BIN=0;
-drop table if exists t1;
create table t1 (word char(20) not null, index(word));
load data infile '../../std_data/words.dat' into table t1;
-drop table if exists t2;
create table t2 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key);
-drop table if exists t1;
load table t1 from master;
-drop table if exists t2;
load table t2 from master;
-drop table if exists t3;
load table t3 from master;
check table t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/r/rpl000005.result b/mysql-test/r/rpl000005.result
index 228bb00a1a3..0202e43dcb2 100644
--- a/mysql-test/r/rpl000005.result
+++ b/mysql-test/r/rpl000005.result
@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1;
CREATE TABLE t1 (name varchar(64), age smallint(3));
INSERT INTO t1 SET name='Andy', age=31;
INSERT t1 SET name='Jacob', age=2;
diff --git a/mysql-test/r/rpl000006.result b/mysql-test/r/rpl000006.result
index e256e0f0136..7209ec3c3d1 100644
--- a/mysql-test/r/rpl000006.result
+++ b/mysql-test/r/rpl000006.result
@@ -5,13 +5,11 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set SQL_LOG_BIN=0,timestamp=200006;
-drop table if exists t1;
create table t1(t timestamp not null,a char(1));
insert into t1 ( a) values ('F');
select unix_timestamp(t) from t1;
unix_timestamp(t)
200006
-drop table if exists t1;
load table t1 from master;
select unix_timestamp(t) from t1;
unix_timestamp(t)
diff --git a/mysql-test/r/rpl000008.result b/mysql-test/r/rpl000008.result
index eb0089da9d6..a88a3c690ed 100644
--- a/mysql-test/r/rpl000008.result
+++ b/mysql-test/r/rpl000008.result
@@ -5,21 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
use test;
-drop table if exists foo;
-create table foo (n int);
-insert into foo values(4);
+drop table if exists mysqltest_foo;
+drop table if exists mysqltest_bar;
+create table mysqltest_foo (n int);
+insert into mysqltest_foo values(4);
use test;
-drop table if exists foo;
-create table foo (n int);
-insert into foo values(5);
-drop table if exists bar;
-create table bar (m int);
-insert into bar values(15);
-drop table if exists choo;
-create table choo (k int);
-insert into choo values(55);
-select foo.n,bar.m,choo.k from foo,bar,choo;
+create table mysqltest_foo (n int);
+insert into mysqltest_foo values(5);
+create table mysqltest_bar (m int);
+insert into mysqltest_bar values(15);
+create table t1 (k int);
+insert into t1 values(55);
+select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1;
n m k
4 15 55
-drop table if exists foo,bar,choo;
-drop table if exists foo,bar,choo;
+drop table mysqltest_foo,mysqltest_bar,t1;
+drop table mysqltest_foo,mysqltest_bar,t1;
diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result
index 1a1ea309ae9..e67993b53f6 100644
--- a/mysql-test/r/rpl000009.result
+++ b/mysql-test/r/rpl000009.result
@@ -4,80 +4,78 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop database if exists foo;
-create database foo;
-drop database if exists bar;
-create database bar;
-drop table if exists foo.foo;
-create table foo.foo (n int);
-insert into foo.foo values(4);
-drop table if exists foo.foo;
-create table foo.foo (n int);
-insert into foo.foo values(5);
-drop table if exists bar.bar;
-create table bar.bar (m int);
-insert into bar.bar values(15);
-select foo.foo.n,bar.bar.m from foo.foo,bar.bar;
+drop database if exists mysqltest2;
+create database mysqltest2;
+drop database if exists mysqltest;
+create database mysqltest;
+create table mysqltest2.foo (n int);
+insert into mysqltest2.foo values(4);
+create table mysqltest2.foo (n int);
+insert into mysqltest2.foo values(5);
+create table mysqltest.bar (m int);
+insert into mysqltest.bar values(15);
+select mysqltest2.foo.n,mysqltest.bar.m from mysqltest2.foo,mysqltest.bar;
n m
4 15
-drop database if exists bar;
-drop database if exists foo;
-drop database if exists bar;
-drop database if exists foo;
+drop database mysqltest;
+drop database mysqltest2;
set sql_log_bin = 0;
-create database foo;
-create database bar;
+create database mysqltest2;
+create database mysqltest;
show databases;
Database
-bar
-foo
mysql
+mysqltest
+mysqltest2
test
-create table foo.t1(n int, s char(20));
-create table foo.t2(n int, s text);
-insert into foo.t1 values (1, 'one'), (2, 'two'), (3, 'three');
-insert into foo.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen');
-create table bar.t1(n int, s char(20));
-create table bar.t2(n int, s text);
-insert into bar.t1 values (1, 'one bar'), (2, 'two bar'), (3, 'three bar');
-insert into bar.t2 values (11, 'eleven bar'), (12, 'twelve bar'),
-(13, 'thirteen bar');
+create table mysqltest2.t1(n int, s char(20));
+create table mysqltest2.t2(n int, s text);
+insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three');
+insert into mysqltest2.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen');
+create table mysqltest.t1(n int, s char(20));
+create table mysqltest.t2(n int, s text);
+insert into mysqltest.t1 values (1, 'one test'), (2, 'two test'), (3, 'three test');
+insert into mysqltest.t2 values (11, 'eleven test'), (12, 'twelve test'),
+(13, 'thirteen test');
set sql_log_bin = 1;
show databases;
Database
mysql
test
load data from master;
+Warnings:
+Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
+Note 1008 Can't drop database 'mysqltest2'. Database doesn't exist
show databases;
Database
-bar
-foo
mysql
+mysqltest
+mysqltest2
test
-use foo;
+use mysqltest2;
show tables;
-Tables_in_foo
-use bar;
+Tables_in_mysqltest2
+use mysqltest;
show tables;
-Tables_in_bar
+Tables_in_mysqltest
t1
t2
-select * from bar.t1;
+select * from mysqltest.t1;
n s
-1 one bar
-2 two bar
-3 three bar
-select * from bar.t2;
+1 one test
+2 two test
+3 three test
+select * from mysqltest.t2;
n s
-11 eleven bar
-12 twelve bar
-13 thirteen bar
-insert into bar.t1 values (4, 'four bar');
-select * from bar.t1;
+11 eleven test
+12 twelve test
+13 thirteen test
+insert into mysqltest.t1 values (4, 'four test');
+select * from mysqltest.t1;
n s
-1 one bar
-2 two bar
-3 three bar
-4 four bar
-drop database bar;
-drop database foo;
+1 one test
+2 two test
+3 three test
+4 four test
+drop database mysqltest;
+drop database mysqltest2;
diff --git a/mysql-test/r/rpl000010.result b/mysql-test/r/rpl000010.result
index 6b6b89d1547..65191ea411f 100644
--- a/mysql-test/r/rpl000010.result
+++ b/mysql-test/r/rpl000010.result
@@ -4,8 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1;
-drop table if exists t1;
create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL);
insert into t1 values(2);
diff --git a/mysql-test/r/rpl000011.result b/mysql-test/r/rpl000011.result
index bb017076822..dd0fa2fbe74 100644
--- a/mysql-test/r/rpl000011.result
+++ b/mysql-test/r/rpl000011.result
@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1;
create table t1 (n int);
insert into t1 values(1);
stop slave;
diff --git a/mysql-test/r/rpl000012.result b/mysql-test/r/rpl000012.result
index f809fa7fe74..17fb53010ab 100644
--- a/mysql-test/r/rpl000012.result
+++ b/mysql-test/r/rpl000012.result
@@ -4,18 +4,16 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1,t2,t3;
create table t2 (n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
insert into t2 select * from t1;
-drop table if exists test.t3;
-create temporary table test.t3 (n int not null);
-alter table test.t3 add primary key(n);
+create temporary table t3 (n int not null);
+alter table t3 add primary key(n);
flush logs;
insert into t3 values (100);
insert into t2 select * from t3;
-drop table if exists test.t3;
+drop table if exists t3;
insert into t2 values (101);
create temporary table t1 (n int);
insert into t1 values (4),(5);
@@ -35,3 +33,5 @@ show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
drop table if exists t1,t2;
+Warnings:
+Note 1051 Unknown table 't1'
diff --git a/mysql-test/r/rpl000013.result b/mysql-test/r/rpl000013.result
index 333d769baff..37838bb88e0 100644
--- a/mysql-test/r/rpl000013.result
+++ b/mysql-test/r/rpl000013.result
@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t2;
create table t2(n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
@@ -25,3 +24,5 @@ show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
drop table if exists t1,t2;
+Warnings:
+Note 1051 Unknown table 't1'
diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/r/rpl_alter.result
index 0b947c0bb70..e7abc3b3b48 100644
--- a/mysql-test/r/rpl_alter.result
+++ b/mysql-test/r/rpl_alter.result
@@ -4,18 +4,18 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop database if exists d1;
-create database d1;
-create table d1.t1 ( n int);
-alter table d1.t1 add m int;
-insert into d1.t1 values (1,2);
-create table d1.t2 (n int);
-insert into d1.t2 values (45);
-rename table d1.t2 to d1.t3, d1.t1 to d1.t2;
-select * from d1.t2;
+drop database if exists test_$1;
+create database test_$1;
+create table test_$1.t1 ( n int);
+alter table test_$1.t1 add m int;
+insert into test_$1.t1 values (1,2);
+create table test_$1.t2 (n int);
+insert into test_$1.t2 values (45);
+rename table test_$1.t2 to test_$1.t3, test_$1.t1 to test_$1.t2;
+select * from test_$1.t2;
n m
1 2
-select * from d1.t3;
+select * from test_$1.t3;
n
45
-drop database d1;
+drop database test_$1;
diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/r/rpl_empty_master_crash.result
index 267806feb2e..8818029ab99 100644
--- a/mysql-test/r/rpl_empty_master_crash.result
+++ b/mysql-test/r/rpl_empty_master_crash.result
@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
load table t1 from master;
diff --git a/mysql-test/r/rpl_failsafe.result b/mysql-test/r/rpl_failsafe.result
index d122b13adc2..956555f9318 100644
--- a/mysql-test/r/rpl_failsafe.result
+++ b/mysql-test/r/rpl_failsafe.result
@@ -1,4 +1,5 @@
stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result
index b4dc132e046..fa38e42ae73 100644
--- a/mysql-test/r/rpl_log_pos.result
+++ b/mysql-test/r/rpl_log_pos.result
@@ -10,7 +10,9 @@ master-bin.000001 79
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 127
+stop slave;
change master to master_log_pos=73;
+start slave;
stop slave;
change master to master_log_pos=73;
show slave status;
@@ -20,6 +22,7 @@ start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 slave-relay-bin.000001 4 master-bin.000001 No Yes 0 0 73 4
+stop slave;
change master to master_log_pos=173;
start slave;
show slave status;
@@ -32,6 +35,7 @@ create table if not exists t1 (n int);
drop table if exists t1;
create table t1 (n int);
insert into t1 values (1),(2),(3);
+stop slave;
change master to master_log_pos=79;
start slave;
select * from t1;
diff --git a/mysql-test/r/rpl_redirect.result b/mysql-test/r/rpl_redirect.result
index 66c94a00b5f..3807479fb54 100644
--- a/mysql-test/r/rpl_redirect.result
+++ b/mysql-test/r/rpl_redirect.result
@@ -9,7 +9,6 @@ Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Lo
SHOW SLAVE HOSTS;
Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 SLAVE_PORT 2 1
-drop table if exists t1;
create table t1 ( n int);
insert into t1 values (1),(2),(3),(4);
insert into t1 values(5);
diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result
index aabda54640c..9ae292c2709 100644
--- a/mysql-test/r/rpl_replicate_do.result
+++ b/mysql-test/r/rpl_replicate_do.result
@@ -25,4 +25,4 @@ n
4
select * from t11;
Table 'test.t11' doesn't exist
-drop table if exists t1,t2,t3,t11;
+drop table if exists t1,t2,t11;
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
index 2582b875daa..5275ef26b5c 100644
--- a/mysql-test/r/rpl_rotate_logs.result
+++ b/mysql-test/r/rpl_rotate_logs.result
@@ -22,7 +22,6 @@ s
Could not break slave
Tried hard
flush logs;
-drop table if exists t2;
create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123);
flush logs;
@@ -58,7 +57,6 @@ m
1234
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2");
-drop table if exists t3;
create table t3 (n int);
create table t4 select * from temp_table;
show binary logs;
diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/r/rpl_skip_error.result
index 91aae09001f..e52426c381c 100644
--- a/mysql-test/r/rpl_skip_error.result
+++ b/mysql-test/r/rpl_skip_error.result
@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-drop table if exists t1;
create table t1 (n int not null primary key);
insert into t1 values (1);
insert into t1 values (1);
diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result
new file mode 100644
index 00000000000..470a6302a2b
--- /dev/null
+++ b/mysql-test/r/rpl_temporary.result
@@ -0,0 +1,73 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+drop table if exists t1,t2;
+create table t1(f int);
+create table t2(f int);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+create temporary table t3(f int);
+insert into t3 select * from t1 where f<6;
+create temporary table t3(f int);
+insert into t2 select count(*) from t3;
+insert into t3 select * from t1 where f>=4;
+drop temporary table t3;
+insert into t2 select count(*) from t3;
+drop temporary table t3;
+select * from t2;
+f
+5
+7
+show binlog events;
+Log_name Pos Event_type Server_id Orig_log_pos Info
+master-bin.000001 4 Start 1 4 Server ver: 4.1.0-alpha-debug-log, Binlog ver: 3
+master-bin.000001 79 Query 1 79 use `test`; create table t1(f int)
+master-bin.000001 136 Query 1 136 use `test`; create table t2(f int)
+master-bin.000001 193 Query 1 193 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
+master-bin.000001 290 Query 1 290 use `test`; create temporary table t3(f int)
+master-bin.000001 357 Query 1 357 use `test`; insert into t3 select * from t1 where f<6
+master-bin.000001 433 Query 1 433 use `test`; create temporary table t3(f int)
+master-bin.000001 500 Query 1 500 use `test`; insert into t2 select count(*) from t3
+master-bin.000001 573 Query 1 573 use `test`; insert into t3 select * from t1 where f>=4
+master-bin.000001 650 Query 1 650 use `test`; drop temporary table t3
+master-bin.000001 708 Query 1 708 use `test`; insert into t2 select count(*) from t3
+master-bin.000001 781 Query 1 781 use `test`; drop temporary table t3
+drop table t1, t2;
+use test;
+SET TIMESTAMP=1040323920;
+create table t1(f int);
+SET TIMESTAMP=1040323931;
+create table t2(f int);
+SET TIMESTAMP=1040323938;
+insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SET TIMESTAMP=1040323945;
+SET @@session.pseudo_thread_id=1;
+create temporary table t3(f int);
+SET TIMESTAMP=1040323952;
+SET @@session.pseudo_thread_id=1;
+insert into t3 select * from t1 where f<6;
+SET TIMESTAMP=1040324145;
+SET @@session.pseudo_thread_id=2;
+create temporary table t3(f int);
+SET TIMESTAMP=1040324186;
+SET @@session.pseudo_thread_id=1;
+insert into t2 select count(*) from t3;
+SET TIMESTAMP=1040324200;
+SET @@session.pseudo_thread_id=2;
+insert into t3 select * from t1 where f>=4;
+SET TIMESTAMP=1040324211;
+SET @@session.pseudo_thread_id=1;
+drop temporary table t3;
+SET TIMESTAMP=1040324219;
+SET @@session.pseudo_thread_id=2;
+insert into t2 select count(*) from t3;
+SET TIMESTAMP=1040324224;
+SET @@session.pseudo_thread_id=2;
+drop temporary table t3;
+select * from t2;
+f
+5
+7
+drop table t1,t2;
diff --git a/mysql-test/r/sel000001.result b/mysql-test/r/sel000001.result
deleted file mode 100644
index 28f6d3d1d5a..00000000000
--- a/mysql-test/r/sel000001.result
+++ /dev/null
@@ -1,7 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (s CHAR(20) PRIMARY KEY, id INT);
-INSERT INTO t1 VALUES ('cat', 1), ('mouse', 3), ('dog', 2), ('snake', 77);
-SELECT s, id FROM t1 WHERE s = 'mouse';
-s id
-mouse 3
-drop table t1;
diff --git a/mysql-test/r/sel000002.result b/mysql-test/r/sel000002.result
deleted file mode 100644
index b824de8de4a..00000000000
--- a/mysql-test/r/sel000002.result
+++ /dev/null
@@ -1,9 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (n INT);
-INSERT INTO t1 VALUES (1), (2), (3);
-SELECT * FROM t1;
-n
-1
-2
-3
-drop table t1;
diff --git a/mysql-test/r/sel000003.result b/mysql-test/r/sel000003.result
deleted file mode 100644
index c3853832f87..00000000000
--- a/mysql-test/r/sel000003.result
+++ /dev/null
@@ -1,8 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (name CHAR(20) NOT NULL PRIMARY KEY, score SMALLINT NOT NULL, KEY(score));
-INSERT INTO t1 VALUES ('Sasha', 20), ('Matt', 20), ('Monty', 10), ('David', 10), ('Tim', 10), ('Jeremy', 10);
-SELECT COUNT(*) as n, score FROM t1 GROUP BY score;
-n score
-4 10
-2 20
-drop table t1;
diff --git a/mysql-test/r/sel000031.result b/mysql-test/r/sel000031.result
deleted file mode 100644
index d3f01ab687f..00000000000
--- a/mysql-test/r/sel000031.result
+++ /dev/null
@@ -1,12 +0,0 @@
-drop table if exists t1,t2;
-create table t1 (id int(10) not null unique);
-create table t2 (id int(10) not null primary key,
-val int(10) not null);
-insert into t1 values (1),(2),(4);
-insert into t2 values (1,1),(2,1),(3,1),(4,2);
-select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
-id elt(two.val,'one','two')
-1 one
-2 one
-4 two
-drop table t1,t2;
diff --git a/mysql-test/r/sel000032.result b/mysql-test/r/sel000032.result
deleted file mode 100644
index 4cca245d75b..00000000000
--- a/mysql-test/r/sel000032.result
+++ /dev/null
@@ -1,12 +0,0 @@
-drop table if exists t1,t2;
-create table t1 (id int(10) not null unique);
-create table t2 (id int(10) not null primary key,
-val int(10) not null);
-insert into t1 values (1),(2),(4);
-insert into t2 values (1,1),(2,1),(3,1),(4,2);
-select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
-id elt(two.val,'one','two')
-1 one
-2 one
-4 two
-drop table t1,t2;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 80aa6046e8d..9ed54f7c253 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -1,4 +1,3 @@
-use test;
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
@@ -2493,7 +2492,6 @@ fld1 fld3 period price price2
018601 vacuuming 1001 5987435 234724
018801 inch 1001 5987435 234724
018811 repetitions 1001 5987435 234724
-drop table if exists company;
create table t4 (
companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
@@ -3219,23 +3217,23 @@ Tables_in_test (s%)
show tables from test like "t?";
Tables_in_test (t?)
show full columns from t2;
-Field Type Null Key Default Extra Privileges Comment
-auto int(11) PRI NULL auto_increment select,insert,update,references
-fld1 int(6) unsigned zerofill UNI 000000 select,insert,update,references
-companynr tinyint(2) unsigned zerofill 00 select,insert,update,references
-fld3 char(30) character set latin1 MUL select,insert,update,references
-fld4 char(35) character set latin1 select,insert,update,references
-fld5 char(35) character set latin1 select,insert,update,references
-fld6 char(4) character set latin1 select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(11) binary PRI NULL auto_increment select,insert,update,references
+fld1 int(6) unsigned zerofill binary UNI 000000 select,insert,update,references
+companynr tinyint(2) unsigned zerofill binary 00 select,insert,update,references
+fld3 char(30) latin1 MUL select,insert,update,references
+fld4 char(35) latin1 select,insert,update,references
+fld5 char(35) latin1 select,insert,update,references
+fld6 char(4) latin1 select,insert,update,references
show full columns from t2 from test like 'f%';
-Field Type Null Key Default Extra Privileges Comment
-fld1 int(6) unsigned zerofill UNI 000000 select,insert,update,references
-fld3 char(30) character set latin1 MUL select,insert,update,references
-fld4 char(35) character set latin1 select,insert,update,references
-fld5 char(35) character set latin1 select,insert,update,references
-fld6 char(4) character set latin1 select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+fld1 int(6) unsigned zerofill binary UNI 000000 select,insert,update,references
+fld3 char(30) latin1 MUL select,insert,update,references
+fld4 char(35) latin1 select,insert,update,references
+fld5 char(35) latin1 select,insert,update,references
+fld6 char(4) latin1 select,insert,update,references
show full columns from t2 from test like 's%';
-Field Type Null Key Default Extra Privileges Comment
+Field Type Collation Null Key Default Extra Privileges Comment
show keys from t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
@@ -3478,7 +3476,6 @@ a a a
2 2 2
3 3 3
drop table t1;
-drop table if exists t1,t2;
CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) TYPE=MyISAM;
INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522);
CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM;
@@ -3490,4 +3487,4 @@ aa id t2_id id
4 8302 2519 2519
5 8303 2520 2520
6 8304 2521 2521
-drop table if exists t1,t2;
+drop table t1,t2;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 2e8d7d19465..d2bdc4f9401 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -93,15 +93,15 @@ c int not null comment 'int column'
show create table t1 ;
Table Create Table
t1 CREATE TABLE `t1` (
- `test_set` set('val1','val2','val3') character set latin1 NOT NULL default '',
- `name` char(20) character set latin1 default 'O''Brien' COMMENT 'O''Brien as default',
+ `test_set` set('val1','val2','val3') NOT NULL default '',
+ `name` char(20) default 'O''Brien' COMMENT 'O''Brien as default',
`c` int(11) NOT NULL default '0' COMMENT 'int column'
) TYPE=MyISAM CHARSET=latin1 COMMENT='it''s a table'
show full columns from t1;
-Field Type Null Key Default Extra Privileges Comment
-test_set set('val1','val2','val3') character set latin1 select,insert,update,references
-name char(20) character set latin1 YES O'Brien select,insert,update,references O'Brien as default
-c int(11) 0 select,insert,update,references int column
+Field Type Collation Null Key Default Extra Privileges Comment
+test_set set('val1','val2','val3') latin1 select,insert,update,references
+name char(20) latin1 YES O'Brien select,insert,update,references O'Brien as default
+c int(11) binary 0 select,insert,update,references int column
drop table t1;
create table t1 (a int not null, unique aa (a));
show create table t1;
@@ -133,7 +133,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
- `b` char(10) character set latin1 default NULL,
+ `b` char(10) default NULL,
KEY `b` (`b`)
) TYPE=MyISAM CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0;
@@ -141,7 +141,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
- `b` varchar(10) character set latin1 default NULL,
+ `b` varchar(10) default NULL,
KEY `b` (`b`)
) TYPE=MyISAM CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test'
ALTER TABLE t1 AVG_ROW_LENGTH=0 CHECKSUM=0 COMMENT="" MIN_ROWS=0 MAX_ROWS=0 PACK_KEYS=DEFAULT DELAY_KEY_WRITE=0 ROW_FORMAT=default;
@@ -149,40 +149,40 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
- `b` varchar(10) character set latin1 default NULL,
+ `b` varchar(10) default NULL,
KEY `b` (`b`)
) TYPE=MyISAM CHARSET=latin1
drop table t1;
create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0));
show columns from t1;
-Field Type Null Key Default Extra
-a decimal(9,2) YES NULL
-b decimal(9,0) YES NULL
-e double(9,2) YES NULL
-f double(5,0) YES NULL
-h float(3,2) YES NULL
-i float(3,0) YES NULL
+Field Type Collation Null Key Default Extra
+a decimal(9,2) binary YES NULL
+b decimal(9,0) binary YES NULL
+e double(9,2) binary YES NULL
+f double(5,0) binary YES NULL
+h float(3,2) binary YES NULL
+i float(3,0) binary YES NULL
show full columns from t1;
-Field Type Null Key Default Extra Privileges Comment
-a decimal(9,2) YES NULL select,insert,update,references
-b decimal(9,0) YES NULL select,insert,update,references
-e double(9,2) YES NULL select,insert,update,references
-f double(5,0) YES NULL select,insert,update,references
-h float(3,2) YES NULL select,insert,update,references
-i float(3,0) YES NULL select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+a decimal(9,2) binary YES NULL select,insert,update,references
+b decimal(9,0) binary YES NULL select,insert,update,references
+e double(9,2) binary YES NULL select,insert,update,references
+f double(5,0) binary YES NULL select,insert,update,references
+h float(3,2) binary YES NULL select,insert,update,references
+i float(3,0) binary YES NULL select,insert,update,references
drop table t1;
create table t1 (c decimal, d double, f float, r real);
show columns from t1;
-Field Type Null Key Default Extra
-c decimal(10,0) YES NULL
-d double YES NULL
-f float YES NULL
-r double YES NULL
+Field Type Collation Null Key Default Extra
+c decimal(10,0) binary YES NULL
+d double binary YES NULL
+f float binary YES NULL
+r double binary YES NULL
drop table t1;
create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
show columns from t1;
-Field Type Null Key Default Extra
-c decimal(4,3) YES NULL
-d double(4,3) YES NULL
-f float(4,3) YES NULL
+Field Type Collation Null Key Default Extra
+c decimal(4,3) binary YES NULL
+d double(4,3) binary YES NULL
+f float(4,3) binary YES NULL
drop table t1;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 493768ece4a..04bf0575db3 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -1,13 +1,33 @@
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
select (select 2);
(select 2)
2
+explain select (select 2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1247 Select 2 was reduced during optimisation
SELECT (SELECT 1) UNION SELECT (SELECT 2);
(SELECT 1)
1
2
+explain SELECT (SELECT 1) UNION SELECT (SELECT 2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1247 Select 2 was reduced during optimisation
+Note 1247 Select 4 was reduced during optimisation
SELECT (SELECT (SELECT 0 UNION SELECT 0));
(SELECT (SELECT 0 UNION SELECT 0))
0
+explain SELECT (SELECT (SELECT 0 UNION SELECT 0));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 SUBSELECT NULL NULL NULL NULL NULL NULL NULL No tables used
+4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1247 Select 2 was reduced during optimisation
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
Reference 'a' not supported (forward reference in item list)
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b;
@@ -32,7 +52,7 @@ a
1
SELECT 1 FROM (SELECT (SELECT a) b) c;
Unknown column 'a' in 'field list'
-SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id LIMIT 1);
+SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id);
id
1
SELECT * FROM (SELECT 1) a WHERE 1 IN (SELECT 1,1);
@@ -52,7 +72,54 @@ a
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
a
1
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
+SELECT (SELECT 1,2,3) = ROW(1,2,3);
+(SELECT 1,2,3) = ROW(1,2,3)
+1
+SELECT (SELECT 1,2,3) = ROW(1,2,1);
+(SELECT 1,2,3) = ROW(1,2,1)
+0
+SELECT (SELECT 1,2,3) < ROW(1,2,1);
+(SELECT 1,2,3) < ROW(1,2,1)
+0
+SELECT (SELECT 1,2,3) > ROW(1,2,1);
+(SELECT 1,2,3) > ROW(1,2,1)
+1
+SELECT (SELECT 1,2,3) = ROW(1,2,NULL);
+(SELECT 1,2,3) = ROW(1,2,NULL)
+NULL
+SELECT ROW(1,2,3) = (SELECT 1,2,3);
+ROW(1,2,3) = (SELECT 1,2,3)
+1
+SELECT ROW(1,2,3) = (SELECT 1,2,1);
+ROW(1,2,3) = (SELECT 1,2,1)
+0
+SELECT ROW(1,2,3) < (SELECT 1,2,1);
+ROW(1,2,3) < (SELECT 1,2,1)
+0
+SELECT ROW(1,2,3) > (SELECT 1,2,1);
+ROW(1,2,3) > (SELECT 1,2,1)
+1
+SELECT ROW(1,2,3) = (SELECT 1,2,NULL);
+ROW(1,2,3) = (SELECT 1,2,NULL)
+NULL
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a');
+(SELECT 1.5,2,'a') = ROW(1.5,2,'a')
+1
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b');
+(SELECT 1.5,2,'a') = ROW(1.5,2,'b')
+0
+SELECT (SELECT 1.5,2,'a') = ROW('b',2,'b');
+(SELECT 1.5,2,'a') = ROW('b',2,'b')
+0
+SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
+(SELECT 'b',2,'a') = ROW(1.5,2,'a')
+0
+SELECT (SELECT 1.5,2,'a') = ROW(1.5,'c','a');
+(SELECT 1.5,2,'a') = ROW(1.5,'c','a')
+0
+SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
+(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
+0
create table t1 (a int);
create table t2 (a int, b int);
create table t3 (a int);
@@ -86,20 +153,20 @@ select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1);
a b
1 7
2 7
-select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)
+(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1))
union (select * from t4 order by a limit 2) limit 3;
a b
1 7
2 7
3 8
-select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)
+(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1))
union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a);
a b
1 7
2 7
3 8
4 8
-explain select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)
+explain (select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1))
union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
@@ -243,7 +310,6 @@ W 1
SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3);
a b
W a
-drop table if exists t8;
CREATE TABLE `t8` (
`pseudo` varchar(35) character set latin1 NOT NULL default '',
`email` varchar(60) character set latin1 NOT NULL default '',
@@ -453,7 +519,6 @@ a b
0 10
1 11
drop table t1, t2;
-drop table if exists t11, t12, t2;
create table t11 (a int NOT NULL, b int, primary key (a));
create table t12 (a int NOT NULL, b int, primary key (a));
create table t2 (a int NOT NULL, b int, primary key (a));
@@ -559,7 +624,6 @@ x y
drop table t1, t2, t3;
SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *);
No tables used
-drop table if exists t;
CREATE TABLE t (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1;
INSERT INTO t VALUES (1),(2);
SELECT * FROM t WHERE id IN (SELECT 1);
@@ -581,12 +645,13 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ref id id 5 const 1 Using where; Using index
3 SUBSELECT NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
+Note 1247 Select 3 was reduced during optimisation
Note 1247 Select 2 was reduced during optimisation
EXPLAIN SELECT * FROM t WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t index NULL id 5 NULL 2 Using where; Using index
2 DEPENDENT SUBSELECT NULL NULL NULL NULL NULL NULL NULL No tables used
-3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
SELECT * FROM t WHERE id IN (SELECT 5 UNION SELECT 3);
id
SELECT * FROM t WHERE id IN (SELECT 5 UNION SELECT 2);
@@ -602,7 +667,7 @@ CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin
INSERT INTO t1 values (1),(1);
UPDATE t SET id=(SELECT * FROM t1);
Subselect returns more than 1 record
-drop table t;
+drop table t, t1;
create table t (a int);
insert into t values (1),(2),(3);
select 1 IN (SELECT * from t);
@@ -704,4 +769,88 @@ NULL
select 10.5 > ANY (SELECT * from t);
10.5 > ANY (SELECT * from t)
1
+explain select (select a+1) from t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1247 Select 2 was reduced during optimisation
+select (select a+1) from t;
+(select a+1)
+2.5
+NULL
+4.5
+drop table t;
+create table t (a float);
+select 10.5 IN (SELECT * from t LIMIT 1);
+This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
+select 10.5 IN (SELECT * from t LIMIT 1 UNION SELECT 1.5);
+This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t;
+create table t1 (a int, b int, c varchar(10));
+create table t2 (a int);
+insert into t1 values (1,2,'a'),(2,3,'b'),(3,4,'c');
+insert into t2 values (1),(2),(NULL);
+select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t1 where a=t2.a) from t2;
+a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a)
+1 1 a
+2 0 b
+NULL NULL NULL
+select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
+a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a)
+1 0 a
+2 1 b
+NULL NULL NULL
+select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t1 where a=t2.a) from t2;
+a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a)
+1 0 a
+2 0 b
+NULL NULL NULL
+drop table t1,t2;
+create table t1 (a int, b real, c varchar(10));
+insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
+select ROW(1, 1, 'a') IN (select a,b,c from t1);
+ROW(1, 1, 'a') IN (select a,b,c from t1)
+1
+select ROW(1, 2, 'a') IN (select a,b,c from t1);
+ROW(1, 2, 'a') IN (select a,b,c from t1)
+NULL
+select ROW(1, 1, 'a') IN (select b,a,c from t1);
+ROW(1, 1, 'a') IN (select b,a,c from t1)
+1
+select ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null);
+ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null)
+1
+select ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null);
+ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null)
+0
+select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null);
+ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null)
+1
+select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a');
+ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a')
+1
+select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a');
+ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a')
+NULL
+select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
+ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a')
+1
+select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2);
+This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1);
+do @a:=(SELECT a from t1);
+select @a;
+@a
+1
+set @a:=2;
+set @a:=(SELECT a from t1);
+select @a;
+@a
+1
+drop table t1;
+do (SELECT a from t1);
+Table 'test.t1' doesn't exist
+set @a:=(SELECT a from t1);
+Table 'test.t1' doesn't exist
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index 7c8d10cf0a6..5568e5b25d8 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -48,7 +48,6 @@ c d e
3 b 2
drop table t1;
drop table t1;
-drop table if exists t1;
CREATE TABLE t1 (pkCrash INTEGER PRIMARY KEY,strCrash VARCHAR(255));
INSERT INTO t1 ( pkCrash, strCrash ) VALUES ( 1, '1');
SELECT CONCAT_WS(pkCrash, strCrash) FROM t1;
@@ -77,7 +76,6 @@ insert into t1 values (1),(1);
alter table t1 add primary key (a);
Duplicate entry '1' for key 1
drop table t1;
-drop table if exists t1;
CREATE TABLE t1 (
d datetime default NULL
) TYPE=MyISAM;
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index ba8d4f770f6..ba8e01d6319 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -1,27 +1,27 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7;
CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000));
show columns from t1;
-Field Type Null Key Default Extra
-a blob YES NULL
-b text character set latin1 YES NULL
-c blob YES NULL
-d mediumtext character set latin1 YES NULL
-e longtext character set latin1 YES NULL
+Field Type Collation Null Key Default Extra
+a blob binary YES NULL
+b text latin1 YES NULL
+c blob binary YES NULL
+d mediumtext latin1 YES NULL
+e longtext latin1 YES NULL
CREATE TABLE t2 (a char(257), b varchar(70000) binary, c varchar(70000000));
Warnings:
Warning 1244 Converting column 'a' from CHAR to TEXT
Warning 1244 Converting column 'b' from CHAR to BLOB
Warning 1244 Converting column 'c' from CHAR to TEXT
show columns from t2;
-Field Type Null Key Default Extra
-a text character set latin1 YES NULL
-b mediumblob YES NULL
-c longtext character set latin1 YES NULL
+Field Type Collation Null Key Default Extra
+a text latin1 YES NULL
+b mediumblob binary YES NULL
+c longtext latin1 YES NULL
create table t3 (a long, b long byte);
show create TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
- `a` mediumtext character set latin1,
+ `a` mediumtext,
`b` mediumblob
) TYPE=MyISAM CHARSET=latin1
drop table t1,t2,t3
@@ -69,18 +69,18 @@ insert into t1 values (NULL,NULL,NULL,NULL);
update t1 set c="",b=null where c="1";
lock tables t1 READ;
show full fields from t1;
-Field Type Null Key Default Extra Privileges Comment
-t text character set latin1 YES NULL select,insert,update,references
-c varchar(10) character set latin1 YES NULL select,insert,update,references
-b blob YES NULL select,insert,update,references
-d varchar(10) binary YES NULL select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+t text latin1 YES NULL select,insert,update,references
+c varchar(10) latin1 YES NULL select,insert,update,references
+b blob binary YES NULL select,insert,update,references
+d varchar(10) binary binary YES NULL select,insert,update,references
lock tables t1 WRITE;
show full fields from t1;
-Field Type Null Key Default Extra Privileges Comment
-t text character set latin1 YES NULL select,insert,update,references
-c varchar(10) character set latin1 YES NULL select,insert,update,references
-b blob YES NULL select,insert,update,references
-d varchar(10) binary YES NULL select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+t text latin1 YES NULL select,insert,update,references
+c varchar(10) latin1 YES NULL select,insert,update,references
+b blob binary YES NULL select,insert,update,references
+d varchar(10) binary binary YES NULL select,insert,update,references
unlock tables;
select t from t1 where t like "hello";
t
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 214328eab47..cf6533eef67 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -1,3 +1,4 @@
+drop table if exists t1,t2;
create table t1 (a char(16), b date, c datetime);
insert into t1 SET a='test 2000-01-01', b='2000-01-01', c='2000-01-01';
select * from t1 where c = '2000-01-01';
@@ -7,7 +8,6 @@ select * from t1 where b = '2000-01-01';
a b c
test 2000-01-01 2000-01-01 2000-01-01 00:00:00
drop table t1;
-drop table if exists t1,t2;
CREATE TABLE t1 (name char(6),cdate date);
INSERT INTO t1 VALUES ('name1','1998-01-01');
INSERT INTO t1 VALUES ('name2','1998-01-01');
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index 51e11d259eb..c0f0be246c9 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1626,13 +1626,13 @@ create table t1 (a enum (' ','a','b') not null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` enum('','a','b') character set latin1 NOT NULL default ''
+ `a` enum('','a','b') NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
drop table t1;
create table t1 (a enum (' ','a','b ') not null default 'b ');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` enum('','a','b') character set latin1 NOT NULL default 'b'
+ `a` enum('','a','b') NOT NULL default 'b'
) TYPE=MyISAM CHARSET=latin1
drop table t1;
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index c6eca3abe8b..3914114d92c 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
SELECT 10,10.0,10.,.1e+2,100.0e-1;
10 10.0 10. .1e+2 100.0e-1
10 10.0 10 10 10
@@ -7,12 +8,11 @@ SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1
10 10 10 10 10 10 0.1 0.1 0.1
-drop table if exists t1;
create table t1 (f1 float(24),f2 float(52));
show full columns from t1;
-Field Type Null Key Default Extra Privileges Comment
-f1 float YES NULL select,insert,update,references
-f2 double YES NULL select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+f1 float binary YES NULL select,insert,update,references
+f2 double binary YES NULL select,insert,update,references
insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150);
insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150);
select * from t1;
@@ -69,19 +69,19 @@ min(a)
drop table t1;
create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(5,6));
show full columns from t1;
-Field Type Null Key Default Extra Privileges Comment
-f float YES NULL select,insert,update,references
-f2 float YES NULL select,insert,update,references
-f3 float(6,2) YES NULL select,insert,update,references
-d double YES NULL select,insert,update,references
-d2 double YES NULL select,insert,update,references
-d3 double(10,3) YES NULL select,insert,update,references
-de decimal(10,0) YES NULL select,insert,update,references
-de2 decimal(6,0) YES NULL select,insert,update,references
-de3 decimal(5,2) YES NULL select,insert,update,references
-n decimal(10,0) YES NULL select,insert,update,references
-n2 decimal(8,0) YES NULL select,insert,update,references
-n3 decimal(7,6) YES NULL select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+f float binary YES NULL select,insert,update,references
+f2 float binary YES NULL select,insert,update,references
+f3 float(6,2) binary YES NULL select,insert,update,references
+d double binary YES NULL select,insert,update,references
+d2 double binary YES NULL select,insert,update,references
+d3 double(10,3) binary YES NULL select,insert,update,references
+de decimal(10,0) binary YES NULL select,insert,update,references
+de2 decimal(6,0) binary YES NULL select,insert,update,references
+de3 decimal(5,2) binary YES NULL select,insert,update,references
+n decimal(10,0) binary YES NULL select,insert,update,references
+n2 decimal(8,0) binary YES NULL select,insert,update,references
+n3 decimal(7,6) binary YES NULL select,insert,update,references
drop table t1;
create table t1 (a decimal(7,3) not null, key (a));
insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1");
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index ea2863aefce..19f1ac2b4d7 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -38,31 +38,31 @@ KEY (ulonglong,ulong),
KEY (options,flags)
);
show full fields from t1;
-Field Type Null Key Default Extra Privileges Comment
-auto int(5) unsigned PRI NULL auto_increment select,insert,update,references
-string varchar(10) character set latin1 YES hello select,insert,update,references
-tiny tinyint(4) MUL 0 select,insert,update,references
-short smallint(6) MUL 1 select,insert,update,references
-medium mediumint(8) MUL 0 select,insert,update,references
-long_int int(11) 0 select,insert,update,references
-longlong bigint(13) MUL 0 select,insert,update,references
-real_float float(13,1) MUL 0.0 select,insert,update,references
-real_double double(16,4) YES NULL select,insert,update,references
-utiny tinyint(3) unsigned MUL 0 select,insert,update,references
-ushort smallint(5) unsigned zerofill MUL 00000 select,insert,update,references
-umedium mediumint(8) unsigned MUL 0 select,insert,update,references
-ulong int(11) unsigned MUL 0 select,insert,update,references
-ulonglong bigint(13) unsigned MUL 0 select,insert,update,references
-time_stamp timestamp YES NULL select,insert,update,references
-date_field date YES NULL select,insert,update,references
-time_field time YES NULL select,insert,update,references
-date_time datetime YES NULL select,insert,update,references
-blob_col blob YES NULL select,insert,update,references
-tinyblob_col tinyblob YES NULL select,insert,update,references
-mediumblob_col mediumblob select,insert,update,references
-longblob_col longblob select,insert,update,references
-options enum('one','two','tree') character set latin1 MUL one select,insert,update,references
-flags set('one','two','tree') character set latin1 select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(5) unsigned binary PRI NULL auto_increment select,insert,update,references
+string varchar(10) latin1 YES hello select,insert,update,references
+tiny tinyint(4) binary MUL 0 select,insert,update,references
+short smallint(6) binary MUL 1 select,insert,update,references
+medium mediumint(8) binary MUL 0 select,insert,update,references
+long_int int(11) binary 0 select,insert,update,references
+longlong bigint(13) binary MUL 0 select,insert,update,references
+real_float float(13,1) binary MUL 0.0 select,insert,update,references
+real_double double(16,4) binary YES NULL select,insert,update,references
+utiny tinyint(3) unsigned binary MUL 0 select,insert,update,references
+ushort smallint(5) unsigned zerofill binary MUL 00000 select,insert,update,references
+umedium mediumint(8) unsigned binary MUL 0 select,insert,update,references
+ulong int(11) unsigned binary MUL 0 select,insert,update,references
+ulonglong bigint(13) unsigned binary MUL 0 select,insert,update,references
+time_stamp timestamp latin1 YES NULL select,insert,update,references
+date_field date latin1 YES NULL select,insert,update,references
+time_field time latin1 YES NULL select,insert,update,references
+date_time datetime latin1 YES NULL select,insert,update,references
+blob_col blob binary YES NULL select,insert,update,references
+tinyblob_col tinyblob binary YES NULL select,insert,update,references
+mediumblob_col mediumblob binary select,insert,update,references
+longblob_col longblob binary select,insert,update,references
+options enum('one','two','tree') latin1 MUL one select,insert,update,references
+flags set('one','two','tree') latin1 select,insert,update,references
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE
@@ -168,57 +168,57 @@ drop table t2;
create table t2 select * from t1;
update t2 set string="changed" where auto=16;
show full columns from t1;
-Field Type Null Key Default Extra Privileges Comment
-auto int(5) unsigned MUL NULL auto_increment select,insert,update,references
-string varchar(10) character set latin1 YES new defaul select,insert,update,references
-tiny tinyint(4) MUL 0 select,insert,update,references
-short smallint(6) MUL 0 select,insert,update,references
-medium mediumint(8) MUL 0 select,insert,update,references
-long_int int(11) 0 select,insert,update,references
-longlong bigint(13) MUL 0 select,insert,update,references
-real_float float(13,1) MUL 0.0 select,insert,update,references
-real_double double(16,4) YES NULL select,insert,update,references
-utiny tinyint(3) unsigned 0 select,insert,update,references
-ushort smallint(5) unsigned zerofill 00000 select,insert,update,references
-umedium mediumint(8) unsigned MUL 0 select,insert,update,references
-ulong int(11) unsigned MUL 0 select,insert,update,references
-ulonglong bigint(13) unsigned MUL 0 select,insert,update,references
-time_stamp timestamp YES NULL select,insert,update,references
-date_field varchar(10) character set latin1 YES NULL select,insert,update,references
-time_field time YES NULL select,insert,update,references
-date_time datetime YES NULL select,insert,update,references
-new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references
-tinyblob_col tinyblob YES NULL select,insert,update,references
-mediumblob_col mediumblob select,insert,update,references
-options enum('one','two','tree') character set latin1 MUL one select,insert,update,references
-flags set('one','two','tree') character set latin1 select,insert,update,references
-new_field varchar(10) character set latin1 new select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(5) unsigned binary MUL NULL auto_increment select,insert,update,references
+string varchar(10) latin1 YES new defaul select,insert,update,references
+tiny tinyint(4) binary MUL 0 select,insert,update,references
+short smallint(6) binary MUL 0 select,insert,update,references
+medium mediumint(8) binary MUL 0 select,insert,update,references
+long_int int(11) binary 0 select,insert,update,references
+longlong bigint(13) binary MUL 0 select,insert,update,references
+real_float float(13,1) binary MUL 0.0 select,insert,update,references
+real_double double(16,4) binary YES NULL select,insert,update,references
+utiny tinyint(3) unsigned binary 0 select,insert,update,references
+ushort smallint(5) unsigned zerofill binary 00000 select,insert,update,references
+umedium mediumint(8) unsigned binary MUL 0 select,insert,update,references
+ulong int(11) unsigned binary MUL 0 select,insert,update,references
+ulonglong bigint(13) unsigned binary MUL 0 select,insert,update,references
+time_stamp timestamp latin1 YES NULL select,insert,update,references
+date_field varchar(10) latin1 YES NULL select,insert,update,references
+time_field time latin1 YES NULL select,insert,update,references
+date_time datetime latin1 YES NULL select,insert,update,references
+new_blob_col varchar(20) latin1 YES NULL select,insert,update,references
+tinyblob_col tinyblob binary YES NULL select,insert,update,references
+mediumblob_col mediumblob binary select,insert,update,references
+options enum('one','two','tree') latin1 MUL one select,insert,update,references
+flags set('one','two','tree') latin1 select,insert,update,references
+new_field varchar(10) latin1 new select,insert,update,references
show full columns from t2;
-Field Type Null Key Default Extra Privileges Comment
-auto int(5) unsigned 0 select,insert,update,references
-string varchar(10) character set latin1 YES new defaul select,insert,update,references
-tiny tinyint(4) 0 select,insert,update,references
-short smallint(6) 0 select,insert,update,references
-medium mediumint(8) 0 select,insert,update,references
-long_int int(11) 0 select,insert,update,references
-longlong bigint(13) 0 select,insert,update,references
-real_float float(13,1) 0.0 select,insert,update,references
-real_double double(16,4) YES NULL select,insert,update,references
-utiny tinyint(3) unsigned 0 select,insert,update,references
-ushort smallint(5) unsigned zerofill 00000 select,insert,update,references
-umedium mediumint(8) unsigned 0 select,insert,update,references
-ulong int(11) unsigned 0 select,insert,update,references
-ulonglong bigint(13) unsigned 0 select,insert,update,references
-time_stamp timestamp YES NULL select,insert,update,references
-date_field varchar(10) character set latin1 YES NULL select,insert,update,references
-time_field time YES NULL select,insert,update,references
-date_time datetime YES NULL select,insert,update,references
-new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references
-tinyblob_col tinyblob YES NULL select,insert,update,references
-mediumblob_col mediumblob select,insert,update,references
-options enum('one','two','tree') character set latin1 one select,insert,update,references
-flags set('one','two','tree') character set latin1 select,insert,update,references
-new_field varchar(10) character set latin1 new select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(5) unsigned binary 0 select,insert,update,references
+string varchar(10) latin1 YES new defaul select,insert,update,references
+tiny tinyint(4) binary 0 select,insert,update,references
+short smallint(6) binary 0 select,insert,update,references
+medium mediumint(8) binary 0 select,insert,update,references
+long_int int(11) binary 0 select,insert,update,references
+longlong bigint(13) binary 0 select,insert,update,references
+real_float float(13,1) binary 0.0 select,insert,update,references
+real_double double(16,4) binary YES NULL select,insert,update,references
+utiny tinyint(3) unsigned binary 0 select,insert,update,references
+ushort smallint(5) unsigned zerofill binary 00000 select,insert,update,references
+umedium mediumint(8) unsigned binary 0 select,insert,update,references
+ulong int(11) unsigned binary 0 select,insert,update,references
+ulonglong bigint(13) unsigned binary 0 select,insert,update,references
+time_stamp timestamp latin1 YES NULL select,insert,update,references
+date_field varchar(10) latin1 YES NULL select,insert,update,references
+time_field time latin1 YES NULL select,insert,update,references
+date_time datetime latin1 YES NULL select,insert,update,references
+new_blob_col varchar(20) latin1 YES NULL select,insert,update,references
+tinyblob_col tinyblob binary YES NULL select,insert,update,references
+mediumblob_col mediumblob binary select,insert,update,references
+options enum('one','two','tree') latin1 one select,insert,update,references
+flags set('one','two','tree') latin1 select,insert,update,references
+new_field varchar(10) latin1 new select,insert,update,references
select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null)));
auto auto
16 16
@@ -228,12 +228,12 @@ auto auto
drop table t2;
create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, "a" as t2, repeat("a",256) as t3, binary repeat("b",256) as t4 from t1;
show full columns from t2;
-Field Type Null Key Default Extra Privileges Comment
-auto bigint(17) unsigned PRI 0 select,insert,update,references
-t1 bigint(1) 0 select,insert,update,references
-t2 char(1) character set latin1 select,insert,update,references
-t3 mediumtext character set latin1 select,insert,update,references
-t4 mediumblob select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+auto bigint(17) unsigned binary PRI 0 select,insert,update,references
+t1 bigint(1) binary 0 select,insert,update,references
+t2 char(1) latin1 select,insert,update,references
+t3 mediumtext latin1 select,insert,update,references
+t4 mediumblob binary select,insert,update,references
select * from t2;
auto t1 t2 t3 t4
11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
@@ -251,10 +251,10 @@ create table t3 select * from t1, t2;
Duplicate column name 'c'
create table t3 select t1.c AS c1, t2.c AS c2,1 as "const" from t1, t2;
show full columns from t3;
-Field Type Null Key Default Extra Privileges Comment
-c1 int(11) YES NULL select,insert,update,references
-c2 int(11) YES NULL select,insert,update,references
-const bigint(1) 0 select,insert,update,references
+Field Type Collation Null Key Default Extra Privileges Comment
+c1 int(11) binary YES NULL select,insert,update,references
+c2 int(11) binary YES NULL select,insert,update,references
+const bigint(1) binary 0 select,insert,update,references
drop table t1,t2,t3;
create table t1 ( myfield INT NOT NULL, UNIQUE INDEX (myfield), unique (myfield), index(myfield));
drop table t1;
diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result
index 256937c586a..b0ea1b69e59 100644
--- a/mysql-test/r/type_set.result
+++ b/mysql-test/r/type_set.result
@@ -3,13 +3,13 @@ create table t1 (a set (' ','a','b') not null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` set('','a','b') character set latin1 NOT NULL default ''
+ `a` set('','a','b') NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
drop table t1;
create table t1 (a set (' ','a','b ') not null default 'b ');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` set('','a','b') character set latin1 NOT NULL default 'b'
+ `a` set('','a','b') NOT NULL default 'b'
) TYPE=MyISAM CHARSET=latin1
drop table t1;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 3930e5e25c1..e546a8c8284 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -85,7 +85,7 @@ a b
2 b
1 a
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
-Table 't1' from one of SELECT's can not be used in order clause
+Table 't1' from one of SELECT's can not be used in global ORDER clause
explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
@@ -170,7 +170,6 @@ testtt
tsestset
1
drop table t1;
-drop table if exists t1,t2;
create table t1 (a int);
create table t2 (a int);
insert into t1 values (1),(2),(3),(4),(5);
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index ba5c1c6e28f..159b971440b 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1 (a int auto_increment , primary key (a));
insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
update t1 set a=a+10 where a > 34;
@@ -106,9 +106,12 @@ create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(1,2),(1,3);
update t1 set b=4 where a=1 order by b asc limit 1;
update t1 set b=4 where a=1 order by b desc limit 1;
+create table t2 (a int not null, b int not null);
+insert into t2 values (1,1),(1,2),(1,3);
select * from t1;
a b
1 4
1 2
1 4
-drop table t1;
+update t1 set b=(select distinct 1 from (select * from t2) a);
+drop table t1,t2;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 1b0b359c533..6e3b9309351 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -1,10 +1,10 @@
+drop table if exists t1,t2;
set @a := foo;
Unknown column 'foo' in 'field list'
set @a := connection_id() + 3;
select @a - connection_id();
@a - connection_id()
3
-drop table if exists t1,t2;
CREATE TABLE t1 ( i int not null, v int not null,index (i));
insert into t1 values (1,1),(1,3),(2,1);
create table t2 (i int not null, unique (i));
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index 7ce0f78da76..2d04da31caa 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0 ;
0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0
A 65 9223372036854775807 18446744073709551615
@@ -7,7 +8,6 @@ select 0x31+1,concat(0x31)+1,-0xf;
select x'31',X'ffff'+0;
x'31' X'ffff'+0
1 65535
-drop table if exists t1;
create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) );
insert into t1 set UNIQ=0x38afba1d73e6a18a;
insert into t1 set UNIQ=123;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index fbbf7fcb8f4..b66d75e2b3a 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
set @`test`=1,@TEST=3,@select=2,@t5=1.23456;
select @test,@`select`,@TEST,@not_used;
@test @`select` @TEST @not_used
@@ -48,6 +48,9 @@ set max_join_size=100;
show variables like 'max_join_size';
Variable_name Value
max_join_size 100
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size HA_POS_ERROR
set GLOBAL max_join_size=2000;
show global variables like 'max_join_size';
Variable_name Value
@@ -59,7 +62,7 @@ max_join_size 2000
set GLOBAL max_join_size=DEFAULT;
show global variables like 'max_join_size';
Variable_name Value
-max_join_size 18446744073709551615
+max_join_size HA_POS_ERROR
set @@max_join_size=1000, @@global.max_join_size=2000;
select @@local.max_join_size, @@global.max_join_size;
@@session.max_join_size @@global.max_join_size
@@ -312,7 +315,6 @@ set tmp_table_size=100;
set tx_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;
-DROP TABLE IF EXISTS t1,t2;
create table t1 (a int not null auto_increment, primary key(a));
create table t2 (a int not null auto_increment, primary key(a));
insert into t1 values(null),(null),(null);
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index e5713718db0..f2a105827da 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -1,4 +1,6 @@
drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
create table t1 (a int);
insert into t1 values (1);
insert into t1 values ("hej");
@@ -8,3 +10,23 @@ insert into t1 values ("hej");
insert into t1 values ("hej"),("då");
drop table t1;
set SQL_WARNINGS=0;
+drop temporary table if exists not_exists;
+Warnings:
+Note 1051 Unknown table 'not_exists'
+drop table if exists not_exists_table;
+Warnings:
+Note 1051 Unknown table 'not_exists_table'
+show warnings limit 1;
+Level Code Message
+Note 1051 Unknown table 'not_exists_table'
+drop database if exists not_exists_db;
+Warnings:
+Note 1008 Can't drop database 'not_exists_db'. Database doesn't exist
+show count(*) warnings;
+@@session.warning_count
+1
+create table t1(id int);
+create table if not exists t1(id int);
+select @@warning_count;
+@@warning_count
+0