diff options
Diffstat (limited to 'mysql-test/r/ps.result')
-rw-r--r-- | mysql-test/r/ps.result | 358 |
1 files changed, 257 insertions, 101 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 15e1c8730f0..edac68a88d6 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -26,11 +26,11 @@ ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEA execute stmt1; ERROR HY000: Incorrect arguments to EXECUTE prepare stmt2 from 'prepare nested_stmt from "select 1"'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1 +ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt2 from 'execute stmt1'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt1' at line 1 +ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt2 from 'deallocate prepare z'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'z' at line 1 +ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt3 from 'insert into t1 values (?,?)'; set @arg1=5, @arg2='five'; execute stmt3 using @arg1, @arg2; @@ -1062,6 +1062,87 @@ EXECUTE stmt USING @a; 0 0 DEALLOCATE PREPARE stmt; DROP TABLE t1; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (i INT); +PREPARE st_19182 +FROM "CREATE TABLE t2 (i INT, j INT, KEY (i), KEY(j)) SELECT i FROM t1"; +EXECUTE st_19182; +DESC t2; +Field Type Null Key Default Extra +j int(11) YES MUL NULL +i int(11) YES MUL NULL +DROP TABLE t2; +EXECUTE st_19182; +DESC t2; +Field Type Null Key Default Extra +j int(11) YES MUL NULL +i int(11) YES MUL NULL +DEALLOCATE PREPARE st_19182; +DROP TABLE t2, t1; +drop database if exists mysqltest; +drop table if exists t1, t2; +create database mysqltest character set utf8; +prepare stmt1 from "create table mysqltest.t1 (c char(10))"; +prepare stmt2 from "create table mysqltest.t2 select 'test'"; +execute stmt1; +execute stmt2; +show create table mysqltest.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +show create table mysqltest.t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `test` varchar(4) CHARACTER SET latin1 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +drop table mysqltest.t1; +drop table mysqltest.t2; +alter database mysqltest character set latin1; +execute stmt1; +execute stmt2; +show create table mysqltest.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show create table mysqltest.t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `test` varchar(4) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop database mysqltest; +deallocate prepare stmt1; +deallocate prepare stmt2; +execute stmt; +show create table t1; +drop table t1; +execute stmt; +show create table t1; +drop table t1; +deallocate prepare stmt; +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (2), (3), (1); +PREPARE st1 FROM +'(SELECT a FROM t1) UNION (SELECT a+10 FROM t1) ORDER BY RAND()*0+a'; +EXECUTE st1; +a +1 +2 +3 +11 +12 +13 +EXECUTE st1; +a +1 +2 +3 +11 +12 +13 +DEALLOCATE PREPARE st1; +DROP TABLE t1; End of 4.1 tests. create table t1 (a varchar(20)); insert into t1 values ('foo'); @@ -1305,45 +1386,39 @@ prepare stmt from "repair table t1, t4, t3"; execute stmt; Table Op Msg_type Msg_text test.t1 repair status OK -test.t4 repair error Table 'test.t4' doesn't exist +test.t4 repair Error Table 'test.t4' doesn't exist +test.t4 repair error Corrupt test.t3 repair status OK -Warnings: -Error 1146 Table 'test.t4' doesn't exist execute stmt; Table Op Msg_type Msg_text test.t1 repair status OK -test.t4 repair error Table 'test.t4' doesn't exist +test.t4 repair Error Table 'test.t4' doesn't exist +test.t4 repair error Corrupt test.t3 repair status OK -Warnings: -Error 1146 Table 'test.t4' doesn't exist prepare stmt from "optimize table t1, t3, t4"; execute stmt; Table Op Msg_type Msg_text test.t1 optimize status OK test.t3 optimize status OK -test.t4 optimize error Table 'test.t4' doesn't exist -Warnings: -Error 1146 Table 'test.t4' doesn't exist +test.t4 optimize Error Table 'test.t4' doesn't exist +test.t4 optimize error Corrupt execute stmt; Table Op Msg_type Msg_text test.t1 optimize status Table is already up to date test.t3 optimize status Table is already up to date -test.t4 optimize error Table 'test.t4' doesn't exist -Warnings: -Error 1146 Table 'test.t4' doesn't exist +test.t4 optimize Error Table 'test.t4' doesn't exist +test.t4 optimize error Corrupt prepare stmt from "analyze table t4, t1"; execute stmt; Table Op Msg_type Msg_text -test.t4 analyze error Table 'test.t4' doesn't exist +test.t4 analyze Error Table 'test.t4' doesn't exist +test.t4 analyze error Corrupt test.t1 analyze status Table is already up to date -Warnings: -Error 1146 Table 'test.t4' doesn't exist execute stmt; Table Op Msg_type Msg_text -test.t4 analyze error Table 'test.t4' doesn't exist +test.t4 analyze Error Table 'test.t4' doesn't exist +test.t4 analyze error Corrupt test.t1 analyze status Table is already up to date -Warnings: -Error 1146 Table 'test.t4' doesn't exist deallocate prepare stmt; drop table t1, t2, t3; create database mysqltest_long_database_name_to_thrash_heap; @@ -1544,6 +1619,72 @@ a 2 DEALLOCATE PREPARE stmt; DROP TABLE t1,t2; +drop table if exists t1; +create table t1 (s1 char(20)); +prepare stmt from "alter table t1 modify s1 int"; +execute stmt; +execute stmt; +drop table t1; +deallocate prepare stmt; +drop table if exists t1; +create table t1 (a int, b int); +prepare s_6895 from "alter table t1 drop column b"; +execute s_6895; +show columns from t1; +Field Type Null Key Default Extra +a int(11) YES NULL +drop table t1; +create table t1 (a int, b int); +execute s_6895; +show columns from t1; +Field Type Null Key Default Extra +a int(11) YES NULL +drop table t1; +create table t1 (a int, b int); +execute s_6895; +show columns from t1; +Field Type Null Key Default Extra +a int(11) YES NULL +deallocate prepare s_6895; +drop table t1; +create table t1 (i int primary key auto_increment) comment='comment for table t1'; +create table t2 (i int, j int, k int); +prepare stmt from "alter table t1 auto_increment=100"; +execute stmt; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`i`) +) ENGINE=MyISAM AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 COMMENT='comment for table t1' +flush tables; +select * from t2; +i j k +execute stmt; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`i`) +) ENGINE=MyISAM AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 COMMENT='comment for table t1' +deallocate prepare stmt; +drop table t1, t2; +set @old_character_set_server= @@character_set_server; +set @@character_set_server= latin1; +prepare stmt from "create database mysqltest_1"; +execute stmt; +show create database mysqltest_1; +Database Create Database +mysqltest_1 CREATE DATABASE `mysqltest_1` /*!40100 DEFAULT CHARACTER SET latin1 */ +drop database mysqltest_1; +set @@character_set_server= utf8; +execute stmt; +show create database mysqltest_1; +Database Create Database +mysqltest_1 CREATE DATABASE `mysqltest_1` /*!40100 DEFAULT CHARACTER SET utf8 */ +drop database mysqltest_1; +deallocate prepare stmt; +set @@character_set_server= @old_character_set_server; drop tables if exists t1; create table t1 (id int primary key auto_increment, value varchar(10)); insert into t1 (id, value) values (1, 'FIRST'), (2, 'SECOND'), (3, 'THIRD'); @@ -1560,6 +1701,15 @@ execute stmt; ERROR 42S22: Unknown column 'y.value' in 'field list' deallocate prepare stmt; drop tables t1; +prepare stmt from "create table t1 select ?"; +set @a=1.0; +execute stmt using @a; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `?` decimal(2,1) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; End of 5.0 tests. create procedure proc_1() reset query cache; call proc_1(); @@ -1700,63 +1850,55 @@ create procedure proc_1() flush tables; flush tables; show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 +mysql general_log 0 0 select Host, User from mysql.user limit 0; Host User select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 call proc_1(); show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 +mysql general_log 0 0 select Host, User from mysql.user limit 0; Host User select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 call proc_1(); show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 +mysql general_log 0 0 select Host, User from mysql.user limit 0; Host User select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 call proc_1(); show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 +mysql general_log 0 0 select Host, User from mysql.user limit 0; Host User select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 flush tables; create function func_1() returns int begin flush tables; return 1; end| ERROR 0A000: FLUSH is not allowed in stored function or trigger @@ -1772,56 +1914,49 @@ select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 prepare abc from "flush tables"; execute abc; show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 +mysql general_log 0 0 select Host, User from mysql.user limit 0; Host User select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 execute abc; show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 +mysql general_log 0 0 select Host, User from mysql.user limit 0; Host User select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 execute abc; show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 +mysql general_log 0 0 select Host, User from mysql.user limit 0; Host User select Host, Db from mysql.host limit 0; Host Db show open tables from mysql; Database Table In_use Name_locked -mysql general_log 1 0 -mysql slow_log 1 0 -mysql host 0 0 mysql user 0 0 +mysql general_log 0 0 +mysql host 0 0 flush tables; deallocate prepare abc; create procedure proc_1() flush logs; @@ -1968,11 +2103,11 @@ prepare abc from "show master logs"; deallocate prepare abc; create procedure proc_1() show events; call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation call proc_1(); -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation drop procedure proc_1; create function func_1() returns int begin show events; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -1982,27 +2117,27 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show events"; execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation execute abc; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation deallocate prepare abc; drop procedure if exists a; create procedure a() select 42; create procedure proc_1(a char(2)) show create procedure a; call proc_1("bb"); -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create procedure a; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -2012,34 +2147,34 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create procedure a"; execute abc; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Procedure sql_mode Create Procedure +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() -select 42 +select 42 latin1 latin1_swedish_ci latin1_swedish_ci deallocate prepare abc; drop procedure a; drop function if exists a; create function a() returns int return 42+13; create procedure proc_1(a char(2)) show create function a; call proc_1("bb"); -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create function a; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -2049,17 +2184,17 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create function a"; execute abc; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; -Function sql_mode Create Function +Function sql_mode Create Function character_set_client collation_connection Database Collation a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) -return 42+13 +return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci deallocate prepare abc; drop function a; drop table if exists tab1; @@ -2127,14 +2262,14 @@ union all (select b, count(*) from t1 group by b); create procedure proc_1() show create view v1; call proc_1(); -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci call proc_1(); -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci call proc_1(); -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create view v1; return 1; end| ERROR 0A000: Not allowed to return a result set from a function @@ -2144,14 +2279,14 @@ drop function func_1; ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create view v1"; execute abc; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci execute abc; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci execute abc; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`) latin1 latin1_swedish_ci deallocate prepare abc; drop view v1; drop table t1; @@ -2524,4 +2659,25 @@ i j 4 5 3 NULL DROP TABLE t1, t2; +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +prepare stmt +from "create table t1 (c char(100) character set utf8, key (c(10)))"; +execute stmt; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(100) CHARACTER SET utf8 DEFAULT NULL, + KEY `c` (`c`(10)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +execute stmt; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(100) CHARACTER SET utf8 DEFAULT NULL, + KEY `c` (`c`(10)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; End of 5.1 tests. |