mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.mrg
This commit is contained in:
@@ -1159,6 +1159,12 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
/* TODO: Add proper checks if handler supports key_type and algorithm */
|
||||
if (key_info->flags & HA_SPATIAL)
|
||||
{
|
||||
if (!(file->table_flags() & HA_CAN_RTREEKEYS))
|
||||
{
|
||||
my_message(ER_TABLE_CANT_HANDLE_SPKEYS, ER(ER_TABLE_CANT_HANDLE_SPKEYS),
|
||||
MYF(0));
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (key_info->key_parts != 1)
|
||||
{
|
||||
my_error(ER_WRONG_ARGUMENTS, MYF(0), "SPATIAL INDEX");
|
||||
@@ -2566,11 +2572,16 @@ send_result_message:
|
||||
table->table->s->version=0; // Force close of table
|
||||
else if (open_for_modify)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
remove_table_from_cache(thd, table->table->s->db,
|
||||
table->table->s->table_name, RTFC_NO_FLAG);
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
/* Something may be modified, that's why we have to invalidate cache */
|
||||
if (table->table->s->tmp_table)
|
||||
table->table->file->info(HA_STATUS_CONST);
|
||||
else
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
remove_table_from_cache(thd, table->table->s->db,
|
||||
table->table->s->table_name, RTFC_NO_FLAG);
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
}
|
||||
/* May be something modified consequently we have to invalidate cache */
|
||||
query_cache_invalidate3(thd, table->table, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user