diff options
author | unknown <holyfoot@mysql.com> | 2006-05-04 02:17:17 +0500 |
---|---|---|
committer | unknown <holyfoot@mysql.com> | 2006-05-04 02:17:17 +0500 |
commit | 46e54f244cd30bb0a48e2d173d7c114cf48e0365 (patch) | |
tree | 182d6f547f5447fed77bc8e8af696e363faba85c /sql/sql_table.cc | |
parent | b5732e7c8cb8d89ca25ed5948f457159a4adc3e0 (diff) | |
parent | a1e9539b62bdda3651e5b152db21586bc7a3e47e (diff) | |
download | mariadb-git-46e54f244cd30bb0a48e2d173d7c114cf48e0365.tar.gz |
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.mrg
sql/sql_table.cc:
Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7b739798b38..c9e9ce1bba7 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -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); } } |