summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2006-01-08 19:07:49 +0200
committerunknown <monty@mysql.com>2006-01-08 19:07:49 +0200
commit13c27a97041e60cc3415063ced8c22cd25cb5873 (patch)
treeafcdb167a6e2b7c15844a77d5ecac614bc124293 /sql/sql_handler.cc
parentf577d864cdac14d9a5cf7714b3506bab7688b1c7 (diff)
parent2dcedd9cbc4effee5a1c7e4c8045f2e8adced065 (diff)
downloadmariadb-git-13c27a97041e60cc3415063ced8c22cd25cb5873.tar.gz
Merge mysql.com:/home/my/mysql-4.0
into mysql.com:/home/my/mysql-4.1 client/mysqlimport.c: Auto merged myisam/myisam_ftdump.c: Auto merged sql/sql_select.cc: Auto merged sql/item_cmpfunc.cc: merge (keep old code) sql/sql_handler.cc: manual merge
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc38
1 files changed, 7 insertions, 31 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 12acf344c31..a69bf04cc48 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -384,27 +384,6 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
DBUG_PRINT("info-in-hash",("'%s'.'%s' as '%s' tab %p",
hash_tables->db, hash_tables->real_name,
hash_tables->alias, table));
- /* Table might have been flushed. */
- if (table && (table->version != refresh_version))
- {
- /*
- We must follow the thd->handler_tables chain, as we need the
- address of the 'next' pointer referencing this table
- for close_thread_table().
- */
- for (table_ptr= &(thd->handler_tables);
- *table_ptr && (*table_ptr != table);
- table_ptr= &(*table_ptr)->next)
- {}
- VOID(pthread_mutex_lock(&LOCK_open));
- if (close_thread_table(thd, table_ptr))
- {
- /* Tell threads waiting for refresh that something has happened */
- VOID(pthread_cond_broadcast(&COND_refresh));
- }
- VOID(pthread_mutex_unlock(&LOCK_open));
- table= hash_tables->table= NULL;
- }
if (!table)
{
/*
@@ -451,6 +430,13 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
}
tables->table=table;
+ HANDLER_TABLES_HACK(thd);
+ lock= mysql_lock_tables(thd, &tables->table, 1, 0);
+ HANDLER_TABLES_HACK(thd);
+
+ if (!lock)
+ goto err0; // mysql_lock_tables() printed error message already
+
if (cond && ((!cond->fixed &&
cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1)))
goto err0;
@@ -468,16 +454,6 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (insert_fields(thd,tables,tables->db,tables->alias,&it))
goto err0;
- select_limit+=offset_limit;
- protocol->send_fields(&list,1);
-
- HANDLER_TABLES_HACK(thd);
- lock= mysql_lock_tables(thd, &tables->table, 1, 0);
- HANDLER_TABLES_HACK(thd);
-
- if (!lock)
- goto err0; // mysql_lock_tables() printed error message already
-
/*
In ::external_lock InnoDB resets the fields which tell it that
the handle is used in the HANDLER interface. Tell it again that