From c25470e3a1f66e46184dd093c81e16694ca95ae9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Jun 2005 22:14:44 +0100 Subject: Bug#6877 MySQL should give an error if the requested table type is not available Implement new SQL mode - NO_ENGINE_SUBSTITUTION mysql-test/r/sql_mode.result: Test for bug 6877 mysql-test/t/sql_mode.test: Test for bug 6877 sql/handler.cc: change to ha_checktype() sql/handler.h: change to ha_checktype() sql/mysql_priv.h: new sql mode NO_ENGINE_SUBSTITUTION change to args for get_table_type() and create_frm() sql/mysqld.cc: new sql mode NO_ENGINE_SUBSTITUTION sql/set_var.cc: change to ha_checktype() args sql/sql_delete.cc: change to get_table_type() args sql/sql_rename.cc: change to get_table_type() args sql/sql_table.cc: move common code to check_engine() change to ha_checktype(), get_table_type() args sql/table.cc: change to ha_checktype(), create_frm(), get_table_type() args sql/unireg.cc: change to create_frm() args --- mysql-test/r/sql_mode.result | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/r/sql_mode.result') diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index c5ba4d15a50..392bdda32e3 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -402,4 +402,22 @@ a\b a\"b a'\b a'\"b SELECT "a\\b", "a\\\'b", "a""\\b", "a""\\\'b"; a\b a\'b a"\b a"\'b a\b a\'b a"\b a"\'b +set session sql_mode = 'NO_ENGINE_SUBSTITUTION'; +create table t1 (a int) engine=isam; +ERROR HY000: The 'ISAM' feature is disabled; you need MySQL built with 'ISAM' to have it working +show create table t1; +ERROR 42S02: Table 'test.t1' doesn't exist +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +set session sql_mode = ''; +create table t1 (a int) engine=isam; +Warnings: +Warning 1266 Using storage engine MyISAM for table 't1' +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; SET @@SQL_MODE=@OLD_SQL_MODE; -- cgit v1.2.1