mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
After merge fixes
Some bigger code changes was necessary becasue of the multi-table-update and the new HANDLER code include/hash.h: Added back function that's was used in 4.0 mysql-test/r/delete.result: Update results after merge mysql-test/r/flush_table.result: Update results after merge mysql-test/r/func_str.result: Update results after merge mysql-test/r/handler.result: Update results after merge Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename mysql-test/r/multi_update.result: More startup cleanups mysql-test/r/rename.result: More startup-cleanups mysql-test/r/select.result: More startup cleanups mysql-test/r/show_check.result: More startup-cleanups mysql-test/t/ctype_latin1_de.test: Cleanup mysql-test/t/derived.test: Portability fix mysql-test/t/handler.test: Update results after merge Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename mysql-test/t/multi_update.test: More startup cleanups mysql-test/t/range.test: More comments mysql-test/t/rename.test: More startup cleanups mysql-test/t/select.test: More startup cleanups mysql-test/t/show_check.test: More startup cleanups mysql-test/t/type_timestamp.test: Add back test deleted during merge sql/item_cmpfunc.cc: After merge fixes sql/item_func.cc: Remove compiler warning sql/mysql_priv.h: After merge fixes sql/mysqld.cc: After merge fixes sql/sql_acl.cc: More debugging sql/sql_base.cc: After merge fixes (This fix was needed bacause of multi-table-update reopens tables) sql/sql_handler.cc: After merge fixes sql/sql_lex.h: After merge fixes sql/sql_select.cc: After merge fixes sql/sql_show.cc: After merge fixes sql/sql_table.cc: After merge fixes Simple cleanup of mysql_discard_or_import_tablespace sql/sql_update.cc: After merge fixes Rework mysql_multi_update to take into account derived tables. sql/sql_yacc.yy: After merge fixes
This commit is contained in:
@ -159,7 +159,8 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
|
||||
/*
|
||||
HASH entries are of type TABLE_LIST.
|
||||
*/
|
||||
if (hash_init(&thd->handler_tables_hash, HANDLER_TABLES_HASH_SIZE, 0, 0,
|
||||
if (hash_init(&thd->handler_tables_hash, &my_charset_latin1,
|
||||
HANDLER_TABLES_HASH_SIZE, 0, 0,
|
||||
(hash_get_key) mysql_ha_hash_get_key,
|
||||
(hash_free_key) mysql_ha_hash_free, 0))
|
||||
goto err;
|
||||
@ -223,7 +224,7 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
|
||||
memcpy(hash_tables->alias, tables->alias, aliaslen);
|
||||
|
||||
/* add to hash */
|
||||
if (hash_insert(&thd->handler_tables_hash, (byte*) hash_tables))
|
||||
if (my_hash_insert(&thd->handler_tables_hash, (byte*) hash_tables))
|
||||
{
|
||||
mysql_ha_close(thd, tables);
|
||||
goto err;
|
||||
@ -293,7 +294,7 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
if (*table_ptr)
|
||||
{
|
||||
table_ptr->file->ha_index_or_rnd_end();
|
||||
(*table_ptr)->file->ha_index_or_rnd_end();
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
if (close_thread_table(thd, table_ptr))
|
||||
{
|
||||
@ -582,7 +583,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
|
||||
}
|
||||
ok:
|
||||
mysql_unlock_tables(thd,lock);
|
||||
send_eof(&thd->net);
|
||||
send_eof(thd);
|
||||
DBUG_PRINT("exit",("mysql_ha_read: OK"));
|
||||
DBUG_RETURN(0);
|
||||
err:
|
||||
@ -645,8 +646,10 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, int mode_flags)
|
||||
while (*table_ptr)
|
||||
{
|
||||
if ((! *tmp_tables->db ||
|
||||
! my_strcasecmp((*table_ptr)->table_cache_key, tmp_tables->db)) &&
|
||||
! my_strcasecmp((*table_ptr)->real_name, tmp_tables->real_name))
|
||||
! my_strcasecmp(&my_charset_latin1, (*table_ptr)->table_cache_key,
|
||||
tmp_tables->db)) &&
|
||||
! my_strcasecmp(&my_charset_latin1, (*table_ptr)->real_name,
|
||||
tmp_tables->real_name))
|
||||
{
|
||||
DBUG_PRINT("info",("mysql_ha_flush: *table_ptr '%s'.'%s' as '%s'",
|
||||
(*table_ptr)->table_cache_key,
|
||||
@ -725,7 +728,7 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, int mode_flags)
|
||||
}
|
||||
}
|
||||
|
||||
table_ptr->file->ha_index_or_rnd_end();
|
||||
(*table_ptr)->file->ha_index_or_rnd_end();
|
||||
if (close_thread_table(thd, table_ptr))
|
||||
{
|
||||
/* Tell threads waiting for refresh that something has happened */
|
||||
|
Reference in New Issue
Block a user