1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Manual merge from mysql-trunk.

Conflicts:
  - client/mysqltest.cc
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/t/disabled.def
  - sql/mysqld.cc
  - sql/opt_range.cc
  - sql/sp.cc
  - sql/sql_acl.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
This commit is contained in:
Alexander Nozdrin
2009-12-11 12:39:38 +03:00
1063 changed files with 62539 additions and 35389 deletions

View File

@ -1104,6 +1104,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
is_temporary_table= true;
handlerton *table_type= table->s->db_type();
TABLE_SHARE *share= table->s;
/* Note that a temporary table cannot be partitioned */
if (!ha_check_storage_engine_flag(table_type, HTON_CAN_RECREATE))
goto trunc_by_del;
@ -1142,8 +1143,22 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table_list->db, table_list->table_name);
DBUG_RETURN(TRUE);
}
if (!ha_check_storage_engine_flag(ha_resolve_by_legacy_type(thd, table_type),
HTON_CAN_RECREATE))
#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
TODO: Add support for TRUNCATE PARTITION for NDB and other engines
supporting native partitioning
*/
if (table_type != DB_TYPE_PARTITION_DB &&
thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION)
{
my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
DBUG_RETURN(TRUE);
}
#endif
if (!ha_check_storage_engine_flag(ha_resolve_by_legacy_type(thd,
table_type),
HTON_CAN_RECREATE) ||
thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION)
goto trunc_by_del;
if (lock_and_wait_for_table_name(thd, table_list))