#At file:///Users/mattiasj/clones/bzrroot/b35765-60-bugteam/
2693 Mattias Jonsson 2008-07-07
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
The behavior was because of
12345678901234567890123456789012345678901234567890123456789012345678901234567890
modified:
mysql-test/r/log_tables.result
mysql-test/r/partition.result
mysql-test/r/partition_innodb.result
mysql-test/suite/parts/inc/partition_key_32col.inc
mysql-test/t/log_tables.test
mysql-test/t/partition.test
mysql-test/t/partition_innodb.test
sql/sql_yacc.yy
per-file messages:
mysql-test/r/log_tables.result
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
Updated test result.
mysql-test/r/partition.result
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
Updated test result.
mysql-test/r/partition_innodb.result
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
Updated test result.
mysql-test/suite/parts/inc/partition_key_32col.inc
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
fixed a typo that generated warnings.
mysql-test/t/log_tables.test
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
This test uses engines that is not always compiled in
or enabled.
Before this patch it tried either with the UNKNOWN
(non existent, when it was not enabled/compiled in)
or with an engine that does not support LOG TABLE.
After this patch, the behavior is different depending
of the status of the engine, and the test can not
use ndb, innodb, archive or blackhole since they
depend on the configuring of the server and not
completely of the test.
Changed so it produces consitent results.
mysql-test/t/partition.test
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
Added test case which is consistant with non partitioned table
mysql-test/t/partition_innodb.test
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
No longer an error, but a warning is given instead.
sql/sql_yacc.yy
Bug#35765 ALTER TABLE produces wrong error when non-existent
storage engine used
If one tries to set the engine to a non existent engine
we should not flag that it has been set, but just
disregard the clause.
=== modified file 'mysql-test/r/log_tables.result'
--- a/mysql-test/r/log_tables.result 2008-02-29 13:56:50 +0000
+++ b/mysql-test/r/log_tables.result 2008-07-07 17:44:15 +0000
@@ -233,13 +233,10 @@ set global general_log='OFF';
set global slow_query_log='OFF';
set @save_storage_engine= @@session.storage_engine;
set storage_engine= MEMORY;
-alter table mysql.slow_log engine=ndb;
-ERROR HY000: This storage engine cannot be used for log tables"
-alter table mysql.slow_log engine=innodb;
-ERROR HY000: This storage engine cannot be used for log tables"
-alter table mysql.slow_log engine=archive;
-ERROR HY000: This storage engine cannot be used for log tables"
-alter table mysql.slow_log engine=blackhole;
+alter table mysql.slow_log engine=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown table engine 'NonExistentEngine'
+alter table mysql.slow_log engine=memory;
ERROR HY000: This storage engine cannot be used for log tables"
set storage_engine= @save_storage_engine;
drop table mysql.slow_log;
=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result 2008-06-18 04:01:25 +0000
+++ b/mysql-test/r/partition.result 2008-07-07 17:44:15 +0000
@@ -1,4 +1,37 @@
drop table if exists t1, t2;
+CREATE TABLE t1 (a INT)
+ENGINE=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown table engine 'NonExistentEngine'
+Warning 1266 Using storage engine MyISAM for table 't1'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+ENGINE=NonExistentEngine
+PARTITION BY HASH (a);
+Warnings:
+Warning 1286 Unknown table engine 'NonExistentEngine'
+Warning 1266 Using storage engine MyISAM for table 't1'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+ENGINE=Memory;
+ALTER TABLE t1 ENGINE=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown table engine 'NonExistentEngine'
+ALTER TABLE t1
+PARTITION BY HASH (a)
+(PARTITION p0 ENGINE=Memory,
+PARTITION p1 ENGINE=NonExistentEngine);
+Warnings:
+Warning 1286 Unknown table engine 'NonExistentEngine'
+ALTER TABLE t1 ENGINE=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown table engine 'NonExistentEngine'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
+DROP TABLE t1;
CREATE TABLE t1 (
a INT NOT NULL,
b MEDIUMINT NOT NULL,
=== modified file 'mysql-test/r/partition_innodb.result'
--- a/mysql-test/r/partition_innodb.result 2008-06-12 00:08:07 +0000
+++ b/mysql-test/r/partition_innodb.result 2008-07-07 17:44:15 +0000
@@ -79,7 +79,8 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
alter table t1 engine = x;
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
+Warnings:
+Warning 1286 Unknown table engine 'x'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
=== modified file 'mysql-test/suite/parts/inc/partition_key_32col.inc'
--- a/mysql-test/suite/parts/inc/partition_key_32col.inc 2008-02-06 14:13:56 +0000
+++ b/mysql-test/suite/parts/inc/partition_key_32col.inc 2008-07-07 17:44:15 +0000
@@ -13,7 +13,7 @@ partition pa2 max_rows=30 min_rows=3,
partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
---disable_abort_on error
+--disable_abort_on_error
show create table t1;
insert into t1 values
('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'),
=== modified file 'mysql-test/t/log_tables.test'
--- a/mysql-test/t/log_tables.test 2008-02-29 13:56:50 +0000
+++ b/mysql-test/t/log_tables.test 2008-07-07 17:44:15 +0000
@@ -236,14 +236,21 @@ set global slow_query_log='OFF';
# check that alter table doesn't work for other engines
set @save_storage_engine= @@session.storage_engine;
set storage_engine= MEMORY;
+# After fixing bug#35765 the error behaivor changed:
+# If compiled in/enabled ER_UNSUPORTED_LOG_ENGINE
+# If not (i.e. not existant) it will show a warning
+# and use the current one.
+alter table mysql.slow_log engine=NonExistentEngine;
--error ER_UNSUPORTED_LOG_ENGINE
-alter table mysql.slow_log engine=ndb;
---error ER_UNSUPORTED_LOG_ENGINE
-alter table mysql.slow_log engine=innodb;
---error ER_UNSUPORTED_LOG_ENGINE
-alter table mysql.slow_log engine=archive;
---error ER_UNSUPORTED_LOG_ENGINE
-alter table mysql.slow_log engine=blackhole;
+alter table mysql.slow_log engine=memory;
+#--error ER_UNSUPORTED_LOG_ENGINE
+#alter table mysql.slow_log engine=ndb;
+#--error ER_UNSUPORTED_LOG_ENGINE
+#alter table mysql.slow_log engine=innodb;
+#--error ER_UNSUPORTED_LOG_ENGINE
+#alter table mysql.slow_log engine=archive;
+#--error ER_UNSUPORTED_LOG_ENGINE
+#alter table mysql.slow_log engine=blackhole;
set storage_engine= @save_storage_engine;
drop table mysql.slow_log;
=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test 2008-06-18 04:01:25 +0000
+++ b/mysql-test/t/partition.test 2008-07-07 17:44:15 +0000
@@ -15,6 +15,29 @@ drop table if exists t1, t2;
--enable_warnings
#
+# Bug#35765: ALTER TABLE produces wrong error when non-existent storage engine
+# used
+CREATE TABLE t1 (a INT)
+ENGINE=NonExistentEngine;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+ENGINE=NonExistentEngine
+PARTITION BY HASH (a);
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+ENGINE=Memory;
+ALTER TABLE t1 ENGINE=NonExistentEngine;
+# OK to only specify one partitions engine, since it is already assigned at
+# table level (after create, it is specified on all levels and all parts).
+ALTER TABLE t1
+PARTITION BY HASH (a)
+(PARTITION p0 ENGINE=Memory,
+ PARTITION p1 ENGINE=NonExistentEngine);
+ALTER TABLE t1 ENGINE=NonExistentEngine;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+#
# Bug35931: Index search may return duplicates
#
CREATE TABLE t1 (
=== modified file 'mysql-test/t/partition_innodb.test'
--- a/mysql-test/t/partition_innodb.test 2008-06-12 00:08:07 +0000
+++ b/mysql-test/t/partition_innodb.test 2008-07-07 17:44:15 +0000
@@ -92,7 +92,6 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
--- error ER_MIX_HANDLER_ERROR
alter table t1 engine = x;
show create table t1;
drop table t1;
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2008-05-22 18:40:15 +0000
+++ b/sql/sql_yacc.yy 2008-07-07 17:44:15 +0000
@@ -4460,7 +4460,8 @@ create_table_option:
ENGINE_SYM opt_equal storage_engines
{
Lex->create_info.db_type= $3;
- Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
+ if ($3)
+ Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
}
| MAX_ROWS opt_equal ulonglong_num
{
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (mattiasj:2693) Bug#35765 | Mattias Jonsson | 7 Jul |