summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-11-15 19:27:06 +0100
committerunknown <serg@serg.mylan>2004-11-15 19:27:06 +0100
commit03d82a4652c82fb1930e0e515877e8fffbb0e5b0 (patch)
treef8bc0b4f9899e5b4a5f848426d4568de1213e64b /mysql-test/r
parentf3f73a48df66247e8c155fa429aeb1c42b2e7a55 (diff)
parenta59b0fbfd6b7627a4fdf2233482e732480dbe437 (diff)
downloadmariadb-git-03d82a4652c82fb1930e0e515877e8fffbb0e5b0.tar.gz
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0 BitKeeper/etc/ignore: auto-union configure.in: Auto merged dbug/dbug.c: Auto merged include/my_dbug.h: Auto merged include/my_sys.h: Auto merged sql/filesort.cc: Auto merged sql/ha_isam.cc: Auto merged sql/ha_isammrg.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/alter_table.result10
-rw-r--r--mysql-test/r/consistent_snapshot.result15
-rw-r--r--mysql-test/r/ctype_ujis.result40
-rw-r--r--mysql-test/r/func_str.result5
-rw-r--r--mysql-test/r/grant.result44
-rw-r--r--mysql-test/r/have_moscow_leap_timezone.require2
-rw-r--r--mysql-test/r/having.result202
-rw-r--r--mysql-test/r/information_schema.result441
-rw-r--r--mysql-test/r/lowercase_table2.result80
-rw-r--r--mysql-test/r/metadata.result2
-rw-r--r--mysql-test/r/mix_innodb_myisam_binlog.result21
-rw-r--r--mysql-test/r/ndb_autodiscover.result7
-rw-r--r--mysql-test/r/ndb_autodiscover2.result3
-rw-r--r--mysql-test/r/ndb_basic.result7
-rw-r--r--mysql-test/r/ndb_index_ordered.result37
-rw-r--r--mysql-test/r/null.result94
-rw-r--r--mysql-test/r/ps_1general.result42
-rw-r--r--mysql-test/r/ps_2myisam.result4
-rw-r--r--mysql-test/r/ps_3innodb.result4
-rw-r--r--mysql-test/r/ps_4heap.result4
-rw-r--r--mysql-test/r/ps_5merge.result8
-rw-r--r--mysql-test/r/ps_6bdb.result4
-rw-r--r--mysql-test/r/ps_7ndb.result4
-rw-r--r--mysql-test/r/rpl_charset.result6
-rw-r--r--mysql-test/r/rpl_rewrite_db.result22
-rw-r--r--mysql-test/r/rpl_rotate_logs.result2
-rw-r--r--mysql-test/r/rpl_timezone.result2
-rw-r--r--mysql-test/r/sp-security.result4
-rw-r--r--mysql-test/r/sp.result12
-rw-r--r--mysql-test/r/timezone3.result41
-rw-r--r--mysql-test/r/trigger.result12
-rw-r--r--mysql-test/r/view.result4
32 files changed, 1078 insertions, 107 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index f26ca4a5425..e0d484312e7 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -483,3 +483,13 @@ ERROR 42000: Incorrect table name 't1\\'
rename table t1 to `t1\\`;
ERROR 42000: Incorrect table name 't1\\'
drop table t1;
+create table t1 (a text) character set koi8r;
+insert into t1 values (_koi8r'ÔÅÓÔ');
+select hex(a) from t1;
+hex(a)
+D4C5D3D4
+alter table t1 convert to character set cp1251;
+select hex(a) from t1;
+hex(a)
+F2E5F1F2
+drop table t1;
diff --git a/mysql-test/r/consistent_snapshot.result b/mysql-test/r/consistent_snapshot.result
new file mode 100644
index 00000000000..90606abbe4e
--- /dev/null
+++ b/mysql-test/r/consistent_snapshot.result
@@ -0,0 +1,15 @@
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+start transaction with consistent snapshot;
+insert into t1 values(1);
+select * from t1;
+a
+commit;
+delete from t1;
+start transaction;
+insert into t1 values(1);
+select * from t1;
+a
+1
+commit;
+drop table t1;
diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result
index 7c3ae52cbc9..d02ac0062f8 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -126,3 +126,43 @@ Field Type Null Key Default Extra
a char(1)
b enum('¤¢','¤¤') YES NULL
DROP TABLE t1;
+CREATE TABLE t1
+(
+a INTEGER NOT NULL,
+b VARCHAR(50) NOT NULL DEFAULT '',
+PRIMARY KEY (a),
+KEY b (b(10))
+) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
+INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
+INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
+INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
+SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
+a b
+0 aaabbbcccddd
+SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
+a b
+1 eeefffggghhh
+SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
+a b
+2 iiijjjkkkl
+DROP TABLE t1;
+CREATE TABLE t1
+(
+a INTEGER NOT NULL,
+b VARCHAR(50) NOT NULL DEFAULT '',
+PRIMARY KEY (a),
+KEY b (b(10))
+) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
+INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
+INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
+INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
+SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
+a b
+0 aaabbbcccddd
+SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
+a b
+1 eeefffggghhh
+SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
+a b
+2 iiijjjkkkl
+DROP TABLE t1;
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 1f07ba0484f..98d9c332ab3 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -201,6 +201,9 @@ hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex(
select length(unhex(md5("abrakadabra")));
length(unhex(md5("abrakadabra")))
16
+select concat('a', quote(NULL));
+concat('a', quote(NULL))
+aNULL
select reverse("");
reverse("")
@@ -312,7 +315,7 @@ insert into t1 values ('one'),(NULL),('two'),('four');
select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1;
a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n')
one 'one' 0 0 'one'
-NULL NULL 1 1 n
+NULL NULL 0 0 NULL
two 'two' 0 0 'two'
four 'four' 0 0 'four'
drop table t1;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index d5b4aea81f6..1ac6165e383 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -134,6 +134,31 @@ ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
select 1;
1
1
+insert into mysql.user (host, user) values ('localhost', 'test11');
+insert into mysql.db (host, db, user, select_priv) values
+('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
+alter table mysql.db order by db asc;
+flush privileges;
+show grants for test11@localhost;
+Grants for test11@localhost
+GRANT USAGE ON *.* TO 'test11'@'localhost'
+GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
+GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
+alter table mysql.db order by db desc;
+flush privileges;
+show grants for test11@localhost;
+Grants for test11@localhost
+GRANT USAGE ON *.* TO 'test11'@'localhost'
+GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
+GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
+delete from mysql.user where user='test11';
+delete from mysql.db where user='test11';
+create database mysqltest1;
+grant usage on mysqltest1.* to test6123 identified by 'magic123';
+select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1";
+host db user select_priv insert_priv
+delete from mysql.user where user='test6123';
+drop database mysqltest1;
create table t1 (a int);
grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
show grants for drop_user2@localhost;
@@ -229,25 +254,6 @@ GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost'
REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
DROP DATABASE ÂÄ;
SET NAMES latin1;
-insert into mysql.user (host, user) values ('localhost', 'test11');
-insert into mysql.db (host, db, user, select_priv) values
-('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
-alter table mysql.db order by db asc;
-flush privileges;
-show grants for test11@localhost;
-Grants for test11@localhost
-GRANT USAGE ON *.* TO 'test11'@'localhost'
-GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
-GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
-alter table mysql.db order by db desc;
-flush privileges;
-show grants for test11@localhost;
-Grants for test11@localhost
-GRANT USAGE ON *.* TO 'test11'@'localhost'
-GRANT SELECT ON `ab%`.* TO 'test11'@'localhost'
-GRANT SELECT ON `a%`.* TO 'test11'@'localhost'
-delete from mysql.user where user='test11';
-delete from mysql.db where user='test11';
USE test;
CREATE TABLE t1 (a int );
CREATE TABLE t2 LIKE t1;
diff --git a/mysql-test/r/have_moscow_leap_timezone.require b/mysql-test/r/have_moscow_leap_timezone.require
new file mode 100644
index 00000000000..f27452d7770
--- /dev/null
+++ b/mysql-test/r/have_moscow_leap_timezone.require
@@ -0,0 +1,2 @@
+from_unixtime(1072904422)
+2004-01-01 00:00:00
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 2e94974e953..86c9adf8cf6 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3;
create table t1 (a int);
select count(a) as b from t1 where a=0 having b > 0;
b
@@ -128,3 +128,203 @@ id description c
1 test 0
2 test2 0
drop table t1,t2,t3;
+create table t1 (col1 int, col2 varchar(5), col_t1 int);
+create table t2 (col1 int, col2 varchar(5), col_t2 int);
+create table t3 (col1 int, col2 varchar(5), col_t3 int);
+insert into t1 values(10,'hello',10);
+insert into t1 values(20,'hello',20);
+insert into t1 values(30,'hello',30);
+insert into t1 values(10,'bye',10);
+insert into t1 values(10,'sam',10);
+insert into t1 values(10,'bob',10);
+insert into t2 select * from t1;
+insert into t3 select * from t1;
+select count(*) from t1 group by col1 having col1 = 10;
+count(*)
+4
+select count(*) as count_col1 from t1 group by col1 having col1 = 10;
+count_col1
+4
+select count(*) as count_col1 from t1 as tmp1 group by col1 having col1 = 10;
+count_col1
+4
+select count(*) from t1 group by col2 having col2 = 'hello';
+count(*)
+3
+select count(*) from t1 group by col2 having col1 = 10;
+ERROR 42S22: Unknown column 'col1' in 'having clause'
+select col1 as count_col1 from t1 as tmp1 group by col1 having col1 = 10;
+count_col1
+10
+select col1 as count_col1 from t1 as tmp1 group by col1 having count_col1 = 10;
+count_col1
+10
+select col1 as count_col1 from t1 as tmp1 group by count_col1 having col1 = 10;
+count_col1
+10
+select col1 as count_col1 from t1 as tmp1 group by count_col1 having count_col1 = 10;
+count_col1
+10
+select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having col1 = 10;
+count_col1 col2
+10 bob
+10 bye
+10 hello
+10 sam
+select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having count_col1 = 10;
+count_col1 col2
+10 bob
+10 bye
+10 hello
+10 sam
+select col1 as count_col1,col2 from t1 as tmp1 group by col1,col2 having col2 = 'hello';
+count_col1 col2
+10 hello
+20 hello
+30 hello
+select col1 as count_col1,col2 as group_col2 from t1 as tmp1 group by col1,col2 having group_col2 = 'hello';
+count_col1 group_col2
+10 hello
+20 hello
+30 hello
+select sum(col1) as co12 from t1 group by col2 having col2 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10' at line 1
+select sum(col1) as co2, count(col2) as cc from t1 group by col1 having col1 =10;
+co2 cc
+40 4
+select t2.col2 from t2 group by t2.col1, t2.col2 having t1.col1 <= 10;
+ERROR 42S22: Unknown column 't1.col1' in 'having clause'
+select t1.col1 from t1
+where t1.col2 in
+(select t2.col2 from t2
+group by t2.col1, t2.col2 having t2.col1 <= 10);
+col1
+10
+20
+30
+10
+10
+10
+select t1.col1 from t1
+where t1.col2 in
+(select t2.col2 from t2
+group by t2.col1, t2.col2
+having t2.col1 <=
+(select min(t3.col1) from t3));
+col1
+10
+20
+30
+10
+10
+10
+select t1.col1 from t1
+where t1.col2 in
+(select t2.col2 from t2
+group by t2.col1, t2.col2 having t1.col1 <= 10);
+col1
+10
+10
+10
+10
+select t1.col1 as tmp_col from t1
+where t1.col2 in
+(select t2.col2 from t2
+group by t2.col1, t2.col2 having tmp_col <= 10);
+tmp_col
+10
+10
+10
+10
+select t1.col1 from t1
+where t1.col2 in
+(select t2.col2 from t2
+group by t2.col1, t2.col2 having col_t1 <= 10);
+col1
+10
+10
+10
+10
+select sum(col1) from t1
+group by col_t1
+having (select col_t1 from t2 where col_t1 = col_t2 order by col_t2 limit 1);
+sum(col1)
+40
+20
+30
+select t1.col1 from t1
+where t1.col2 in
+(select t2.col2 from t2
+group by t2.col1, t2.col2 having col_t1 <= 10)
+having col_t1 <= 20;
+ERROR 42S22: Unknown column 'col_t1' in 'having clause'
+select t1.col1 from t1
+where t1.col2 in
+(select t2.col2 from t2
+group by t2.col1, t2.col2 having col_t1 <= 10)
+group by col_t1
+having col_t1 <= 20;
+col1
+10
+select col_t1, sum(col1) from t1
+group by col_t1
+having col_t1 > 10 and
+exists (select sum(t2.col1) from t2
+group by t2.col2 having t2.col2 > 'b');
+col_t1 sum(col1)
+20 20
+30 30
+select sum(col1) from t1
+group by col_t1
+having col_t1 in (select sum(t2.col1) from t2
+group by t2.col2, t2.col1 having t2.col1 = t1.col1);
+ERROR 42S22: Unknown column 't1.col1' in 'having clause'
+select sum(col1) from t1
+group by col_t1
+having col_t1 in (select sum(t2.col1) from t2
+group by t2.col2, t2.col1 having t2.col1 = col_t1);
+sum(col1)
+40
+20
+30
+select t1.col1, t2.col1 from t1, t2 where t1.col1 = t2.col1
+group by t1.col1, t2.col1 having col1 = 2;
+ERROR 23000: Column 'col1' in having clause is ambiguous
+select t1.col1*10+t2.col1 from t1,t2 where t1.col1=t2.col1
+group by t1.col1, t2.col1 having col1 = 2;
+ERROR 23000: Column 'col1' in having clause is ambiguous
+drop table t1, t2, t3;
+create table t1 (s1 int);
+insert into t1 values (1),(2),(3);
+select count(*) from t1 group by s1 having s1 is null;
+count(*)
+select s1*0 as s1 from t1 group by s1 having s1 <> 0;
+s1
+0
+0
+0
+Warnings:
+Warning 1052 Column 's1' in having clause is ambiguous
+select s1*0 from t1 group by s1 having s1 = 0;
+s1*0
+select s1 from t1 group by 1 having 1 = 0;
+s1
+select count(s1) from t1 group by s1 having count(1+1)=2;
+count(s1)
+select count(s1) from t1 group by s1 having s1*0=0;
+count(s1)
+1
+1
+1
+select * from t1 a, t1 b group by a.s1 having s1 is null;
+ERROR 23000: Column 's1' in having clause is ambiguous
+drop table t1;
+create table t1 (s1 char character set latin1 collate latin1_german1_ci);
+insert into t1 values ('ü'),('y');
+Warnings:
+Warning 1265 Data truncated for column 's1' at row 1
+select s1,count(s1) from t1
+group by s1 collate latin1_swedish_ci having s1 = 'y';
+s1 count(s1)
+y 1
+drop table t1;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
new file mode 100644
index 00000000000..3c35c6d557d
--- /dev/null
+++ b/mysql-test/r/information_schema.result
@@ -0,0 +1,441 @@
+grant all privileges on test.* to mysqltest_1@localhost;
+select * from information_schema.SCHEMATA where schema_name > 'm';
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME
+NULL mysql latin1
+NULL test latin1
+select schema_name from information_schema.schemata;
+schema_name
+mysql
+test
+show databases *;
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME
+NULL mysql latin1
+NULL test latin1
+show databases like 't%';
+Database (t%)
+test
+show databases;
+Database
+mysql
+test
+show databases * where schema_name like 't%';
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME
+NULL test latin1
+show databases * where schema_name = 't%';
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME
+create database testtets;
+create table testtets.t1(a int, b VARCHAR(30), KEY string_data (b));
+create table test.t2(a int);
+create table t3(a int, KEY a_data (a));
+create table testtets.t4(a int);
+create view v1 (c) as select table_name from information_schema.TABLES;
+select * from v1;
+c
+columns_priv
+db
+func
+help_category
+help_keyword
+help_relation
+help_topic
+host
+proc
+tables_priv
+time_zone
+time_zone_leap_second
+time_zone_name
+time_zone_transition
+time_zone_transition_type
+user
+t2
+t3
+v1
+t1
+t4
+select c,table_name from v1
+left join information_schema.TABLES v2 on (v1.c=v2.table_name)
+where v1.c like "t%";
+c table_name
+tables_priv tables_priv
+time_zone time_zone
+time_zone_leap_second time_zone_leap_second
+time_zone_name time_zone_name
+time_zone_transition time_zone_transition
+time_zone_transition_type time_zone_transition_type
+t2 t2
+t3 t3
+t1 t1
+t4 t4
+select c, v2.table_name from v1
+right join information_schema.TABLES v2 on (v1.c=v2.table_name)
+where v1.c like "t%";
+c table_name
+tables_priv tables_priv
+time_zone time_zone
+time_zone_leap_second time_zone_leap_second
+time_zone_name time_zone_name
+time_zone_transition time_zone_transition
+time_zone_transition_type time_zone_transition_type
+t2 t2
+t3 t3
+t1 t1
+t4 t4
+select table_name from information_schema.TABLES
+where table_schema = "testtets" and table_name like "t%";
+table_name
+t1
+t4
+select * from information_schema.STATISTICS where TABLE_SCHEMA = "testtets";
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
+NULL testtets t1 1 testtets string_data 1 b A NULL NULL NULL YES BTREE
+show keys * where TABLE_SCHEMA Like "test%";
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
+NULL test t3 1 test a_data 1 a A NULL NULL NULL YES BTREE
+NULL testtets t1 1 testtets string_data 1 b A NULL NULL NULL YES BTREE
+show keys where INDEX_NAME = "a_data";
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t3 1 a_data 1 a A NULL NULL NULL YES BTREE
+show tables like 't%';
+Tables_in_test (t%)
+t2
+t3
+show tables * from test where table_name like 't%';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE
+NULL test t2
+NULL test t3
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t2 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
+t3 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
+v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
+show full columns from t3 like "a%";
+Field Type Collation Null Key Default Extra Privileges Comment
+a int(11) NULL YES MUL NULL select,insert,update,references
+show full columns from mysql.db like "Insert%";
+Field Type Collation Null Key Default Extra Privileges Comment
+Insert_priv enum('N','Y') utf8_bin N select,insert,update,references
+show full columns from v1;
+Field Type Collation Null Key Default Extra Privileges Comment
+c char(64) latin1_swedish_ci select,insert,update,references
+select * from information_schema.COLUMNS where table_name="t1"
+and column_name= "a";
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME TYPE COLLATION_NAME IS_NULLABLE KEY COLUMN_DEFAULT EXTRA PRIVILEGES COMMENT
+NULL testtets t1 a 1 int 0 11 4 0 NULL int(11) NULL YES NULL select,insert,update,references
+show columns * where table_name = "t1";
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME TYPE COLLATION_NAME IS_NULLABLE KEY COLUMN_DEFAULT EXTRA PRIVILEGES COMMENT
+NULL testtets t1 a 1 int 0 11 4 0 NULL int(11) NULL YES NULL
+NULL testtets t1 b 2 varchar 30 30 30 31 latin1 varchar(30) latin1_swedish_ci YES MUL NULL
+drop view v1;
+drop tables testtets.t4, testtets.t1, t2, t3;
+drop database testtets;
+select * from information_schema.CHARACTER_SETS
+where CHARACTER_SET_NAME like 'latin1%';
+CHARACTER_SET_NAME Description DEFAULT_COLLATE_NAME Maxlen
+latin1 ISO 8859-1 West European latin1_swedish_ci 1
+SHOW CHARACTER SET LIKE 'latin1%';
+Charset Description Default collation Maxlen
+latin1 ISO 8859-1 West European latin1_swedish_ci 1
+SHOW CHARACTER SET * LIKE 'latin1%';
+CHARACTER_SET_NAME Description DEFAULT_COLLATE_NAME Maxlen
+latin1 ISO 8859-1 West European latin1_swedish_ci 1
+SHOW CHARACTER SET WHERE CHARACTER_SET_NAME like 'latin1%';
+Charset Description Default collation Maxlen
+latin1 ISO 8859-1 West European latin1_swedish_ci 1
+SHOW CHARACTER SET CHARACTER_SET_NAME WHERE CHARACTER_SET_NAME like 'latin1%';
+CHARACTER_SET_NAME
+latin1
+SHOW CHARACTER SET * WHERE CHARACTER_SET_NAME like 'latin1%';
+CHARACTER_SET_NAME Description DEFAULT_COLLATE_NAME Maxlen
+latin1 ISO 8859-1 West European latin1_swedish_ci 1
+select * from information_schema.COLLATIONS
+where COLLATION_NAME like 'latin1%';
+COLLATION_NAME Charset Id Default Compiled Sortlen
+latin1_german1_ci latin1 5 0
+latin1_swedish_ci latin1 8 Yes Yes 1
+latin1_danish_ci latin1 15 0
+latin1_german2_ci latin1 31 Yes 2
+latin1_bin latin1 47 Yes 1
+latin1_general_ci latin1 48 0
+latin1_general_cs latin1 49 0
+latin1_spanish_ci latin1 94 0
+SHOW COLLATION LIKE 'latin1%';
+Collation Charset Id Default Compiled Sortlen
+latin1_german1_ci latin1 5 0
+latin1_swedish_ci latin1 8 Yes Yes 1
+latin1_danish_ci latin1 15 0
+latin1_german2_ci latin1 31 Yes 2
+latin1_bin latin1 47 Yes 1
+latin1_general_ci latin1 48 0
+latin1_general_cs latin1 49 0
+latin1_spanish_ci latin1 94 0
+SHOW COLLATION * LIKE 'latin1%';
+COLLATION_NAME Charset Id Default Compiled Sortlen
+latin1_german1_ci latin1 5 0
+latin1_swedish_ci latin1 8 Yes Yes 1
+latin1_danish_ci latin1 15 0
+latin1_german2_ci latin1 31 Yes 2
+latin1_bin latin1 47 Yes 1
+latin1_general_ci latin1 48 0
+latin1_general_cs latin1 49 0
+latin1_spanish_ci latin1 94 0
+SHOW COLLATION WHERE COLLATION_NAME like 'latin1%';
+Collation Charset Id Default Compiled Sortlen
+latin1_german1_ci latin1 5 0
+latin1_swedish_ci latin1 8 Yes Yes 1
+latin1_danish_ci latin1 15 0
+latin1_german2_ci latin1 31 Yes 2
+latin1_bin latin1 47 Yes 1
+latin1_general_ci latin1 48 0
+latin1_general_cs latin1 49 0
+latin1_spanish_ci latin1 94 0
+SHOW COLLATION COLLATION_NAME WHERE COLLATION_NAME like 'latin1%';
+COLLATION_NAME
+latin1_german1_ci
+latin1_swedish_ci
+latin1_danish_ci
+latin1_german2_ci
+latin1_bin
+latin1_general_ci
+latin1_general_cs
+latin1_spanish_ci
+SHOW COLLATION * WHERE COLLATION_NAME like 'latin1%';
+COLLATION_NAME Charset Id Default Compiled Sortlen
+latin1_german1_ci latin1 5 0
+latin1_swedish_ci latin1 8 Yes Yes 1
+latin1_danish_ci latin1 15 0
+latin1_german2_ci latin1 31 Yes 2
+latin1_bin latin1 47 Yes 1
+latin1_general_ci latin1 48 0
+latin1_general_cs latin1 49 0
+latin1_spanish_ci latin1 94 0
+select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
+where COLLATION_NAME like 'latin1%';
+COLLATION_NAME CHARACTER_SET_NAME
+latin1_german1_ci latin1
+latin1_swedish_ci latin1
+latin1_danish_ci latin1
+latin1_german2_ci latin1
+latin1_bin latin1
+latin1_general_ci latin1
+latin1_general_cs latin1
+latin1_spanish_ci latin1
+create function sub1(i int) returns int
+return i+1;
+create procedure sel2()
+begin
+select * from t1;
+select * from t2;
+end|
+show procedure status;
+Db Name Type Definer Modified Created Security_type Comment
+test sel2 PROCEDURE root@localhost # # DEFINER
+show function status;
+Db Name Type Definer Modified Created Security_type Comment
+test sub1 FUNCTION root@localhost # # DEFINER
+select a.ROUTINE_NAME from information_schema.ROUTINES a,
+information_schema.SCHEMATA b where
+a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
+ROUTINE_NAME
+sel2
+sub1
+explain select a.ROUTINE_NAME from information_schema.ROUTINES a,
+information_schema.SCHEMATA b where
+a.ROUTINE_SCHEMA = b.SCHEMA_NAME;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE # ALL NULL NULL NULL NULL 2
+1 SIMPLE # ALL NULL NULL NULL NULL 2 Using where
+select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a,
+mysql.proc b where a.ROUTINE_NAME = b.name;
+ROUTINE_NAME name
+sub1 sub1
+sel2 sel2
+select count(*) from information_schema.ROUTINES;
+count(*)
+2
+create view v0 (c) as select schema_name from information_schema.SCHEMATA;
+select * from v0;
+c
+mysql
+test
+explain select * from v0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY # ALL NULL NULL NULL NULL 2
+create view v1 (c) as select table_name from information_schema.TABLES
+where table_name="v1";
+select * from v1;
+c
+v1
+create view v2 (c) as select column_name from information_schema.COLUMNS
+where table_name="v2";
+select * from v2;
+c
+c
+create view v3 (c) as select CHARACTER_SET_NAME from information_schema.CHARACTER_SETS
+where CHARACTER_SET_NAME like "latin1%";
+select * from v3;
+c
+latin1
+create view v4 (c) as select COLLATION_NAME from information_schema.COLLATIONS
+where COLLATION_NAME like "latin1%";
+select * from v4;
+c
+latin1_german1_ci
+latin1_swedish_ci
+latin1_danish_ci
+latin1_german2_ci
+latin1_bin
+latin1_general_ci
+latin1_general_cs
+latin1_spanish_ci
+show keys from v4;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+select * from information_schema.VIEWS where TABLE_NAME like "v%";
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE
+NULL test v0 select `SCHEMATA`.`SCHEMA_NAME` AS `c` from `information_schema`.`SCHEMATA` NONE NO
+NULL test v1 select `TABLES`.`TABLE_NAME` AS `c` from `information_schema`.`TABLES` where (`TABLES`.`TABLE_NAME` = _latin1'v1') NONE NO
+NULL test v2 select `COLUMNS`.`COLUMN_NAME` AS `c` from `information_schema`.`COLUMNS` where (`COLUMNS`.`TABLE_NAME` = _latin1'v2') NONE NO
+NULL test v3 select `CHARACTER_SETS`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`CHARACTER_SETS` where (`CHARACTER_SETS`.`CHARACTER_SET_NAME` like _latin1'latin1%') NONE NO
+NULL test v4 select `COLLATIONS`.`COLLATION_NAME` AS `c` from `information_schema`.`COLLATIONS` where (`COLLATIONS`.`COLLATION_NAME` like _latin1'latin1%') NONE NO
+drop view v0, v1, v2, v3, v4;
+create table t1 (a int);
+grant select,update,insert on t1 to mysqltest_1@localhost;
+grant select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost;
+grant all on test.* to mysqltest_1@localhost with grant option;
+select * from information_schema.USER_PRIVILEGES where grantee like '%mysqltest_1%';
+GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
+'mysqltest_1'@'localhost' NULL USAGE NO
+select * from information_schema.SCHEMA_PRIVILEGES where grantee like '%mysqltest_1%';
+GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
+'mysqltest_1'@'localhost' NULL test SELECT YES
+'mysqltest_1'@'localhost' NULL test INSERT YES
+'mysqltest_1'@'localhost' NULL test UPDATE YES
+'mysqltest_1'@'localhost' NULL test DELETE YES
+'mysqltest_1'@'localhost' NULL test CREATE YES
+'mysqltest_1'@'localhost' NULL test DROP YES
+'mysqltest_1'@'localhost' NULL test REFERENCES YES
+'mysqltest_1'@'localhost' NULL test INDEX YES
+'mysqltest_1'@'localhost' NULL test ALTER YES
+'mysqltest_1'@'localhost' NULL test CREATE TEMPORARY TABLES YES
+'mysqltest_1'@'localhost' NULL test LOCK TABLES YES
+'mysqltest_1'@'localhost' NULL test CREATE VIEW YES
+'mysqltest_1'@'localhost' NULL test SHOW VIEW YES
+select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%';
+GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
+'mysqltest_1'@'localhost' NULL test t1 SELECT NO
+'mysqltest_1'@'localhost' NULL test t1 INSERT NO
+'mysqltest_1'@'localhost' NULL test t1 UPDATE NO
+select * from information_schema.COLUMN_PRIVILEGES where grantee like '%mysqltest_1%';
+GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
+'mysqltest_1'@'localhost' NULL test t1 a SELECT NO
+'mysqltest_1'@'localhost' NULL test t1 a INSERT NO
+'mysqltest_1'@'localhost' NULL test t1 a UPDATE NO
+'mysqltest_1'@'localhost' NULL test t1 a REFERENCES NO
+delete from mysql.user where user='mysqltest_1';
+delete from mysql.db where user='mysqltest_1';
+delete from mysql.tables_priv where user='mysqltest_1';
+delete from mysql.columns_priv where user='mysqltest_1';
+flush privileges;
+drop table t1;
+create table t1 (a int null, primary key(a));
+alter table t1 add constraint constraint_1 unique (a);
+alter table t1 add constraint unique key_1(a);
+alter table t1 add constraint constraint_2 unique key_2(a);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ PRIMARY KEY (`a`),
+ UNIQUE KEY `constraint_1` (`a`),
+ UNIQUE KEY `key_1` (`a`),
+ UNIQUE KEY `key_2` (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from information_schema.TABLE_CONSTRAINTS where
+TABLE_SCHEMA= "test";
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE CONSTRAINT_METHOD
+NULL test PRIMARY test t1 PRIMARY KEY NULL
+NULL test constraint_1 test t1 UNIQUE NULL
+NULL test key_1 test t1 UNIQUE NULL
+NULL test key_2 test t1 UNIQUE NULL
+select * from information_schema.KEY_COLUMN_USAGE where
+TABLE_SCHEMA= "test";
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
+NULL test PRIMARY test t1 a 1 NULL NULL NULL
+NULL test constraint_1 test t1 a 1 NULL NULL NULL
+NULL test key_1 test t1 a 1 NULL NULL NULL
+NULL test key_2 test t1 a 1 NULL NULL NULL
+drop table t1;
+CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id),
+FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE,
+FOREIGN KEY (t1_id) REFERENCES t1(id) ON UPDATE CASCADE) ENGINE=INNODB;
+select * from information_schema.TABLE_CONSTRAINTS where
+TABLE_SCHEMA= "test";
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE CONSTRAINT_METHOD
+NULL test PRIMARY test t1 PRIMARY KEY NULL
+NULL test PRIMARY test t2 PRIMARY KEY NULL
+NULL test t2_ibfk_1 test t2 FOREIGN KEY ON DELETE CASCADE
+NULL test t2_ibfk_2 test t2 FOREIGN KEY ON UPDATE CASCADE
+select * from information_schema.KEY_COLUMN_USAGE where
+TABLE_SCHEMA= "test";
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
+NULL test PRIMARY test t1 id 1 NULL NULL NULL
+NULL test PRIMARY test t2 id 1 NULL NULL NULL
+NULL test t2_ibfk_1 test t2 t1_id 1 test t1 id
+NULL test t2_ibfk_2 test t2 t1_id 1 test t1 id
+select table_name from information_schema.TABLES where table_schema like "test%";
+table_name
+t1
+t2
+select table_name,column_name from information_schema.COLUMNS where table_schema like "test%";
+table_name column_name
+t1 id
+t2 id
+t2 t1_id
+select ROUTINE_NAME from information_schema.ROUTINES;
+ROUTINE_NAME
+sel2
+sub1
+delete from mysql.user where user='mysqltest_1';
+drop table t2;
+drop table t1;
+drop procedure sel2;
+drop function sub1;
+create table t1(a int);
+create view v1 (c) as select a from t1 with check option;
+create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION;
+create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION;
+select * from information_schema.views;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE
+NULL test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` WITH CASCADED CHECK OPTION YES
+NULL test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` WITH LOCAL CHECK OPTION YES
+NULL test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` WITH CASCADED CHECK OPTION YES
+grant select (a) on test.t1 to joe@localhost with grant option;
+select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES;
+GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
+'joe'@'localhost' NULL test t1 a SELECT YES
+select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES;
+GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
+'joe'@'localhost' NULL test t1 USAGE YES
+drop view v1, v2, v3;
+drop table t1;
+delete from mysql.user where user='joe';
+delete from mysql.db where user='joe';
+delete from mysql.tables_priv where user='joe';
+delete from mysql.columns_priv where user='joe';
+flush privileges;
+create procedure px5 ()
+begin
+declare v int;
+declare c cursor for select version from
+information_schema.tables;
+open c;
+fetch c into v;
+select v;
+close c;
+end;//
+call px5()//
+v
+9
+call px5()//
+v
+9
diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result
index 228c7d325e5..3be73f6cc6a 100644
--- a/mysql-test/r/lowercase_table2.result
+++ b/mysql-test/r/lowercase_table2.result
@@ -4,11 +4,11 @@ DROP DATABASE IF EXISTS `test_$1`;
CREATE TABLE T1 (a int);
INSERT INTO T1 VALUES (1);
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-T1 BASE TABLE
+Tables_in_test (T1)
+T1
SHOW TABLES LIKE "t1";
-Tables_in_test (t1) table_type
-T1 BASE TABLE
+Tables_in_test (t1)
+T1
SHOW CREATE TABLE T1;
Table Create Table
T1 CREATE TABLE `T1` (
@@ -16,37 +16,37 @@ T1 CREATE TABLE `T1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
RENAME TABLE T1 TO T2;
SHOW TABLES LIKE "T2";
-Tables_in_test (T2) table_type
-T2 BASE TABLE
+Tables_in_test (T2)
+T2
SELECT * FROM t2;
a
1
RENAME TABLE T2 TO t3;
SHOW TABLES LIKE "T3";
-Tables_in_test (T3) table_type
-t3 BASE TABLE
+Tables_in_test (T3)
+t3
RENAME TABLE T3 TO T1;
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-T1 BASE TABLE
+Tables_in_test (T1)
+T1
ALTER TABLE T1 add b int;
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-T1 BASE TABLE
+Tables_in_test (T1)
+T1
ALTER TABLE T1 RENAME T2;
SHOW TABLES LIKE "T2";
-Tables_in_test (T2) table_type
-T2 BASE TABLE
+Tables_in_test (T2)
+T2
LOCK TABLE T2 WRITE;
ALTER TABLE T2 drop b;
SHOW TABLES LIKE "T2";
-Tables_in_test (T2) table_type
-T2 BASE TABLE
+Tables_in_test (T2)
+T2
UNLOCK TABLES;
RENAME TABLE T2 TO T1;
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-T1 BASE TABLE
+Tables_in_test (T1)
+T1
SELECT * from T1;
a
1
@@ -59,11 +59,11 @@ DROP DATABASE `test_$1`;
CREATE TABLE T1 (a int) engine=innodb;
INSERT INTO T1 VALUES (1);
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-T1 BASE TABLE
+Tables_in_test (T1)
+T1
SHOW TABLES LIKE "t1";
-Tables_in_test (t1) table_type
-T1 BASE TABLE
+Tables_in_test (t1)
+T1
SHOW CREATE TABLE T1;
Table Create Table
T1 CREATE TABLE `T1` (
@@ -71,37 +71,37 @@ T1 CREATE TABLE `T1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
RENAME TABLE T1 TO T2;
SHOW TABLES LIKE "T2";
-Tables_in_test (T2) table_type
-t2 BASE TABLE
+Tables_in_test (T2)
+t2
SELECT * FROM t2;
a
1
RENAME TABLE T2 TO t3;
SHOW TABLES LIKE "T3";
-Tables_in_test (T3) table_type
-t3 BASE TABLE
+Tables_in_test (T3)
+t3
RENAME TABLE T3 TO T1;
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-t1 BASE TABLE
+Tables_in_test (T1)
+t1
ALTER TABLE T1 add b int;
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-t1 BASE TABLE
+Tables_in_test (T1)
+t1
ALTER TABLE T1 RENAME T2;
SHOW TABLES LIKE "T2";
-Tables_in_test (T2) table_type
-t2 BASE TABLE
+Tables_in_test (T2)
+t2
LOCK TABLE T2 WRITE;
ALTER TABLE T2 drop b;
SHOW TABLES LIKE "T2";
-Tables_in_test (T2) table_type
-t2 BASE TABLE
+Tables_in_test (T2)
+t2
UNLOCK TABLES;
RENAME TABLE T2 TO T1;
SHOW TABLES LIKE "T1";
-Tables_in_test (T1) table_type
-t1 BASE TABLE
+Tables_in_test (T1)
+t1
SELECT * from T1;
a
1
@@ -124,10 +124,10 @@ drop table T1;
create table T1 (A int);
alter table T1 add index (A);
show tables like 'T1%';
-Tables_in_test (T1%) table_type
-T1 BASE TABLE
+Tables_in_test (T1%)
+T1
alter table t1 add index (A);
show tables like 't1%';
-Tables_in_test (t1%) table_type
-t1 BASE TABLE
+Tables_in_test (t1%)
+t1
drop table t1;
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index ced3ca61f80..2321a8998ac 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -5,7 +5,7 @@ def 1 8 1 1 N 32769 0 8
def 1.0 5 3 3 N 32769 1 8
def -1 8 1 2 N 32769 0 8
def hello 254 5 5 N 1 31 8
-def NULL 6 0 0 Y 32768 0 8
+def NULL 6 0 0 Y 32896 0 63
1 1.0 -1 hello NULL
1 1.0 -1 hello NULL
create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result
index 11bc9772276..abcb451df65 100644
--- a/mysql-test/r/mix_innodb_myisam_binlog.result
+++ b/mysql-test/r/mix_innodb_myisam_binlog.result
@@ -180,4 +180,25 @@ master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 239 Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 321 Query 1 # use `test`; COMMIT
+delete from t1;
+delete from t2;
+alter table t2 type=MyISAM;
+insert into t1 values (1);
+begin;
+select * from t1 for update;
+a
+1
+select (@before:=unix_timestamp())*0;
+(@before:=unix_timestamp())*0
+0
+begin;
+ select * from t1 for update;
+insert into t2 values (20);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select (@after:=unix_timestamp())*0;
+(@after:=unix_timestamp())*0
+0
+select (@after-@before) >= 2;
+(@after-@before) >= 2
+1
drop table t1,t2;
diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result
index 4925aac8ac1..82ff4072378 100644
--- a/mysql-test/r/ndb_autodiscover.result
+++ b/mysql-test/r/ndb_autodiscover.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
flush status;
create table t1(
id int not null primary key,
@@ -363,3 +363,8 @@ a int NOT NULL PRIMARY KEY,
b int
) engine=ndb;
insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
+create table t10 (
+a int not null primary key,
+b blob
+) engine=ndb;
+insert into t10 values (1, 'kalle');
diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/r/ndb_autodiscover2.result
index 08803d997a5..91f018b5d02 100644
--- a/mysql-test/r/ndb_autodiscover2.result
+++ b/mysql-test/r/ndb_autodiscover2.result
@@ -8,3 +8,6 @@ show status like 'handler_discover%';
Variable_name Value
Handler_discover 1
drop table t9;
+select * from t10;
+ERROR HY000: Got error 4263 'Invalid blob attributes or invalid blob parts table' from ndbcluster
+drop table t10;
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
index ba8ee820ad9..6ec5338acbe 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/r/ndb_basic.result
@@ -400,6 +400,13 @@ b attr1
9413 9412
drop table test.t1, t2;
drop database mysqltest;
+drop database if exists ndbtest1;
+create database ndbtest1;
+use ndbtest1;
+create table t1(id int) engine=ndbcluster;
+drop database ndbtest1;
+drop database ndbtest1;
+ERROR HY000: Can't drop database 'ndbtest1'; database doesn't exist
use test;
create table t1 (a int primary key, b char(0));
insert into t1 values (1,"");
diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result
index 2dc260ec43d..50f904af750 100644
--- a/mysql-test/r/ndb_index_ordered.result
+++ b/mysql-test/r/ndb_index_ordered.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1, test1, test2;
CREATE TABLE t1 (
a int unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
@@ -275,3 +275,38 @@ a b c
1 1 1
4 4 NULL
drop table t1;
+CREATE TABLE test1 (
+SubscrID int(11) NOT NULL auto_increment,
+UsrID int(11) NOT NULL default '0',
+PRIMARY KEY (SubscrID),
+KEY idx_usrid (UsrID)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO test1 VALUES (2,224),(3,224),(1,224);
+CREATE TABLE test2 (
+SbclID int(11) NOT NULL auto_increment,
+SbcrID int(11) NOT NULL default '0',
+PRIMARY KEY (SbclID),
+KEY idx_sbcrid (SbcrID)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
+INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2);
+select * from test1 order by 1;
+SubscrID UsrID
+1 224
+2 224
+3 224
+select * from test2 order by 1;
+SbclID SbcrID
+1 1
+2 1
+3 2
+4 2
+SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON
+l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2;
+SubscrID SbclID
+1 1
+1 2
+2 3
+2 4
+3 NULL
+drop table test1;
+drop table test2;
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index f39bd0c6f6c..68fb9c3a34b 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -184,3 +184,97 @@ select count(*) from t1 where i=2 or i is null;
count(*)
9
drop table t1;
+set names latin2;
+create table t1 select
+null as c00,
+if(1, null, 'string') as c01,
+if(0, null, 'string') as c02,
+ifnull(null, 'string') as c03,
+ifnull('string', null) as c04,
+case when 0 then null else 'string' end as c05,
+case when 1 then null else 'string' end as c06,
+coalesce(null, 'string') as c07,
+coalesce('string', null) as c08,
+least('string',null) as c09,
+least(null, 'string') as c10,
+greatest('string',null) as c11,
+greatest(null, 'string') as c12,
+nullif('string', null) as c13,
+nullif(null, 'string') as c14,
+trim('string' from null) as c15,
+trim(null from 'string') as c16,
+substring_index('string', null, 1) as c17,
+substring_index(null, 'string', 1) as c18,
+elt(1, null, 'string') as c19,
+elt(1, 'string', null) as c20,
+concat('string', null) as c21,
+concat(null, 'string') as c22,
+concat_ws('sep', 'string', null) as c23,
+concat_ws('sep', null, 'string') as c24,
+concat_ws(null, 'string', 'string') as c25,
+make_set(3, 'string', null) as c26,
+make_set(3, null, 'string') as c27,
+export_set(3, null, 'off', 'sep') as c29,
+export_set(3, 'on', null, 'sep') as c30,
+export_set(3, 'on', 'off', null) as c31,
+replace(null, 'from', 'to') as c32,
+replace('str', null, 'to') as c33,
+replace('str', 'from', null) as c34,
+insert('str', 1, 2, null) as c35,
+insert(null, 1, 2, 'str') as c36,
+lpad('str', 10, null) as c37,
+rpad(null, 10, 'str') as c38;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c00` binary(0) default NULL,
+ `c01` varchar(6) character set latin2 default NULL,
+ `c02` varchar(6) character set latin2 default NULL,
+ `c03` varchar(6) character set latin2 NOT NULL default '',
+ `c04` varchar(6) character set latin2 default NULL,
+ `c05` varchar(6) character set latin2 default NULL,
+ `c06` varchar(6) character set latin2 default NULL,
+ `c07` varchar(6) character set latin2 default NULL,
+ `c08` varchar(6) character set latin2 default NULL,
+ `c09` varchar(6) character set latin2 NOT NULL default '',
+ `c10` varchar(6) character set latin2 NOT NULL default '',
+ `c11` varchar(6) character set latin2 NOT NULL default '',
+ `c12` varchar(6) character set latin2 NOT NULL default '',
+ `c13` varchar(6) character set latin2 default NULL,
+ `c14` char(0) character set latin2 default NULL,
+ `c15` char(0) character set latin2 default NULL,
+ `c16` varchar(6) character set latin2 default NULL,
+ `c17` varchar(6) character set latin2 default NULL,
+ `c18` char(0) character set latin2 default NULL,
+ `c19` varchar(6) character set latin2 default NULL,
+ `c20` varchar(6) character set latin2 default NULL,
+ `c21` varchar(6) character set latin2 default NULL,
+ `c22` varchar(6) character set latin2 default NULL,
+ `c23` varchar(9) character set latin2 default NULL,
+ `c24` varchar(9) character set latin2 default NULL,
+ `c25` varchar(12) character set latin2 default NULL,
+ `c26` varchar(7) character set latin2 default NULL,
+ `c27` varchar(7) character set latin2 default NULL,
+ `c29` longtext character set latin2,
+ `c30` longtext character set latin2,
+ `c31` varchar(192) character set latin2 default NULL,
+ `c32` char(0) character set latin2 default NULL,
+ `c33` char(3) character set latin2 default NULL,
+ `c34` char(3) character set latin2 default NULL,
+ `c35` char(3) character set latin2 default NULL,
+ `c36` char(3) character set latin2 default NULL,
+ `c37` varchar(10) character set latin2 default NULL,
+ `c38` varchar(10) character set latin2 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+select
+case 'str' when 'STR' then 'str' when null then 'null' end as c01,
+case 'str' when null then 'null' when 'STR' then 'str' end as c02,
+field(null, 'str1', 'str2') as c03,
+field('str1','STR1', null) as c04,
+field('str1', null, 'STR1') as c05,
+'string' in ('STRING', null) as c08,
+'string' in (null, 'STRING') as c09;
+c01 c02 c03 c04 c05 c08 c09
+str str 0 1 2 1 1
+set names latin1;
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index fe7aa623023..e8d8e4063f1 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -1,4 +1,5 @@
-use test;
+drop table if exists t5, t6, t7, t8;
+drop database if exists mysqltest ;
test_sequence
------ basic tests ------
drop table if exists t1, t9 ;
@@ -553,7 +554,6 @@ execute stmt3;
ERROR 42S01: Table 'new_t2' already exists
rename table new_t2 to t2;
drop table t2;
-drop table if exists t5, t6, t7, t8 ;
prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
create table t5 (a int) ;
execute stmt1 ;
@@ -805,21 +805,24 @@ test_sequence
------ grant/revoke/drop affects a parallel session test ------
show grants for second_user@localhost ;
ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost'
-grant usage on test.* to second_user@localhost
+create database mysqltest;
+use mysqltest;
+use test;
+grant usage on mysqltest.* to second_user@localhost
identified by 'looser' ;
-grant select on test.t9 to second_user@localhost
+grant select on mysqltest.t9 to second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
select current_user();
current_user()
second_user@localhost
show grants for current_user();
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
prepare s_t9 from 'select c1 as my_col
from t9 where c1= 1' ;
execute s_t9 ;
@@ -827,24 +830,24 @@ my_col
1
select a as my_col from t1;
ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1'
-grant select on test.t1 to second_user@localhost
+grant select on mysqltest.t1 to second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost'
-GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost'
-drop table t9 ;
+GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
+drop table mysqltest.t9 ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost'
-GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost'
-GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
prepare s_t1 from 'select a as my_col from t1' ;
execute s_t1 ;
my_col
@@ -853,17 +856,17 @@ my_col
3
4
execute s_t9 ;
-ERROR 42S02: Table 'test.t9' doesn't exist
-revoke all privileges on test.t1 from second_user@localhost
+ERROR 42S02: Table 'mysqltest.t9' doesn't exist
+revoke all privileges on mysqltest.t1 from second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
-GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost'
+GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
execute s_t1 ;
ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1'
revoke all privileges, grant option from second_user@localhost ;
@@ -874,4 +877,5 @@ drop user second_user@localhost ;
commit ;
show grants for second_user@localhost ;
ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost'
-drop table t1 ;
+drop table t1,t9 ;
+drop database mysqltest;
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 6773370fbc5..c64f513f0aa 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1789,7 +1789,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
- `const12` char(0) default NULL,
+ `const12` binary(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
@@ -1819,7 +1819,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 0 0 8
+def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 09f19c3763c..adcf6064835 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1772,7 +1772,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
- `const12` char(0) default NULL,
+ `const12` binary(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
@@ -1802,7 +1802,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 0 0 8
+def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index 427fee8e757..cd36af07300 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1773,7 +1773,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
- `const12` char(0) default NULL,
+ `const12` binary(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
@@ -1803,7 +1803,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 0 0 8
+def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 51d842ae000..3af0bfc7884 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1712,7 +1712,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
- `const12` char(0) default NULL,
+ `const12` binary(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
@@ -1742,7 +1742,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 0 0 8
+def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
@@ -4721,7 +4721,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
- `const12` char(0) default NULL,
+ `const12` binary(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
@@ -4751,7 +4751,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 0 0 8
+def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result
index 85cb8af652e..93f766c61e0 100644
--- a/mysql-test/r/ps_6bdb.result
+++ b/mysql-test/r/ps_6bdb.result
@@ -1772,7 +1772,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
- `const12` char(0) default NULL,
+ `const12` binary(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
@@ -1802,7 +1802,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 0 0 8
+def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result
index e90eff5d1cd..70118509d0b 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/r/ps_7ndb.result
@@ -1749,7 +1749,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
- `const12` char(0) default NULL,
+ `const12` binary(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
@@ -1779,7 +1779,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
-def test t5 t5 const12 const12 254 0 0 Y 0 0 8
+def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result
index 2ffdb2c720a..9a002953b45 100644
--- a/mysql-test/r/rpl_charset.result
+++ b/mysql-test/r/rpl_charset.result
@@ -162,9 +162,9 @@ master-bin.000001 # Query 1 # use `mysqltest2`; drop database mysqltest2
master-bin.000001 # Query 1 # SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Query 1 # drop database mysqltest3
set global character_set_server=latin2;
-ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
+ERROR HY000: Binary logging and replication forbid changing the global server character set, collation
set global character_set_server=latin2;
-ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
+ERROR HY000: Binary logging and replication forbid changing the global server character set, collation
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
@@ -181,7 +181,7 @@ select @@character_set_server;
@@character_set_server
latin5
set one_shot max_join_size=10;
-ERROR HY000: The SET ONE_SHOT syntax is reserved for purposes internal to the MySQL server
+ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998;
diff --git a/mysql-test/r/rpl_rewrite_db.result b/mysql-test/r/rpl_rewrite_db.result
new file mode 100644
index 00000000000..2804b98dea1
--- /dev/null
+++ b/mysql-test/r/rpl_rewrite_db.result
@@ -0,0 +1,22 @@
+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 database if exists mysqltest1;
+create database mysqltest1;
+use mysqltest1;
+create table t1 (a int);
+insert into t1 values(9);
+select * from mysqltest1.t1;
+a
+9
+show databases like 'mysqltest1';
+Database (mysqltest1)
+mysqltest1
+select * from test.t1;
+a
+9
+drop table t1;
+drop database mysqltest1;
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
index 85071e13555..cfd296fd44b 100644
--- a/mysql-test/r/rpl_rotate_logs.result
+++ b/mysql-test/r/rpl_rotate_logs.result
@@ -1,7 +1,7 @@
drop table if exists t1, t2, t3, t4;
drop table if exists t1, t2, t3, t4;
start slave;
-ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
+ERROR HY000: File 'TESTDIR/var/slave-data/master.info' not found (Errcode: 13)
start slave;
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result
index 6dc8f87393c..495fccd35a3 100644
--- a/mysql-test/r/rpl_timezone.result
+++ b/mysql-test/r/rpl_timezone.result
@@ -73,5 +73,5 @@ t
2001-09-09 03:46:40
1000000000
set global time_zone='MET';
-ERROR HY000: Binary logging and replication forbid changing of the global server time zone
+ERROR HY000: Binary logging and replication forbid changing the global server time zone
drop table t1, t2;
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index 23804e62ef5..25582796812 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -30,7 +30,7 @@ db1_secret
select * from db1_secret.t1;
ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
create procedure db1_secret.dummy() begin end;
-ERROR 42000: Unknown database 'db1_secret'
+ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
drop procedure db1_secret.dummy;
ERROR 42000: PROCEDURE db1_secret.dummy does not exist
call db1_secret.stamp(3);
@@ -40,7 +40,7 @@ db1_secret
select * from db1_secret.t1;
ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
create procedure db1_secret.dummy() begin end;
-ERROR 42000: Unknown database 'db1_secret'
+ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
drop procedure db1_secret.dummy;
ERROR 42000: PROCEDURE db1_secret.dummy does not exist
select * from t1;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index bcabf693e4c..8745a274851 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1746,10 +1746,20 @@ drop table if exists t3|
create procedure bug4904()
begin
declare continue handler for sqlstate 'HY000' begin end;
-create table t2 as select * from t;
+create table t2 as select * from t3;
end|
call bug4904()|
+ERROR 42S02: Table 'test.t3' doesn't exist
drop procedure bug4904|
+create table t3 (s1 char character set latin1, s2 char character set latin2)|
+create procedure bug4904 ()
+begin
+declare continue handler for sqlstate 'HY000' begin end;
+select s1 from t3 union select s2 from t3;
+end|
+call bug4904()|
+drop procedure bug4904|
+drop table t3|
create procedure bug336(out y int)
begin
declare x int;
diff --git a/mysql-test/r/timezone3.result b/mysql-test/r/timezone3.result
new file mode 100644
index 00000000000..ec0b6045f93
--- /dev/null
+++ b/mysql-test/r/timezone3.result
@@ -0,0 +1,41 @@
+drop table if exists t1;
+create table t1 (i int, c varchar(20));
+insert into t1 values
+(unix_timestamp("2004-01-01 00:00:00"), "2004-01-01 00:00:00");
+insert into t1 values
+(unix_timestamp("2004-03-28 01:59:59"), "2004-03-28 01:59:59"),
+(unix_timestamp("2004-03-28 02:30:00"), "2004-03-28 02:30:00"),
+(unix_timestamp("2004-03-28 03:00:00"), "2004-03-28 03:00:00");
+insert into t1 values
+(unix_timestamp('2004-05-01 00:00:00'),'2004-05-01 00:00:00');
+insert into t1 values
+(unix_timestamp('2004-10-31 01:00:00'),'2004-10-31 01:00:00'),
+(unix_timestamp('2004-10-31 02:00:00'),'2004-10-31 02:00:00'),
+(unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'),
+(unix_timestamp('2004-10-31 04:00:00'),'2004-10-31 04:00:00'),
+(unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59');
+insert into t1 values
+(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'),
+(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00');
+select i, from_unixtime(i), c from t1;
+i from_unixtime(i) c
+1072904422 2004-01-01 00:00:00 2004-01-01 00:00:00
+1080428421 2004-03-28 01:59:59 2004-03-28 01:59:59
+1080428422 2004-03-28 03:00:00 2004-03-28 02:30:00
+1080428422 2004-03-28 03:00:00 2004-03-28 03:00:00
+1083355222 2004-05-01 00:00:00 2004-05-01 00:00:00
+1099170022 2004-10-31 01:00:00 2004-10-31 01:00:00
+1099177222 2004-10-31 02:00:00 2004-10-31 02:00:00
+1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59
+1099184422 2004-10-31 04:00:00 2004-10-31 04:00:00
+1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59
+362793608 1981-07-01 03:59:59 1981-07-01 03:59:59
+362793610 1981-07-01 04:00:00 1981-07-01 04:00:00
+drop table t1;
+create table t1 (ts timestamp);
+insert into t1 values (19730101235900), (20040101235900);
+select * from t1;
+ts
+1973-01-01 23:59:00
+2004-01-01 23:59:00
+drop table t1;
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 2a2e10dbbd5..b45aaea0cbe 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -174,3 +174,15 @@ create trigger tx1 before insert on t1 for each row set new.x1col = 'x';
insert into t1 values ('y');
drop trigger t1.tx1;
drop table t1;
+create table t1 (i int) engine=myisam;
+insert into t1 values (1), (2);
+create trigger trg1 before delete on t1 for each row set @del_before:= @del_before + old.i;
+create trigger trg2 after delete on t1 for each row set @del_after:= @del_after + old.i;
+set @del_before:=0, @del_after:= 0;
+delete from t1;
+select @del_before, @del_after;
+@del_before @del_after
+3 3
+drop trigger t1.trg1;
+drop trigger t1.trg2;
+drop table t1;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 18fa7c2e374..f41e6c7e165 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1221,11 +1221,11 @@ ERROR 42000: FUNCTION test.x1 does not exist
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
-v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
+v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL FUNCTION test.x1 does not exist
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
-v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
+v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL FUNCTION test.x1 does not exist
drop view v1;
drop table t1;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;