diff options
Diffstat (limited to 'mysql-test/r')
62 files changed, 1439 insertions, 335 deletions
diff --git a/mysql-test/r/blackhole.result b/mysql-test/r/blackhole.result new file mode 100644 index 00000000000..a3053075de5 --- /dev/null +++ b/mysql-test/r/blackhole.result @@ -0,0 +1,86 @@ +drop table if exists t1,t2; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +) ENGINE=blackhole; +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +select * from t1; +Period Varor_period +select t1.* from t1; +Period Varor_period +CREATE TABLE t2 ( +auto int NOT NULL auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +primary key (auto) +) ENGINE=blackhole; +INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky',''); +INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly',''); +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +select fld3 from t2 order by fld3 desc limit 10; +fld3 +select fld3 from t2 order by fld3 desc limit 5; +fld3 +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)); +INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), +('Full-text indexes', 'are called collections'), +('Only MyISAM tables','support collections'), +('Function MATCH ... AGAINST()','is used to do a search'), +('Full-text search in MySQL', 'implements vector space model'); +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT +t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT +select * from t1 where MATCH(a,b) AGAINST ("collections"); +a b +Only MyISAM tables support collections +Full-text indexes are called collections +explain extended select * from t1 where MATCH(a,b) AGAINST ("collections"); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 fulltext a a 0 1 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against (_latin1'collections')) +select * from t1 where MATCH(a,b) AGAINST ("indexes"); +a b +Full-text indexes are called collections +select * from t1 where MATCH(a,b) AGAINST ("indexes collections"); +a b +Full-text indexes are called collections +Only MyISAM tables support collections +select * from t1 where MATCH(a,b) AGAINST ("only"); +a b +drop table if exists t1,t2; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 8f4ee3d0558..c63704f6d9d 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -77,3 +77,10 @@ big5_bin 6109 big5_bin 61 big5_bin 6120 drop table t1; +SET NAMES big5; +CREATE TABLE t1 (a text) character set big5; +INSERT INTO t1 VALUES ('ùØ'); +SELECT * FROM t1; +a +ùØ +DROP TABLE t1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 647f8c6236c..c65055e726d 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -1,6 +1,6 @@ drop table if exists t1; SET NAMES cp1251; -create table t1 (a varchar(10) not null); +create table t1 (a varchar(10) not null) character set cp1251; insert into t1 values ("a"),("ab"),("abc"); select * from t1; a @@ -23,7 +23,7 @@ a b c drop table t1; -create table t1 (a char(15) binary, b binary(15)); +create table t1 (a char(15) binary, b binary(15)) character set cp1251; insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; upper(a) upper(b) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index a734ad78e04..868bdd90051 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -642,3 +642,11 @@ Warnings: Warning 1264 Out of range value adjusted for column 'Field1' at row 1 DROP TABLE t1; SET NAMES latin1; +CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); +INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); +update t1 set b=a; +SELECT * FROM t1; +a b +1.1 1.100 +2.1 2.100 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 7fe8e76cb5b..490cde82ca3 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -871,3 +871,17 @@ drop table t1; select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8); convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8) 1 +set names latin1; +create table t1 (a varchar(10)) character set utf8; +insert into t1 values ('test'); +select ifnull(a,'') from t1; +ifnull(a,'') +test +drop table t1; +select repeat(_utf8'+',3) as h union select NULL; +h ++++ +NULL +select ifnull(NULL, _utf8'string'); +ifnull(NULL, _utf8'string') +string diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 2db014c4a52..8217a0e7ba6 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -79,6 +79,11 @@ concat('%d-%m-%Y',' ','%H:%i:%s.%f')); str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')) 2001-01-15 02:59:58.999000 +select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T'); +STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T') +NULL +Warnings: +Error 1411 Incorrect time value: '22.30.61' for function str_to_time create table t1 (date char(30), format char(30) not null); insert into t1 values ('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), @@ -335,6 +340,22 @@ Tuesday 52 2001 %W %V %Y NULL Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL +Warnings: +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time select date,format,concat(str_to_date(date, format),'') as con from t1; date format con 2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL @@ -353,6 +374,22 @@ Tuesday 52 2001 %W %V %Y NULL Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL +Warnings: +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time truncate table t1; insert into t1 values ('10:20:10AM', '%h:%i:%s'), @@ -391,6 +428,8 @@ NULL select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')); str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')) NULL +Warnings: +Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_time explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index a012550ef5f..6c815e94b7c 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -106,7 +106,7 @@ CREATE TABLE federated.`t1%` ( `name` varchar(32) NOT NULL default '' ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 -COMMENT='mysql://root@127.0.0.1:9308/federated/t1%'; +COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1%'; INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo'); INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee'); SELECT * FROM federated.`t1%`; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 3e06018226d..1cf1a19056b 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -783,7 +783,7 @@ insert into t1 values (now()); create table t2 select f2 from (select max(now()) f2 from t1) a; show columns from t2; Field Type Null Key Default Extra -f2 datetime NO 0000-00-00 00:00:00 +f2 datetime YES NULL drop table t2; create table t2 select f2 from (select now() f2 from t1) a; show columns from t2; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 15a650eccfa..1c2cfeca01e 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -639,6 +639,26 @@ drop table t1; select charset(null), collation(null), coercibility(null); charset(null) collation(null) coercibility(null) binary binary 5 +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (a int, b int); +INSERT INTO t1 VALUES (1,1),(2,2); +INSERT INTO t2 VALUES (2,2),(3,3); +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) +where collation(t2.a) = _utf8'binary' order by t1.a,t2.a; +a b a b +1 1 NULL NULL +2 2 2 2 +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) +where charset(t2.a) = _utf8'binary' order by t1.a,t2.a; +a b a b +1 1 NULL NULL +2 2 2 2 +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) +where coercibility(t2.a) = 2 order by t1.a,t2.a; +a b a b +1 1 NULL NULL +2 2 2 2 +DROP TABLE t1, t2; select SUBSTR('abcdefg',3,2); SUBSTR('abcdefg',3,2) cd diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 9aa936f1c78..5ec5d7d724e 100644 --- a/mysql-test/r/func_system.result +++ b/mysql-test/r/func_system.result @@ -75,4 +75,8 @@ select * from t1 where a=database(); a select * from t1 where a=user(); a +insert into t1 values ('a'); +select left(concat(a,version()),1) from t1; +left(concat(a,version()),1) +a drop table t1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index e5f7f535ae2..ecd2758fd1c 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -10,8 +10,8 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3 GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' grant delete on mysqltest.* to mysqltest_1@localhost; select * from mysql.user where user="mysqltest_1"; -Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections -localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0 +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0 show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' @@ -41,15 +41,15 @@ delete from mysql.user where user='mysqltest_1'; flush privileges; grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; select * from mysql.user where user="mysqltest_1"; -Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections -localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0 +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0 show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; select * from mysql.user where user="mysqltest_1"; -Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections -localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0 +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0 show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 @@ -440,6 +440,7 @@ Create Databases,Tables,Indexes To create new databases and tables Create routine Functions,Procedures To use CREATE FUNCTION/PROCEDURE Create temporary tables Databases To use CREATE TEMPORARY TABLE Create view Tables To create new views +Create user Server Admin To create new users Delete Tables To delete existing rows Drop Databases,Tables To drop databases, tables, and views Execute Functions,Procedures To execute stored routines diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index e6db7bd682f..b7639d49c7d 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -1,11 +1,13 @@ SET NAMES binary; drop database if exists mysqltest; +drop database if exists mysqltest_1; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; grant all privileges on `my\_1`.* to mysqltest_1@localhost with grant option; +grant create user on *.* to mysqltest_1@localhost; create user mysqltest_2@localhost; grant select on `my\_1`.* to mysqltest_2@localhost; grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass'; @@ -13,7 +15,6 @@ ERROR 42000: You must have privileges to update tables in the mysql database to grant update on mysql.* to mysqltest_1@localhost; grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass'; grant select on `my\_1`.* to mysqltest_3@localhost; -ERROR 42000: 'mysqltest_1'@'localhost' is not allowed to create new users grant insert on mysql.* to mysqltest_1@localhost; grant select on `my\_1`.* to mysqltest_3@localhost; grant select on `my\_1`.* to mysqltest_4@localhost identified by 'pass'; @@ -23,14 +24,11 @@ delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option; +grant create user on *.* to mysqltest_1@localhost; select current_user(); current_user() mysqltest_1@localhost -select current_user; -current_user -mysqltest_1@localhost grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option; -ERROR 42000: 'mysqltest_1'@'localhost' is not allowed to create new users grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'my_%' set @@sql_mode='NO_AUTO_CREATE_USER'; @@ -38,21 +36,42 @@ select @@sql_mode; @@sql_mode NO_AUTO_CREATE_USER grant select on `my\_1`.* to mysqltest_4@localhost with grant option; -ERROR 42000: 'mysqltest_1'@'localhost' is not allowed to create new users +ERROR 42000: Can't find any matching row in the user table grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass' with grant option; -ERROR 42000: 'mysqltest_1'@'localhost' is not allowed to create new users show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost -GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT CREATE USER ON *.* TO 'mysqltest_1'@'localhost' GRANT ALL PRIVILEGES ON `my\_%`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION show grants for mysqltest_2@localhost; -ERROR 42000: There is no such grant defined for user 'mysqltest_2' on host 'localhost' +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +GRANT ALL PRIVILEGES ON `my\_1`.* TO 'mysqltest_2'@'localhost' WITH GRANT OPTION show grants for mysqltest_3@localhost; ERROR 42000: There is no such grant defined for user 'mysqltest_3' on host 'localhost' delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; +create database mysqltest_1; +grant all privileges on `mysqltest\_1`.* to mysqltest_1@localhost with grant option; +select current_user(); +current_user() +mysqltest_1@localhost +show databases; +Database +information_schema +mysqltest_1 +test +grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option; +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest_1' +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `mysqltest\_1`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +drop database mysqltest_1; +flush privileges; create database mysqltest; grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost; flush privileges; @@ -77,9 +96,9 @@ flush privileges; create table t1 (a int, b int); grant select (a) on t1 to mysqltest_1@localhost with grant option; grant select (a,b) on t1 to mysqltest_2@localhost; -ERROR 42000: 'mysqltest_1'@'localhost' is not allowed to create new users +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't1' grant select on t1 to mysqltest_3@localhost; -ERROR 42000: 'mysqltest_1'@'localhost' is not allowed to create new users +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1' drop table t1; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; @@ -164,8 +183,6 @@ GRANT INSERT ON "test".* TO 'mysqltest_1'@'%' GRANT UPDATE (c2) ON "test"."t2" TO 'mysqltest_1'@'%' GRANT UPDATE ON "test"."t1" TO 'mysqltest_1'@'%' drop user 'mysqltest_1', 'mysqltest_3'; -grant all on test.t1 to 'mysqltest_1'; -ERROR 42000: 'root'@'localhost' is not allowed to create new users drop user 'mysqltest_1'; ERROR HY000: Operation DROP USER failed for 'mysqltest_1'@'%' drop table t1, t2; @@ -228,7 +245,7 @@ GRANT USAGE ON *.* TO '%@a'@'a' GRANT SELECT ON "mysql".* TO '%@a'@'a' drop user '%@a'@'a'; create user mysqltest_2@localhost; -grant usage on *.* to mysqltest_2@localhost with grant option; +grant create user on *.* to mysqltest_2@localhost; select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 'user' create user mysqltest_A@'%'; @@ -236,19 +253,17 @@ rename user mysqltest_A@'%' to mysqltest_B@'%'; drop user mysqltest_B@'%'; drop user mysqltest_2@localhost; create user mysqltest_3@localhost; -grant all privileges on mysql.* to mysqltest_3@localhost; +grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost; +show grants; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO 'mysqltest_3'@'localhost' select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; -host user password -% mysqltest_2 *BD447CBA355AF58578D3AE33BA2E2CD388BA08D1 -localhost mysqltest_3 +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user' insert into mysql.user set host='%', user='mysqltest_B'; create user mysqltest_A@'%'; -ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysql' rename user mysqltest_B@'%' to mysqltest_C@'%'; -ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysql' -drop user mysqltest_B@'%'; -ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysql' -drop user mysqltest_B@'%'; +drop user mysqltest_C@'%'; drop user mysqltest_3@localhost; set @@sql_mode=''; create database mysqltest_1; diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result new file mode 100644 index 00000000000..6193c4fd49d --- /dev/null +++ b/mysql-test/r/grant3.result @@ -0,0 +1,18 @@ +SET NAMES binary; +drop table if exists t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; +create user mysqltest_1@localhost; +grant create user on *.* to mysqltest_1@localhost; +grant select on `my\_1`.* to mysqltest_1@localhost with grant option; +grant select on `my\_1`.* to mysqltest_2@localhost; +ERROR 42000: You are not allowed to create a user with GRANT +create user mysqltest_2@localhost; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index a43e67d57e6..af69cc83e83 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -677,3 +677,28 @@ select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0; d 10 drop table t1; +create table t1(a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(8),(9); +create table t2 ( +a int, +b varchar(200) NOT NULL, +c varchar(50) NOT NULL, +d varchar(100) NOT NULL, +primary key (a,b(132),c,d), +key a (a,b) +) charset=utf8; +insert into t2 select +x3.a, -- 3 +concat('val-', x3.a + 3*x4.a), -- 12 +concat('val-', @a:=x3.a + 3*x4.a + 12*C.a), -- 120 +concat('val-', @a + 120*D.a) +from t1 x3, t1 x4, t1 C, t1 D where x3.a < 3 and x4.a < 4 and D.a < 4; +delete from t2 where a = 2 and b = 'val-2' order by a,b,c,d limit 30; +explain select c from t2 where a = 2 and b = 'val-2' group by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref PRIMARY,a PRIMARY 402 const,const 6 Using where +select c from t2 where a = 2 and b = 'val-2' group by c; +c +val-74 +val-98 +drop table t1,t2; diff --git a/mysql-test/r/have_blackhole.require b/mysql-test/r/have_blackhole.require new file mode 100644 index 00000000000..15029a460f6 --- /dev/null +++ b/mysql-test/r/have_blackhole.require @@ -0,0 +1,2 @@ +Variable_name Value +have_blackhole_engine YES diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index dc456e80e63..03c2cd8817c 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -118,8 +118,8 @@ t2 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 # 1024 0 NULL # # NULL latin1_swedish_ci NULL -t3 MyISAM 9 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL +t2 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL +t3 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL v1 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 @@ -432,7 +432,6 @@ information_schema.tables) union select version from information_schema.tables; s1 0 -9 10 drop table t1; SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets; @@ -442,7 +441,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` ( `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '', `DESCRIPTION` varchar(60) NOT NULL default '', `MAXLEN` bigint(3) NOT NULL default '0' -) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=1818 +) ENGINE=MEMORY DEFAULT CHARSET=utf8 set names latin2; SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets; Table Create Table @@ -451,7 +450,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` ( `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '', `DESCRIPTION` varchar(60) NOT NULL default '', `MAXLEN` bigint(3) NOT NULL default '0' -) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=1818 +) ENGINE=MEMORY DEFAULT CHARSET=utf8 set names latin1; create table t1 select * from information_schema.CHARACTER_SETS where CHARACTER_SET_NAME like "latin1"; @@ -652,6 +651,8 @@ drop table t1, t2; CREATE TABLE t_crashme ( f1 BIGINT); CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; +count(*) +100 drop view a2, a1; drop table t_crashme; select table_schema,table_name, column_name from diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index f57c134b6d0..2413834be4f 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -5,6 +5,12 @@ select ((@id := kill_id) - kill_id) from t1; ((@id := kill_id) - kill_id) 0 kill @id; +select ((@id := kill_id) - kill_id) from t1; +((@id := kill_id) - kill_id) +0 +select @id != connection_id(); +@id != connection_id() +1 select 4; 4 4 diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 6a2cf466cfa..b5d5785f0f1 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -1,6 +1,6 @@ drop table if exists t1,t2; select 1, 1.0, -1, "hello", NULL; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def 1 8 1 1 N 32897 0 63 def 1.0 246 4 3 N 161 1 63 def -1 8 2 2 N 32897 0 63 @@ -10,7 +10,7 @@ def NULL 6 0 0 Y 32896 0 63 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)); select * from t1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 a a 1 4 0 Y 32768 0 63 def test t1 t1 b b 2 6 0 Y 32768 0 63 def test t1 t1 c c 9 9 0 Y 32768 0 63 @@ -28,7 +28,7 @@ def test t1 t1 n n 254 3 0 Y 2048 0 8 def test t1 t1 o o 254 10 0 Y 0 0 8 a b c d e f g h i j k l m n o select a b, b c from t1 as t2; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t2 a b 1 4 0 Y 32768 0 63 def test t1 t2 b c 2 6 0 Y 32768 0 63 b c @@ -38,7 +38,7 @@ INSERT INTO t1 VALUES (1,'male'),(2,'female'); CREATE TABLE t2 (id tinyint(3) unsigned default NULL, data char(3) default '0'); INSERT INTO t2 VALUES (1,'yes'),(2,'no'); select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 id id 1 3 1 Y 32768 0 63 def test t1 t1 data data 253 255 6 Y 0 0 8 def test t2 t2 data data 254 3 3 Y 0 0 8 @@ -46,7 +46,7 @@ id data data 1 male yes 2 female no select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 id id 1 3 1 Y 32768 0 63 def test t1 t1 data data 253 255 6 Y 0 0 8 def test t2 t2 data data 254 3 3 Y 0 0 8 @@ -54,9 +54,34 @@ id data data 1 male yes 2 female no select t1.id from t1 union select t2.id from t2; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 t1 id id 1 3 1 Y 32768 0 63 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def id id 1 4 1 Y 32768 0 63 id 1 2 drop table t1,t2; +create table t1 ( a int, b varchar(30), primary key(a)); +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +set @arg00=1 ; +select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @arg00 @arg00 8 20 1 Y 32768 0 63 +@arg00 +1 +select * from (select @arg00) aaa; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def aaa @arg00 @arg00 8 20 1 Y 32768 0 63 +@arg00 +1 +select 1 union select 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def 1 1 8 20 1 N 32769 0 63 +1 +1 +select * from (select 1 union select 1) aaa; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def aaa 1 1 8 20 1 N 32769 0 63 +1 +1 +drop table t1; diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result index a5f4915384d..7821c074202 100644 --- a/mysql-test/r/mix_innodb_myisam_binlog.result +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -9,9 +9,9 @@ commit; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(1) -master-bin.000001 255 Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 350 Xid 1 # COMMIT /* xid=7 */ +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(1) +master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 347 Xid 1 # COMMIT /* xid=7 */ delete from t1; delete from t2; reset master; @@ -24,9 +24,9 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(2) -master-bin.000001 255 Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 350 Query 1 # use `test`; ROLLBACK +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(2) +master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 347 Query 1 # use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -42,12 +42,12 @@ commit; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(3) -master-bin.000001 255 Query 1 # use `test`; savepoint my_savepoint -master-bin.000001 341 Query 1 # use `test`; insert into t1 values(4) -master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 524 Query 1 # use `test`; rollback to savepoint my_savepoint -master-bin.000001 622 Xid 1 # COMMIT /* xid=24 */ +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(3) +master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint +master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4) +master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint +master-bin.000001 616 Xid 1 # COMMIT /* xid=24 */ delete from t1; delete from t2; reset master; @@ -68,13 +68,13 @@ a show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(5) -master-bin.000001 255 Query 1 # use `test`; savepoint my_savepoint -master-bin.000001 341 Query 1 # use `test`; insert into t1 values(6) -master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 524 Query 1 # use `test`; rollback to savepoint my_savepoint -master-bin.000001 622 Query 1 # use `test`; insert into t1 values(7) -master-bin.000001 710 Xid 1 # COMMIT /* xid=36 */ +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(5) +master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint +master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6) +master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint +master-bin.000001 616 Query 1 # use `test`; insert into t1 values(7) +master-bin.000001 703 Xid 1 # COMMIT /* xid=36 */ delete from t1; delete from t2; reset master; @@ -90,9 +90,9 @@ get_lock("a",10) show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(8) -master-bin.000001 255 Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 350 Query 1 # use `test`; ROLLBACK +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(8) +master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 347 Query 1 # use `test`; ROLLBACK delete from t1; delete from t2; reset master; @@ -101,8 +101,8 @@ insert into t2 select * from t1; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; insert into t1 values(9) -master-bin.000001 186 Xid 1 # COMMIT /* xid=59 */ -master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 185 Xid 1 # COMMIT /* xid=59 */ +master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1 delete from t1; delete from t2; reset master; @@ -112,18 +112,18 @@ insert into t2 select * from t1; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10) -master-bin.000001 187 Xid 1 # COMMIT /* xid=65 */ -master-bin.000001 214 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 186 Xid 1 # COMMIT /* xid=65 */ +master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1 insert into t1 values(11); commit; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10) -master-bin.000001 187 Xid 1 # COMMIT /* xid=65 */ -master-bin.000001 214 Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 309 Query 1 # use `test`; BEGIN -master-bin.000001 378 Query 1 # use `test`; insert into t1 values(11) -master-bin.000001 467 Xid 1 # COMMIT /* xid=67 */ +master-bin.000001 186 Xid 1 # COMMIT /* xid=65 */ +master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 307 Query 1 # use `test`; BEGIN +master-bin.000001 375 Query 1 # use `test`; insert into t1 values(11) +master-bin.000001 463 Xid 1 # COMMIT /* xid=67 */ alter table t2 engine=INNODB; delete from t1; delete from t2; @@ -135,9 +135,9 @@ commit; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(12) -master-bin.000001 256 Query 1 # use `test`; insert into t2 select * from t1 -master-bin.000001 351 Xid 1 # COMMIT /* xid=77 */ +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(12) +master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1 +master-bin.000001 348 Xid 1 # COMMIT /* xid=77 */ delete from t1; delete from t2; reset master; @@ -160,8 +160,8 @@ commit; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(14) -master-bin.000001 256 Xid 1 # COMMIT /* xid=93 */ +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(14) +master-bin.000001 254 Xid 1 # COMMIT /* xid=93 */ delete from t1; delete from t2; reset master; @@ -180,9 +180,9 @@ a show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 98 Query 1 # use `test`; BEGIN -master-bin.000001 167 Query 1 # use `test`; insert into t1 values(16) -master-bin.000001 256 Query 1 # use `test`; insert into t1 values(18) -master-bin.000001 345 Xid 1 # COMMIT /* xid=104 */ +master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16) +master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18) +master-bin.000001 342 Xid 1 # COMMIT /* xid=104 */ delete from t1; delete from t2; alter table t2 type=MyISAM; diff --git a/mysql-test/r/mysqlshow.result b/mysql-test/r/mysqlshow.result new file mode 100644 index 00000000000..a04a7081b34 --- /dev/null +++ b/mysql-test/r/mysqlshow.result @@ -0,0 +1,76 @@ +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +CREATE TABLE t2 (a int, b int); +show tables; +Tables_in_test +t1 +t2 +select "--------------------" as ""; + +-------------------- +Database: test ++--------+ +| Tables | ++--------+ +| t1 | +| t2 | ++--------+ +select "---- -v ------------" as ""; + +---- -v ------------ +Database: test ++--------+----------+ +| Tables | Columns | ++--------+----------+ +| t1 | 1 | +| t2 | 2 | ++--------+----------+ +2 rows in set. + +select "---- -v -v ---------" as ""; + +---- -v -v --------- +Database: test ++--------+----------+------------+ +| Tables | Columns | Total Rows | ++--------+----------+------------+ +| t1 | 1 | 3 | +| t2 | 2 | 0 | ++--------+----------+------------+ +2 rows in set. + +select "----- -t -----------" as ""; + +----- -t ----------- +Database: test ++--------+------------+ +| Tables | table_type | ++--------+------------+ +| t1 | BASE TABLE | +| t2 | BASE TABLE | ++--------+------------+ +select "---- -v -t ---------" as ""; + +---- -v -t --------- +Database: test ++--------+------------+----------+ +| Tables | table_type | Columns | ++--------+------------+----------+ +| t1 | BASE TABLE | 1 | +| t2 | BASE TABLE | 2 | ++--------+------------+----------+ +2 rows in set. + +select "---- -v -v -t ------" as ""; + +---- -v -v -t ------ +Database: test ++--------+------------+----------+------------+ +| Tables | table_type | Columns | Total Rows | ++--------+------------+----------+------------+ +| t1 | BASE TABLE | 1 | 3 | +| t2 | BASE TABLE | 2 | 0 | ++--------+------------+----------+------------+ +2 rows in set. + +DROP TABLE t1, t2; diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 38b34579f03..27ebda36669 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -144,8 +144,8 @@ Handler_discover 1 flush tables; 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 -t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL # -t7 ndbcluster 9 Fixed 1 276 # # # 0 NULL # # NULL # NULL # +t6 MyISAM 10 Fixed 1 260 # # # 0 NULL # # NULL # NULL # +t7 ndbcluster 10 Fixed 1 276 # # # 0 NULL # # NULL # NULL # show status like 'handler_discover%'; Variable_name Value Handler_discover 2 diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 4863cb5b75e..91e52841c3b 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -378,6 +378,51 @@ a sum(b) 2 6 4 4 NULL 14 +SELECT b, a, sum(b) FROM t1 GROUP BY a,b WITH ROLLUP; +b a sum(b) +4 1 4 +NULL 1 4 +1 2 2 +2 2 4 +NULL 2 6 +1 4 4 +NULL 4 4 +NULL NULL 14 +SELECT DISTINCT b,a, sum(b) FROM t1 GROUP BY a,b WITH ROLLUP; +b a sum(b) +4 1 4 +NULL 1 4 +1 2 2 +2 2 4 +NULL 2 6 +1 4 4 +NULL 4 4 +NULL NULL 14 +ALTER TABLE t1 ADD COLUMN c INT; +SELECT a,b,sum(c) FROM t1 GROUP BY a,b,c WITH ROLLUP; +a b sum(c) +1 4 NULL +1 4 NULL +1 NULL NULL +2 1 NULL +2 1 NULL +2 2 NULL +2 2 NULL +2 NULL NULL +4 1 NULL +4 1 NULL +4 NULL NULL +NULL NULL NULL +SELECT distinct a,b,sum(c) FROM t1 GROUP BY a,b,c WITH ROLLUP; +a b sum(c) +1 4 NULL +1 NULL NULL +2 1 NULL +2 2 NULL +2 NULL NULL +4 1 NULL +4 NULL NULL +NULL NULL NULL DROP TABLE t1; CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index f7cb17a1a74..035c84431f8 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -10,22 +10,22 @@ select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user 'ssl_user1'@'localhost' to database 'test' +ERROR 42000: DELETE command denied to user 'ssl_user1'@'localhost' for table 't1' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user 'ssl_user2'@'localhost' to database 'test' +ERROR 42000: DELETE command denied to user 'ssl_user2'@'localhost' for table 't1' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user 'ssl_user3'@'localhost' to database 'test' +ERROR 42000: DELETE command denied to user 'ssl_user3'@'localhost' for table 't1' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user 'ssl_user4'@'localhost' to database 'test' +ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1' delete from mysql.user where user='ssl_user%'; delete from mysql.db where user='ssl_user%'; flush privileges; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index cd3c8e162f7..06acb72f49b 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -290,7 +290,7 @@ t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE prepare stmt4 from ' show table status from test like ''t2%'' '; execute stmt4; 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 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL +t2 MyISAM 10 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show table status from test like ''t9%'' '; execute stmt4; 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 @@ -342,6 +342,7 @@ EXAMPLE YES/NO Example storage engine ARCHIVE YES/NO Archive storage engine CSV YES/NO CSV storage engine FEDERATED YES/NO Federated MySQL storage engine +BLACKHOLE YES/NO /dev/null storage engine (anything you write to it disappears) drop table if exists t5; prepare stmt1 from ' drop table if exists t5 ' ; execute stmt1 ; @@ -483,7 +484,7 @@ prepare stmt1 from ' KILL 0 '; ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt1 from ' explain select a from t1 order by b '; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -499,7 +500,7 @@ id select_type table type possible_keys key key_len ref rows Extra SET @arg00=1 ; prepare stmt1 from ' explain select a from t1 where a > ? order by b '; execute stmt1 using @arg00; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 14b7e8a7069..37c3682cacd 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -48,7 +48,7 @@ test_sequence ------ simple select tests ------ prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 @@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two +prepare stmt1 from 'select c4 FROM t9 where + c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ; +execute stmt1 using @arg01, @arg02; +c4 prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; @@ -1144,7 +1148,7 @@ test_sequence ------ explain select tests ------ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -1799,7 +1803,7 @@ t5 CREATE TABLE `t5` ( `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 3 3 N 1 1 63 @@ -1911,7 +1915,7 @@ from t9 where c1= 1 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -1958,7 +1962,7 @@ from t9 where c1= 0 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2008,7 +2012,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2048,7 +2052,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2096,7 +2100,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 1 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2140,7 +2144,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 0 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2186,7 +2190,7 @@ from t9 where c1= ?" ; set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2224,7 +2228,7 @@ def @arg32 253 8192 6 Y 0 31 8 set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 9a0927a9a5c..d56fcb96726 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -48,7 +48,7 @@ test_sequence ------ simple select tests ------ prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 @@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two +prepare stmt1 from 'select c4 FROM t9 where + c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ; +execute stmt1 using @arg01, @arg02; +c4 prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; @@ -1144,7 +1148,7 @@ test_sequence ------ explain select tests ------ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -1782,7 +1786,7 @@ t5 CREATE TABLE `t5` ( `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 3 3 N 1 1 63 @@ -1894,7 +1898,7 @@ from t9 where c1= 1 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -1941,7 +1945,7 @@ from t9 where c1= 0 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -1991,7 +1995,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2031,7 +2035,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2079,7 +2083,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 1 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2123,7 +2127,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 0 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2169,7 +2173,7 @@ from t9 where c1= ?" ; set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2207,7 +2211,7 @@ def @arg32 253 8192 6 Y 0 31 8 set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 37dd8cb263e..899299fa36c 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -49,7 +49,7 @@ test_sequence ------ simple select tests ------ prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 @@ -769,6 +769,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two +prepare stmt1 from 'select c4 FROM t9 where + c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ; +execute stmt1 using @arg01, @arg02; +c4 prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; @@ -1145,7 +1149,7 @@ test_sequence ------ explain select tests ------ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -1783,7 +1787,7 @@ t5 CREATE TABLE `t5` ( `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 3 3 N 1 1 63 @@ -1895,7 +1899,7 @@ from t9 where c1= 1 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -1942,7 +1946,7 @@ from t9 where c1= 0 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -1992,7 +1996,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2032,7 +2036,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2080,7 +2084,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 1 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2124,7 +2128,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 0 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2170,7 +2174,7 @@ from t9 where c1= ?" ; set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2208,7 +2212,7 @@ def @arg32 253 8192 6 Y 0 31 8 set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 867d410ebf1..4a53fe47f3f 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -91,7 +91,7 @@ test_sequence ------ simple select tests ------ prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 @@ -811,6 +811,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two +prepare stmt1 from 'select c4 FROM t9 where + c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ; +execute stmt1 using @arg01, @arg02; +c4 prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; @@ -1187,7 +1191,7 @@ test_sequence ------ explain select tests ------ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -1719,7 +1723,7 @@ t5 CREATE TABLE `t5` ( `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 3 3 N 1 1 63 @@ -1831,7 +1835,7 @@ from t9 where c1= 1 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -1878,7 +1882,7 @@ from t9 where c1= 0 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -1928,7 +1932,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -1968,7 +1972,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2016,7 +2020,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 1 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2060,7 +2064,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 0 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2106,7 +2110,7 @@ from t9 where c1= ?" ; set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2144,7 +2148,7 @@ def @arg32 253 8192 6 Y 0 31 8 set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -3100,7 +3104,7 @@ test_sequence ------ simple select tests ------ prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 @@ -3820,6 +3824,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two +prepare stmt1 from 'select c4 FROM t9 where + c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ; +execute stmt1 using @arg01, @arg02; +c4 prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; @@ -4196,7 +4204,7 @@ test_sequence ------ explain select tests ------ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -4728,7 +4736,7 @@ t5 CREATE TABLE `t5` ( `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 3 3 N 1 1 63 @@ -4840,7 +4848,7 @@ from t9 where c1= 1 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -4887,7 +4895,7 @@ from t9 where c1= 0 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -4937,7 +4945,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -4977,7 +4985,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -5025,7 +5033,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 1 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -5069,7 +5077,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 0 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -5115,7 +5123,7 @@ from t9 where c1= ?" ; set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -5153,7 +5161,7 @@ def @arg32 253 8192 6 Y 0 31 8 set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index c02215ad750..8ea5b092b5e 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -48,7 +48,7 @@ test_sequence ------ simple select tests ------ prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 @@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two +prepare stmt1 from 'select c4 FROM t9 where + c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ; +execute stmt1 using @arg01, @arg02; +c4 prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; @@ -1144,7 +1148,7 @@ test_sequence ------ explain select tests ------ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -1782,7 +1786,7 @@ t5 CREATE TABLE `t5` ( `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 3 3 N 1 1 63 @@ -1894,7 +1898,7 @@ from t9 where c1= 1 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -1941,7 +1945,7 @@ from t9 where c1= 0 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -1991,7 +1995,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2031,7 +2035,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2079,7 +2083,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 1 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2123,7 +2127,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 0 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2169,7 +2173,7 @@ from t9 where c1= ?" ; set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2207,7 +2211,7 @@ def @arg32 253 8192 6 Y 0 31 8 set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index f544dda798b..ec8c47031c1 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -48,7 +48,7 @@ test_sequence ------ simple select tests ------ prepare stmt1 from ' select * from t9 order by c1 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t9 t9 c1 c1 1 4 1 N 49155 0 63 def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 @@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; a ? b 2 1 two +prepare stmt1 from 'select c4 FROM t9 where + c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ; +execute stmt1 using @arg01, @arg02; +c4 prepare stmt1 from ' select a, b FROM t1 outer_table where a = (select a from t1 where b = outer_table.b ) order by a '; execute stmt1 ; @@ -1144,7 +1148,7 @@ test_sequence ------ explain select tests ------ prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 @@ -1782,7 +1786,7 @@ t5 CREATE TABLE `t5` ( `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 def test t5 t5 const02 const02 246 3 3 N 1 1 63 @@ -1894,7 +1898,7 @@ from t9 where c1= 1 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -1941,7 +1945,7 @@ from t9 where c1= 0 ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -1991,7 +1995,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2031,7 +2035,7 @@ execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2079,7 +2083,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 1 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2123,7 +2127,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 from t9 where c1= 0 ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 @@ -2169,7 +2173,7 @@ from t9 where c1= ?" ; set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 1 Y 128 31 63 def @arg03 253 20 1 Y 128 31 63 @@ -2207,7 +2211,7 @@ def @arg32 253 8192 6 Y 0 31 8 set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg01 253 20 1 Y 128 31 63 def @arg02 253 20 0 Y 128 31 63 def @arg03 253 20 0 Y 128 31 63 diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result index 6366a2d0f8f..7f2ba568fb3 100644 --- a/mysql-test/r/rpl_change_master.result +++ b/mysql-test/r/rpl_change_master.result @@ -13,11 +13,11 @@ insert into t1 values(2); stop slave; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 360 # # master-bin.000001 No No 0 0 184 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 357 # # master-bin.000001 No No 0 0 183 # None 0 No # change master to master_user='root'; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 184 # # master-bin.000001 No No 0 0 184 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 183 # # master-bin.000001 No No 0 0 183 # None 0 No # start slave; select * from t1; n diff --git a/mysql-test/r/rpl_deadlock.result b/mysql-test/r/rpl_deadlock.result index 809b7950add..866edb45cbb 100644 --- a/mysql-test/r/rpl_deadlock.result +++ b/mysql-test/r/rpl_deadlock.result @@ -8,6 +8,9 @@ create table t1 (a int not null, key(a)) engine=innodb; create table t2 (a int not null, key(a)) engine=innodb; create table t3 (a int) engine=innodb; create table t4 (a int) engine=innodb; +show variables like 'slave_transaction_retries'; +Variable_name Value +slave_transaction_retries 10 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -20,6 +23,9 @@ t2 CREATE TABLE `t2` ( `a` int(11) NOT NULL, KEY `a` (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show variables like 'slave_transaction_retries'; +Variable_name Value +slave_transaction_retries 2 stop slave; begin; insert into t3 select * from t2 for update; @@ -39,9 +45,9 @@ a 22 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19118 # # master-bin.000001 Yes Yes 0 0 19118 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 Yes Yes 0 0 18911 # None 0 No # stop slave; -change master to master_log_pos=536; +change master to master_log_pos=532; begin; select * from t2 for update; a @@ -57,10 +63,10 @@ a 22 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19118 # # master-bin.000001 Yes Yes 0 0 19118 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 Yes Yes 0 0 18911 # None 0 No # set global max_relay_log_size=0; stop slave; -change master to master_log_pos=536; +change master to master_log_pos=532; begin; select * from t2 for update; a @@ -77,5 +83,5 @@ a 22 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 19118 # # master-bin.000001 Yes Yes 0 0 19118 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 Yes Yes 0 0 18911 # None 0 No # drop table t1,t2; diff --git a/mysql-test/r/rpl_drop_temp.result b/mysql-test/r/rpl_drop_temp.result index e00309cac8f..04fe094ea26 100644 --- a/mysql-test/r/rpl_drop_temp.result +++ b/mysql-test/r/rpl_drop_temp.result @@ -10,3 +10,4 @@ create temporary table mysqltest.t2 (n int); show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +drop database mysqltest; diff --git a/mysql-test/r/rpl_error_ignored_table.result b/mysql-test/r/rpl_error_ignored_table.result index a5e025078b9..a0a808ce9a8 100644 --- a/mysql-test/r/rpl_error_ignored_table.result +++ b/mysql-test/r/rpl_error_ignored_table.result @@ -9,7 +9,7 @@ insert into t1 values (1),(1); ERROR 23000: Duplicate entry '1' for key 1 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 290 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 290 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 288 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 288 # None 0 No # show tables like 't1'; Tables_in_test (t1) drop table t1; diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result index 083db5f440d..b4e840ba271 100644 --- a/mysql-test/r/rpl_flush_log_loop.result +++ b/mysql-test/r/rpl_flush_log_loop.result @@ -14,4 +14,4 @@ start slave; flush logs; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 209 # # slave-bin.000001 Yes Yes 0 0 209 # None 0 No # +# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 208 # # slave-bin.000001 Yes Yes 0 0 208 # None 0 No # diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result index 4060910c079..dc11d10fab8 100644 --- a/mysql-test/r/rpl_loaddata.result +++ b/mysql-test/r/rpl_loaddata.result @@ -22,7 +22,7 @@ day id category name 2003-03-22 2416 a bbbbb show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -slave-bin.000001 1292 +slave-bin.000001 1286 drop table t1; drop table t2; drop table t3; @@ -33,7 +33,7 @@ set global sql_slave_skip_counter=1; start slave; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1800 # # master-bin.000001 Yes Yes 0 0 1800 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1789 # # master-bin.000001 Yes Yes 0 0 1789 # None 0 No # set sql_log_bin=0; delete from t1; set sql_log_bin=1; @@ -43,7 +43,7 @@ change master to master_user='test'; change master to master_user='root'; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1835 # # master-bin.000001 No No 0 0 1835 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1824 # # master-bin.000001 No No 0 0 1824 # None 0 No # set global sql_slave_skip_counter=1; start slave; set sql_log_bin=0; @@ -57,12 +57,25 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File # 127.0.0.1 root MASTER_PORT 1 4 # # No No 0 0 0 # None 0 No # reset master; create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), -unique(day)); +unique(day)) engine=MyISAM; load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; ERROR 23000: Duplicate entry '2003-03-22' for key 1 -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 441 +select * from t2; +day id category name +2003-02-22 2461 b a a a @ % ' " a +2003-03-22 2161 c asdf +start slave; +select * from t2; +day id category name +2003-02-22 2461 b a a a @ % ' " a +2003-03-22 2161 c asdf +alter table t2 drop key day; +delete from t2; +load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields +terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by +'\n##\n' starting by '>' ignore 1 lines; +ERROR 23000: Duplicate entry '2003-03-22' for key 1 +drop table t2; drop table t2; diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index 85b27dcad34..5d61746b984 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -20,24 +20,24 @@ drop table t1; show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key) -master-bin.000001 220 Intvar 1 248 INSERT_ID=1 -master-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL) -master-bin.000001 340 Query 1 417 use `test`; drop table t1 -master-bin.000001 417 Query 1 521 use `test`; create table t1 (word char(20) not null) -master-bin.000001 521 Begin_load_query 1 1125 ;file_id=1;block_len=581 -master-bin.000001 1125 Execute_load_query 1 1274 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1 -master-bin.000001 1274 Query 1 1351 use `test`; drop table t1 +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 219 Intvar 1 247 INSERT_ID=1 +master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) +master-bin.000001 338 Query 1 414 use `test`; drop table t1 +master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 show binlog events from 98 limit 1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) show binlog events from 98 limit 2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key) -master-bin.000001 220 Intvar 1 248 INSERT_ID=1 +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 219 Intvar 1 247 INSERT_ID=1 show binlog events from 98 limit 2,1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL) +master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) flush logs; create table t5 (a int); drop table t5; @@ -50,23 +50,23 @@ drop table t1; show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key) -master-bin.000001 220 Intvar 1 248 INSERT_ID=1 -master-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL) -master-bin.000001 340 Query 1 417 use `test`; drop table t1 -master-bin.000001 417 Query 1 521 use `test`; create table t1 (word char(20) not null) -master-bin.000001 521 Begin_load_query 1 1125 ;file_id=1;block_len=581 -master-bin.000001 1125 Execute_load_query 1 1274 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1 -master-bin.000001 1274 Query 1 1351 use `test`; drop table t1 -master-bin.000001 1351 Rotate 1 1395 master-bin.000002;pos=4 +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 219 Intvar 1 247 INSERT_ID=1 +master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) +master-bin.000001 338 Query 1 414 use `test`; drop table t1 +master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 +master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4 -master-bin.000002 98 Query 1 185 use `test`; create table t5 (a int) -master-bin.000002 185 Query 1 262 use `test`; drop table t5 -master-bin.000002 262 Query 1 349 use `test`; create table t1 (n int) -master-bin.000002 349 Query 1 438 use `test`; insert into t1 values (1) -master-bin.000002 438 Query 1 515 use `test`; drop table t1 +master-bin.000002 98 Query 1 184 use `test`; create table t5 (a int) +master-bin.000002 184 Query 1 260 use `test`; drop table t5 +master-bin.000002 260 Query 1 346 use `test`; create table t1 (n int) +master-bin.000002 346 Query 1 434 use `test`; insert into t1 values (1) +master-bin.000002 434 Query 1 510 use `test`; drop table t1 show binary logs; Log_name master-bin.000001 @@ -79,25 +79,25 @@ slave-bin.000002 show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4 -slave-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key) -slave-bin.000001 220 Intvar 1 248 INSERT_ID=1 -slave-bin.000001 248 Query 1 340 use `test`; insert into t1 values (NULL) -slave-bin.000001 340 Query 1 417 use `test`; drop table t1 -slave-bin.000001 417 Query 1 521 use `test`; create table t1 (word char(20) not null) -slave-bin.000001 521 Begin_load_query 1 1125 ;file_id=1;block_len=581 -slave-bin.000001 1125 Execute_load_query 1 1283 use `test`; load data INFILE '../../var/tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1 -slave-bin.000001 1283 Query 1 1360 use `test`; drop table t1 -slave-bin.000001 1360 Query 1 1447 use `test`; create table t5 (a int) -slave-bin.000001 1447 Query 1 1524 use `test`; drop table t5 -slave-bin.000001 1524 Rotate 2 1567 slave-bin.000002;pos=4 +slave-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +slave-bin.000001 219 Intvar 1 247 INSERT_ID=1 +slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) +slave-bin.000001 338 Query 1 414 use `test`; drop table t1 +slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) +slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 +slave-bin.000001 1121 Execute_load_query 1 1278 use `test`; load data INFILE '../../var/tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1 +slave-bin.000001 1278 Query 1 1354 use `test`; drop table t1 +slave-bin.000001 1354 Query 1 1440 use `test`; create table t5 (a int) +slave-bin.000001 1440 Query 1 1516 use `test`; drop table t5 +slave-bin.000001 1516 Rotate 2 1559 slave-bin.000002;pos=4 show binlog events in 'slave-bin.000002' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4 -slave-bin.000002 98 Query 1 185 use `test`; create table t1 (n int) -slave-bin.000002 185 Query 1 274 use `test`; insert into t1 values (1) -slave-bin.000002 274 Query 1 351 use `test`; drop table t1 +slave-bin.000002 98 Query 1 184 use `test`; create table t1 (n int) +slave-bin.000002 184 Query 1 272 use `test`; insert into t1 values (1) +slave-bin.000002 272 Query 1 348 use `test`; drop table t1 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 515 # # master-bin.000002 Yes Yes 0 0 515 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 510 # # master-bin.000002 Yes Yes 0 0 510 # None 0 No # show binlog events in 'slave-bin.000005' from 4; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log diff --git a/mysql-test/r/rpl_max_relay_size.result b/mysql-test/r/rpl_max_relay_size.result index 56cbe4d5ac8..fbe3b89828a 100644 --- a/mysql-test/r/rpl_max_relay_size.result +++ b/mysql-test/r/rpl_max_relay_size.result @@ -16,7 +16,7 @@ select @@global.max_relay_log_size; start slave; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73754 # # master-bin.000001 Yes Yes 0 0 73754 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No # stop slave; reset slave; set global max_relay_log_size=(5*4096); @@ -26,7 +26,7 @@ select @@global.max_relay_log_size; start slave; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73754 # # master-bin.000001 Yes Yes 0 0 73754 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No # stop slave; reset slave; set global max_relay_log_size=0; @@ -36,7 +36,7 @@ select @@global.max_relay_log_size; start slave; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73754 # # master-bin.000001 Yes Yes 0 0 73754 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No # stop slave; reset slave; flush logs; @@ -49,12 +49,12 @@ flush logs; create table t1 (a int); show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73841 # # master-bin.000001 Yes Yes 0 0 73841 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73038 # # master-bin.000001 Yes Yes 0 0 73038 # None 0 No # flush logs; drop table t1; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73918 # # master-bin.000001 Yes Yes 0 0 73918 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73114 # # master-bin.000001 Yes Yes 0 0 73114 # None 0 No # flush logs; show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/r/rpl_openssl.result b/mysql-test/r/rpl_openssl.result index ad7251fd631..a4ed922d9d4 100644 --- a/mysql-test/r/rpl_openssl.result +++ b/mysql-test/r/rpl_openssl.result @@ -20,11 +20,11 @@ t 1 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 replssl MASTER_MYPORT 1 master-bin.000001 289 slave-relay-bin.000001 108 master-bin.000001 Yes Yes 0 0 289 108 None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # +# 127.0.0.1 replssl MASTER_MYPORT 1 master-bin.000001 392 # # master-bin.000001 Yes Yes 0 0 392 # None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # stop slave; change master to master_user='root',master_password='', master_ssl=0; start slave; drop table t1; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 337 slave-relay-bin.000001 96 master-bin.000001 Yes Yes 0 0 337 96 None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 468 # # master-bin.000001 Yes Yes 0 0 468 # None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem # diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/r/rpl_relayrotate.result index 0135e90dce9..c79187e12d0 100644 --- a/mysql-test/r/rpl_relayrotate.result +++ b/mysql-test/r/rpl_relayrotate.result @@ -18,5 +18,5 @@ max(a) 8000 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743188 # # master-bin.000001 Yes Yes 0 0 743188 # None 0 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 735186 # # master-bin.000001 Yes Yes 0 0 735186 # None 0 No # drop table t1; diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result index 469504d06b4..8bcae3d25ad 100644 --- a/mysql-test/r/rpl_replicate_do.result +++ b/mysql-test/r/rpl_replicate_do.result @@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist drop table if exists t1,t2,t11; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1668 # # master-bin.000001 Yes Yes test.t1 0 0 1668 # None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1658 # # master-bin.000001 Yes Yes test.t1 0 0 1658 # None 0 No # diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index bd2e6dd685f..de177d12196 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -16,7 +16,7 @@ create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 552 # # master-bin.000001 Yes Yes 0 0 552 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 548 # # master-bin.000001 Yes Yes 0 0 548 # None 0 No # select * from t1; s Could not break slave @@ -57,7 +57,7 @@ master-bin.000003 insert into t2 values (65); show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 500 # # master-bin.000003 Yes Yes 0 0 500 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 496 # # master-bin.000003 Yes Yes 0 0 496 # None 0 No # select * from t2; m 34 @@ -79,13 +79,13 @@ master-bin.000004 master-bin.000005 show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000005 2146 +master-bin.000005 2032 select * from t4; a testing temporary tables part 2 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2146 # # master-bin.000005 Yes Yes 0 0 2146 # None 0 No # +# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2032 # # master-bin.000005 Yes Yes 0 0 2032 # None 0 No # lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result index 445a330f196..a76fb87a52b 100644 --- a/mysql-test/r/rpl_temporary.result +++ b/mysql-test/r/rpl_temporary.result @@ -7,12 +7,12 @@ start slave; reset master; SET @save_select_limit=@@session.sql_select_limit; SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100; -ERROR HY000: Access denied; you need the SUPER privilege for this operation +ERROR 42000: Access denied; you need the SUPER privilege for this operation SELECT @@session.sql_select_limit = @save_select_limit; @@session.sql_select_limit = @save_select_limit 1 SET @@session.sql_select_limit=10, @@session.sql_log_bin=0; -ERROR HY000: Access denied; you need the SUPER privilege for this operation +ERROR 42000: Access denied; you need the SUPER privilege for this operation SELECT @@session.sql_select_limit = @save_select_limit; @@session.sql_select_limit = @save_select_limit 1 diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result index cd2c4d099be..85637638f99 100644 --- a/mysql-test/r/rpl_timezone.result +++ b/mysql-test/r/rpl_timezone.result @@ -4,21 +4,31 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +set timestamp=100000000; create table t1 (t timestamp); create table t2 (t char(32)); select @@time_zone; @@time_zone +Japan +select @@time_zone; +@@time_zone Europe/Moscow +insert into t1 values ('20050101000000'), ('20050611093902'); set time_zone='UTC'; insert into t1 values ('20040101000000'), ('20040611093902'); select * from t1; t +2004-12-31 21:00:00 +2005-06-11 05:39:02 2004-01-01 00:00:00 2004-06-11 09:39:02 +set time_zone='UTC'; select * from t1; t -2004-01-01 03:00:00 -2004-06-11 13:39:02 +2004-12-31 21:00:00 +2005-06-11 05:39:02 +2004-01-01 00:00:00 +2004-06-11 09:39:02 delete from t1; set time_zone='Europe/Moscow'; insert into t1 values ('20040101000000'), ('20040611093902'); @@ -26,19 +36,51 @@ select * from t1; t 2004-01-01 00:00:00 2004-06-11 09:39:02 +set time_zone='Europe/Moscow'; +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +ROLLBACK; +use test; +SET TIMESTAMP=100000000; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; +SET @@session.sql_mode=0; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; +create table t1 (t timestamp); +SET TIMESTAMP=100000000; +create table t2 (t char(32)); +SET TIMESTAMP=100000000; +SET @@session.time_zone='Europe/Moscow'; +insert into t1 values ('20050101000000'), ('20050611093902'); +SET TIMESTAMP=100000000; +SET @@session.time_zone='UTC'; +insert into t1 values ('20040101000000'), ('20040611093902'); +SET TIMESTAMP=100000000; +delete from t1; +SET TIMESTAMP=100000000; +SET @@session.time_zone='Europe/Moscow'; +insert into t1 values ('20040101000000'), ('20040611093902'); +ROLLBACK; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +delete from t1; +set time_zone='UTC'; +load data infile '../../std_data/rpl_timezone.dat' into table t1; select * from t1; t 2004-01-01 00:00:00 2004-06-11 09:39:02 -show binlog events; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 -master-bin.000001 # Query 1 # use `test`; create table t1 (t timestamp) -master-bin.000001 # Query 1 # use `test`; create table t2 (t char(32)) -master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT TIME_ZONE='UTC' -master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902') -master-bin.000001 # Query 1 # use `test`; delete from t1 -master-bin.000001 # Query 1 # use `test`; insert into t1 values ('20040101000000'), ('20040611093902') +set time_zone='UTC'; +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +set time_zone='Europe/Moscow'; +set time_zone='Europe/Moscow'; +delete from t1; +insert into t1 values ('20040101000000'), ('20040611093902'); set time_zone='MET'; insert into t2 (select t from t1); select * from t1; @@ -52,10 +94,6 @@ t delete from t2; set timestamp=1000072000; insert into t2 values (current_timestamp), (current_date), (current_time); -set timestamp=1000072000; -select current_timestamp, current_date, current_time; -current_timestamp current_date current_time -2001-09-10 01:46:40 2001-09-10 01:46:40 select * from t2; t 2001-09-09 23:46:40 @@ -73,5 +111,16 @@ t 2001-09-09 03:46:40 1000000000 set global time_zone='MET'; -ERROR HY000: Binary logging and replication forbid changing the global server time zone +delete from t2; +set time_zone='UTC'; +insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone)); +insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan')); +select * from t2; +t +2003-12-31 23:00:00 +2005-01-01 08:00:00 +select * from t2; +t +2003-12-31 23:00:00 +2005-01-01 08:00:00 drop table t1, t2; diff --git a/mysql-test/r/rpl_until.result b/mysql-test/r/rpl_until.result index c9f9aa7b029..64efeab0145 100644 --- a/mysql-test/r/rpl_until.result +++ b/mysql-test/r/rpl_until.result @@ -15,14 +15,14 @@ drop table t2; show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4 -master-bin.000001 98 Query 1 220 use `test`; create table t1(n int not null auto_increment primary key) -master-bin.000001 220 Query 1 321 use `test`; insert into t1 values (1),(2),(3),(4) -master-bin.000001 321 Query 1 398 use `test`; drop table t1 -master-bin.000001 398 Query 1 520 use `test`; create table t2(n int not null auto_increment primary key) -master-bin.000001 520 Query 1 613 use `test`; insert into t2 values (1),(2) -master-bin.000001 613 Query 1 706 use `test`; insert into t2 values (3),(4) -master-bin.000001 706 Query 1 783 use `test`; drop table t2 -start slave until master_log_file='master-bin.000001', master_log_pos=321; +master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 219 Query 1 319 use `test`; insert into t1 values (1),(2),(3),(4) +master-bin.000001 319 Query 1 395 use `test`; drop table t1 +master-bin.000001 395 Query 1 516 use `test`; create table t2(n int not null auto_increment primary key) +master-bin.000001 516 Query 1 608 use `test`; insert into t2 values (1),(2) +master-bin.000001 608 Query 1 700 use `test`; insert into t2 values (3),(4) +master-bin.000001 700 Query 1 776 use `test`; drop table t2 +start slave until master_log_file='master-bin.000001', master_log_pos=319; select * from t1; n 1 @@ -31,7 +31,7 @@ n 4 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 321 # Master master-bin.000001 321 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-bin.000001 319 No # start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; select * from t1; n @@ -41,21 +41,21 @@ n 4 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 321 # Master master-no-such-bin.000001 291 No # -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=751; +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-no-such-bin.000001 291 No # +start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; select * from t2; n 1 2 show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 613 # Relay slave-relay-bin.000004 751 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 608 # Relay slave-relay-bin.000004 746 No # start slave; stop slave; -start slave until master_log_file='master-bin.000001', master_log_pos=783; +start slave until master_log_file='master-bin.000001', master_log_pos=776; show slave status; Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 783 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 783 # Master master-bin.000001 783 No # +# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 776 # Master master-bin.000001 776 No # start slave until master_log_file='master-bin', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; @@ -67,6 +67,6 @@ ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UN start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave sql_thread; -start slave until master_log_file='master-bin.000001', master_log_pos=783; +start slave until master_log_file='master-bin.000001', master_log_pos=776; Warnings: Note 1254 Slave is already running diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 15cae7646f9..7c34481b519 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -315,57 +315,57 @@ insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); 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 MEMORY 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 MEMORY 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 MEMORY 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 MEMORY 10 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); 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 MEMORY 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 MEMORY 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 MEMORY 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 MEMORY 10 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); 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 MEMORY 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 MEMORY 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 MEMORY 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 MEMORY 10 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; 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 MEMORY 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL -t2 MEMORY 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL -t3 MEMORY 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t1 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 MEMORY 10 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1; delete from t2; delete from 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 -t1 MEMORY 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 MEMORY 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 MEMORY 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); 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 MEMORY 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 MEMORY 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 MEMORY 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 MEMORY 10 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; 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 MEMORY 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL -t2 MEMORY 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL -t3 MEMORY 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t1 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 MEMORY 10 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL drop table t1, t2, t3; create database mysqltest; show create database mysqltest; diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 1182c3d3569..c979ee34df0 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -494,4 +494,13 @@ declare continue handler for sqlstate '42x00' begin end; begin end; end| ERROR 42000: Bad SQLSTATE: '42x00' +create procedure bug6600() +check table t1| +ERROR 0A000: CHECK is not allowed in stored procedures +create procedure bug6600() +lock table t1 read| +ERROR 0A000: LOCK is not allowed in stored procedures +create procedure bug6600() +unlock table t1| +ERROR 0A000: UNLOCK is not allowed in stored procedures drop table t1| diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index b2a1af03c9f..93884bf4cf4 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2185,6 +2185,7 @@ Create Databases,Tables,Indexes To create new databases and tables Create routine Functions,Procedures To use CREATE FUNCTION/PROCEDURE Create temporary tables Databases To use CREATE TEMPORARY TABLE Create view Tables To create new views +Create user Server Admin To create new users Delete Tables To delete existing rows Drop Databases,Tables To drop databases, tables, and views Execute Functions,Procedures To execute stored routines @@ -2238,6 +2239,7 @@ Create Databases,Tables,Indexes To create new databases and tables Create routine Functions,Procedures To use CREATE FUNCTION/PROCEDURE Create temporary tables Databases To use CREATE TEMPORARY TABLE Create view Tables To create new views +Create user Server Admin To create new users Delete Tables To delete existing rows Drop Databases,Tables To drop databases, tables, and views Execute Functions,Procedures To execute stored routines @@ -2777,23 +2779,4 @@ a 3.2000 drop procedure bug8937| delete from t1| -drop procedure if exists bug6600| -drop table if exists t3| -drop view if exists v1| -create table t3 (s1 decimal(31,30))| -create view v1 as select * from t3| -create procedure bug6600() -check table v1| -call bug6600()| -Table Op Msg_type Msg_text -test.v1 check status OK -call bug6600()| -Table Op Msg_type Msg_text -test.v1 check status OK -call bug6600()| -Table Op Msg_type Msg_text -test.v1 check status OK -drop procedure bug6600| -drop view v1| -drop table t3| drop table t1,t2; diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index c3d2533a2e3..47dbb87b990 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1,3 +1,4 @@ +set @org_mode=@@sql_mode; set @@sql_mode='ansi,traditional'; select @@sql_mode; @@sql_mode @@ -209,8 +210,12 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2004-10-00 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1 +INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time INSERT INTO t1 (col1) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at row 1 +INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); @@ -220,8 +225,14 @@ INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1 +INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time INSERT INTO t1 (col2) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' at row 1 +INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time +INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); +ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col2' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); @@ -230,8 +241,12 @@ INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1 +INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time INSERT INTO t1 (col3) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' at row 1 +INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col3' at row 1 drop table t1; @@ -1030,3 +1045,48 @@ ERROR 22001: Data too long for column 'tinyblobcol' at row 1 select * from t1; charcol varcharcol binarycol varbinarycol tinytextcol tinyblobcol drop table t1; +set sql_mode='traditional'; +create table t1 (col1 datetime); +insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i')); +ERROR 22007: Truncated incorrect datetime value: '31.10.2004 15.30 abc' +insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r')); +ERROR HY000: Incorrect time value: '22:22:33 AM' for function str_to_time +insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T')); +ERROR HY000: Incorrect time value: 'abc' for function str_to_time +set sql_mode=''; +insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i')); +Warnings: +Warning 1292 Truncated incorrect datetime value: '31.10.2004 15.30 abc' +insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); +Warnings: +Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r')); +Warnings: +Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_time +insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T')); +Warnings: +Error 1411 Incorrect time value: 'abc' for function str_to_time +insert into t1 values(STR_TO_DATE('31.10.2004 15.30','%d.%m.%Y %H.%i')); +insert into t1 values(STR_TO_DATE('2004.12.12 11:22:33 AM','%Y.%m.%d %r')); +insert into t1 values(STR_TO_DATE('2004.12.12 10:22:59','%Y.%m.%d %T')); +select * from t1; +col1 +2004-10-31 15:30:00 +NULL +NULL +NULL +2004-10-31 15:30:00 +2004-12-12 11:22:33 +2004-12-12 10:22:59 +set sql_mode='traditional'; +select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') IS NULL; +count(*) +7 +Warnings: +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time +drop table t1; +set sql_mode=@org_mode; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 738c011012d..036d1631592 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1883,6 +1883,380 @@ SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); a 1 3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE a > ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE a > ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) = ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) <> ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 2 column(s) +SELECT a FROM t1 WHERE a = ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2); +a +SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 2 column(s) +SELECT a FROM t1 WHERE a <> ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a,2 FROM t1 WHERE b = 2); +a +1 +2 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2 UNION SELECT a,1 FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 WHERE b = 2 UNION SELECT a,1 FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 HAVING a = 2 UNION SELECT a,1 FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 HAVING a = 2 UNION SELECT a,1 FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +3 +SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a), '-') from t1 a; +concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a), '-') +0- +0- +1- +SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a), '-') from t1 a; +concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a), '-') +1- +0- +0- +SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a), '-') from t1 a; +concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a), '-') +0- +1- +0- +DROP TABLE t1; +CREATE TABLE t1 ( a double, b double ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2e0); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2e0); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2e0); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2e0); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2e0); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2e0); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2e0); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2e0); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2e0); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2e0); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2e0); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2e0); +a +1 +3 +DROP TABLE t1; +CREATE TABLE t1 ( a char(1), b char(1)); +INSERT INTO t1 VALUES ('1','1'),('2','2'),('3','3'); +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = '2'); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = '2'); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = '2'); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = '2'); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = '2'); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = '2'); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = '2'); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = '2'); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = '2'); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = '2'); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = '2'); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = '2'); +a +1 +3 DROP TABLE t1; create table t1 (a int, b int); insert into t1 values (1,2),(3,4); @@ -2138,7 +2512,7 @@ drop table t1; create table t1 (a1 int); create table t2 (b1 int); select * from t1 where a2 > any(select b1 from t2); -ERROR 42S22: Unknown column 'a2' in 'scalar IN/ALL/ANY subquery' +ERROR 42S22: Unknown column 'a2' in 'IN/ALL/ANY subquery' select * from t1 where a1 > any(select b1 from t2); a1 drop table t1,t2; @@ -2277,7 +2651,63 @@ pass userid parentid parentgroup childid groupname grouptypeid crse categoryid c 1 5141 12 group2 12 group2 5 1 1 87 Oct04 1 5141 12 group2 12 group2 5 1 2 88 Oct04 1 5141 12 group2 12 group2 5 1 2 89 Oct04 -drop table if exists t1, t2, t3, t4, t5; +drop table t1, t2, t3, t4, t5; +create table t1 (a int); +insert into t1 values (1), (2), (3); +SELECT 1 FROM t1 WHERE (SELECT 1) in (SELECT 1); +1 +1 +1 +1 +drop table t1; +create table t1 (a int); +create table t2 (a int); +insert into t1 values (1),(2); +insert into t2 values (0),(1),(2),(3); +select a from t2 where a in (select a from t1); +a +1 +2 +select a from t2 having a in (select a from t1); +a +1 +2 +prepare stmt1 from "select a from t2 where a in (select a from t1)"; +execute stmt1; +a +1 +2 +execute stmt1; +a +1 +2 +deallocate prepare stmt1; +prepare stmt1 from "select a from t2 having a in (select a from t1)"; +execute stmt1; +a +1 +2 +execute stmt1; +a +1 +2 +deallocate prepare stmt1; +drop table t1, t2; +create table t1 (a int, b int); +insert into t1 values (1,2); +select 1 = (select * from t1); +ERROR 21000: Operand should contain 1 column(s) +select (select * from t1) = 1; +ERROR 21000: Operand should contain 2 column(s) +select (1,2) = (select a from t1); +ERROR 21000: Operand should contain 2 column(s) +select (select a from t1) = (1,2); +ERROR 21000: Operand should contain 1 column(s) +select (1,2,3) = (select * from t1); +ERROR 21000: Operand should contain 3 column(s) +select (select * from t1) = (1,2,3); +ERROR 21000: Operand should contain 2 column(s) +drop table t1; create table t1 (df decimal(5,1)); insert into t1 values(1.1); insert into t1 values(2.2); diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 532f0eca014..40a9c3b9af5 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -96,6 +96,7 @@ user CREATE TABLE `user` ( `Show_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Create_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_user_priv` enum('N','Y') character set utf8 NOT NULL default 'N', `ssl_type` enum('','ANY','X509','SPECIFIED') character set utf8 NOT NULL default '', `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result index dde50a1ee00..c926ebb6878 100644 --- a/mysql-test/r/type_bit.result +++ b/mysql-test/r/type_bit.result @@ -36,7 +36,7 @@ select 0 + b'1000000000000001'; 32769 drop table if exists t1; create table t1 (a bit(65)); -ERROR 42000: Column length too big for column 'a' (max = 64); use BLOB instead +ERROR 42000: Column length too big for column 'a' (max = 64); use BLOB or TEXT instead create table t1 (a bit(0)); show create table t1; Table Create Table diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index a9b90617bcc..3316f9bb6db 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -33,11 +33,11 @@ t4 CREATE TABLE `t4` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2,t3,t4; CREATE TABLE t1 (a char(257) default "hello"); -ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE t2 (a char(256)); -ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE t1 (a varchar(70000) default "hello"); -ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB instead +ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead CREATE TABLE t2 (a blob default "hello"); ERROR 42000: BLOB/TEXT column 'a' can't have a default value drop table if exists t1,t2; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 2d5c2d2ac97..6a0c0090e79 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -693,3 +693,58 @@ SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t1); EMPNUM E1 DROP TABLE t1,t2; +create table t1 (d decimal(64,0)); +insert into t1 values (1); +select * from t1; +d +1 +drop table t1; +create table t1 (d decimal(64,99)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `d` decimal(64,30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (1); +select * from t1; +d +1.000000000000000000000000000000 +drop table t1; +create table t1 (d decimal(10,12)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `d` decimal(13,12) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (d decimal(5)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `d` decimal(5,0) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (d decimal); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `d` decimal(10,0) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (d decimal(65,0)); +ERROR 42000: Incorrect column specifier for column 'd' +CREATE TABLE t1 (i INT, d1 DECIMAL(9,2), d2 DECIMAL(9,2)); +INSERT INTO t1 VALUES (1, 101.40, 21.40), (1, -80.00, 0.00), +(2, 0.00, 0.00), (2, -13.20, 0.00), (2, 59.60, 46.40), +(2, 30.40, 30.40), (3, 37.00, 7.40), (3, -29.60, 0.00), +(4, 60.00, 15.40), (4, -10.60, 0.00), (4, -34.00, 0.00), +(5, 33.00, 0.00), (5, -25.80, 0.00), (5, 0.00, 7.20), +(6, 0.00, 0.00), (6, -51.40, 0.00); +SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1 GROUP BY i HAVING a <> b; +i a b +6 -51.40 0.00 +SELECT i, ROUND(SUM(d1), 2) AS a, ROUND(SUM(d2), 2) AS b FROM t1 GROUP BY i +HAVING a <> b; +i a b +6 -51.40 0.00 +drop table t1; diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index d4496f454a0..f6cfa7f2733 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1730,7 +1730,7 @@ insert into t1 values ('Y'); alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; select * from t1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 a a 254 1 1 Y 384 0 8 def test t1 t1 b b 254 3 0 Y 2176 0 8 def test t1 t1 c c 254 1 0 Y 384 0 8 diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index bb5f9e7f3b0..330caf68293 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -180,14 +180,6 @@ t1 CREATE TABLE `t1` ( `-(-1.1)` decimal(7,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); -INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); -update t1 set b=a; -SELECT * FROM t1; -a b -1.1 1.100 -2.1 2.100 -DROP TABLE t1; set session sql_mode='traditional'; select 1e10/0e0; 1e10/0e0 @@ -847,3 +839,6 @@ Error 1365 Division by 0 INSERT INTO Sow6_2f VALUES ('a59b'); ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1 drop table Sow6_2f; +select 10.3330000000000/12.34500000; +10.3330000000000/12.34500000 +0.8370190360469825840421223160000 diff --git a/mysql-test/r/type_varchar.result b/mysql-test/r/type_varchar.result index 1c2653bd225..d2fe843a68b 100644 --- a/mysql-test/r/type_varchar.result +++ b/mysql-test/r/type_varchar.result @@ -376,3 +376,10 @@ explain select * from t1 where v like 'S%' order by v; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range v v 13 NULL 2 Using where; Using filesort drop table t1; +create table t1 (pkcol varchar(16), othercol varchar(16), primary key (pkcol)); +insert into t1 values ('test', 'something'); +update t1 set othercol='somethingelse' where pkcol='test'; +select * from t1; +pkcol othercol +test somethingelse +drop table t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 663793e0b5e..8c8e12d8838 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -565,7 +565,7 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(20,1) NOT NULL default '0.0' + `a` decimal(19,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); @@ -732,7 +732,7 @@ tetetetetest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `dt` blob + `dt` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT sv from t2 UNION select b from t2; @@ -755,7 +755,7 @@ tetetetetest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `i` blob + `i` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT sv from t2 UNION select tx from t2; @@ -766,7 +766,7 @@ teeeeeeeeeeeest show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `sv` text + `sv` longtext ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT b from t2 UNION select tx from t2; @@ -1195,3 +1195,43 @@ a b 2 b 3 c drop table t1; +set @val:=6; +select concat('value is: ', @val) union select 'some text'; +concat('value is: ', @val) +value is: 6 +some text +CREATE TABLE t1 ( +a ENUM('ä','ö','ü') character set utf8 not null default 'ü', +b ENUM("one", "two") character set utf8, +c ENUM("one", "two") +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('ä','ö','ü') character set utf8 NOT NULL default 'ü', + `b` enum('one','two') character set utf8 default NULL, + `c` enum('one','two') default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL); +create table t2 select NULL union select a from t1; +show columns from t2; +Field Type Null Key Default Extra +NULL enum('ä','ö','ü') YES NULL +drop table t2; +create table t2 select a from t1 union select NULL; +show columns from t2; +Field Type Null Key Default Extra +a enum('ä','ö','ü') YES NULL +drop table t2; +create table t2 select a from t1 union select a from t1; +show columns from t2; +Field Type Null Key Default Extra +a varchar(1) NO +drop table t2; +create table t2 select a from t1 union select c from t1; +ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation 'UNION' +create table t2 select a from t1 union select b from t1; +show columns from t2; +Field Type Null Key Default Extra +a varchar(3) YES NULL +drop table t2, t1; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 4b2eef20a6b..bd261751938 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -204,3 +204,10 @@ set @var= NULL ; select FIELD( @var,'1it','Hit') as my_column; my_column 0 +select @v, coercibility(@v); +@v coercibility(@v) +NULL 2 +set @v1=null, @v2=1, @v3=1.1, @v4=now(); +select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); +coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4) +2 2 2 2 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 908709efba3..e3b6c2c5917 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -520,3 +520,11 @@ SHOW VARIABLES LIKE 'table_cache'; Variable_name Value table_cache 1 SET GLOBAL table_cache=DEFAULT; +create table t1 (a int); +select a into @x from t1; +Warnings: +Warning 1329 No data to FETCH +show warnings; +Level Code Message +Warning 1329 No data to FETCH +drop table t1; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 75459bd960b..c5fe4bf8565 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -149,7 +149,7 @@ v5 VIEW v6 VIEW 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 5 9 45 38654705663 1024 0 NULL # # NULL latin1_swedish_ci NULL +t1 MyISAM 10 Fixed 5 9 45 38654705663 1024 0 NULL # # NULL latin1_swedish_ci NULL v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view v2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view v3 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view @@ -874,7 +874,7 @@ select * from v1; col1 describe v1; Field Type Null Key Default Extra -col1 char(2) YES NULL +col1 varchar(2) YES NULL drop view v1; drop table `t1a``b`; create table t1 (col1 char(5),col2 char(5)); @@ -1115,7 +1115,7 @@ select * from v1; ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) 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 # 1024 0 NULL # # NULL latin1_swedish_ci NULL +t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) drop view v1; drop table t1; diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index 222638f64bb..d143b66ae94 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -142,6 +142,25 @@ Warning 1265 Data truncated for column 'b' at row 10 select @@warning_count; @@warning_count 50 +set max_error_count=0; +show variables like 'max_error_count'; +Variable_name Value +max_error_count 0 +update t1 set b='hi'; +Warnings: +select @@warning_count; +@@warning_count +50 +show warnings; +Level Code Message +set max_error_count=65535; +show variables like 'max_error_count'; +Variable_name Value +max_error_count 65535 +set max_error_count=10; +show variables like 'max_error_count'; +Variable_name Value +max_error_count 10 drop table t1; create table t1 (id int) engine=isam; Warnings: |