mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Give warning if MySQL doesn't honor given storage engine
Allow syntax CREATE TABLE t1 (LIKE t2) BUILD/compile-pentium-debug-max: Disable isam BUILD/compile-pentium-valgrind-max: Disable isam include/mysqld_error.h: New error mysql-test/r/bdb.result: new error message mysql-test/r/innodb.result: new error message mysql-test/r/subselect.result: New test mysql-test/r/variables.result: New test mysql-test/r/warnings.result: Test of warning if MySQL creates table with another handler than specified mysql-test/t/innodb.test: Added test case for derivied tables mysql-test/t/subselect.test: New test mysql-test/t/variables-master.opt: Fixed wrong parameter mysql-test/t/warnings.test: Test if creating handler of not existing table type sql/ha_isam.cc: Added option --skip-isam sql/ha_isam.h: Added option --skip-isam sql/handler.cc: Added option --skip-isam sql/item.cc: Deleted probably wrong bug fix sql/mysqld.cc: Added option --skip-isam sql/share/czech/errmsg.txt: Added missing ',' sql/share/danish/errmsg.txt: Added missing ',' sql/share/dutch/errmsg.txt: Added missing ',' sql/share/english/errmsg.txt: Added missing ',' changed table handler -> storage engine sql/share/estonian/errmsg.txt: Added missing ',' sql/share/french/errmsg.txt: Added missing ',' sql/share/german/errmsg.txt: Added missing ',' sql/share/greek/errmsg.txt: Added missing ',' sql/share/hungarian/errmsg.txt: Added missing ',' sql/share/italian/errmsg.txt: Added missing ',' sql/share/japanese/errmsg.txt: Added missing ',' sql/share/korean/errmsg.txt: Added missing ',' sql/share/norwegian-ny/errmsg.txt: Added missing ',' sql/share/norwegian/errmsg.txt: Added missing ',' sql/share/polish/errmsg.txt: Added missing ',' sql/share/portuguese/errmsg.txt: Added missing ',' sql/share/romanian/errmsg.txt: Added missing ',' sql/share/russian/errmsg.txt: Added missing ',' sql/share/serbian/errmsg.txt: Added missing ',' sql/share/slovak/errmsg.txt: Added missing ',' sql/share/spanish/errmsg.txt: Added missing ',' sql/share/swedish/errmsg.txt: Added missing ',' sql/share/ukrainian/errmsg.txt: Added missing ',' sql/sql_acl.cc: Fix bug in access checking of derived tables sql/sql_base.cc: Indentation change sql/sql_parse.cc: Fix bug in access checking of derived tables sql/sql_select.cc: Fixed bug in new sub select optimization sql/sql_table.cc: Give warning if MySQL doesn't honor given storage engine sql/sql_yacc.yy: Allow syntax CREATE TABLE t1 (LIKE t2).
This commit is contained in:
@@ -382,6 +382,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
int auto_increment=0;
|
||||
handler *file;
|
||||
int field_no,dup_no;
|
||||
enum db_type new_db_type;
|
||||
DBUG_ENTER("mysql_create_table");
|
||||
|
||||
/*
|
||||
@@ -396,6 +397,16 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
List_iterator<create_field> it(fields),it2(fields);
|
||||
int select_field_pos=fields.elements - select_field_count;
|
||||
null_fields=blob_columns=0;
|
||||
if ((new_db_type= ha_checktype(create_info->db_type)) !=
|
||||
create_info->db_type)
|
||||
{
|
||||
create_info->db_type= new_db_type;
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_WARN_USING_OTHER_HANDLER,
|
||||
ER(ER_WARN_USING_OTHER_HANDLER),
|
||||
ha_table_typelib.type_names[new_db_type],
|
||||
table_name);
|
||||
}
|
||||
db_options=create_info->table_options;
|
||||
if (create_info->row_type == ROW_TYPE_DYNAMIC)
|
||||
db_options|=HA_OPTION_PACK_RECORD;
|
||||
@@ -488,8 +499,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
case FIELD_TYPE_GEOMETRY:
|
||||
if (!(file->table_flags() & HA_HAS_GEOMETRY))
|
||||
{
|
||||
my_printf_error(ER_WRONG_USAGE,ER(ER_WRONG_USAGE),MYF(0),
|
||||
"GEOMETRY FIELD TYPE","not supported by this storage engine ");
|
||||
my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED),
|
||||
MYF(0), "GEOMETRY");
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
sql_field->pack_flag=FIELDFLAG_GEOM |
|
||||
@@ -1702,7 +1713,16 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
old_db_type=table->db_type;
|
||||
if (create_info->db_type == DB_TYPE_DEFAULT)
|
||||
create_info->db_type=old_db_type;
|
||||
new_db_type=create_info->db_type= ha_checktype(create_info->db_type);
|
||||
if ((new_db_type= ha_checktype(create_info->db_type)) !=
|
||||
create_info->db_type)
|
||||
{
|
||||
create_info->db_type= new_db_type;
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_WARN_USING_OTHER_HANDLER,
|
||||
ER(ER_WARN_USING_OTHER_HANDLER),
|
||||
ha_table_typelib.type_names[new_db_type],
|
||||
new_name);
|
||||
}
|
||||
if (create_info->row_type == ROW_TYPE_NOT_USED)
|
||||
create_info->row_type=table->row_type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user