#At file:///Users/mattiasj/clones/bzrroot/topush-60-bugteam/
2756 Mattias Jonsson 2008-08-12 [merge]
merge
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/ha_partition.cc
sql/ha_partition.h
sql/sql_yacc.yy
=== 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:54:50 +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-08-11 19:37:53 +0000
+++ b/mysql-test/r/partition.result 2008-08-12 08:20:26 +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:54:50 +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:54:50 +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:54:50 +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-08-11 19:37:53 +0000
+++ b/mysql-test/t/partition.test 2008-08-12 08:20:26 +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:54:50 +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/ha_partition.cc'
--- a/sql/ha_partition.cc 2008-08-11 19:37:53 +0000
+++ b/sql/ha_partition.cc 2008-08-12 08:20:26 +0000
@@ -1007,7 +1007,7 @@ static bool print_admin_msg(THD* thd, co
va_list args;
Protocol *protocol= thd->protocol;
uint length, msg_length;
- char msgbuf[MI_MAX_MSG_BUF];
+ char msgbuf[PARTITION_MAX_MSG_BUF];
char name[NAME_LEN*2+2];
va_start(args, fmt);
=== modified file 'sql/ha_partition.h'
--- a/sql/ha_partition.h 2008-08-11 19:37:53 +0000
+++ b/sql/ha_partition.h 2008-08-12 08:20:26 +0000
@@ -48,6 +48,7 @@ typedef struct st_ha_data_partition
} HA_DATA_PARTITION;
#define PARTITION_BYTES_IN_POS 2
+#define PARTITION_MAX_MSG_BUF 1024 /**< used in CHECK TABLE, REPAIR TABLE */
class ha_partition :public handler
{
private:
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2008-08-11 19:37:53 +0000
+++ b/sql/sql_yacc.yy 2008-08-12 08:20:26 +0000
@@ -4490,7 +4490,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-bugteam branch (mattiasj:2756) | Mattias Jonsson | 12 Aug |