summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2003-01-13 23:00:11 +0200
committerheikki@hundin.mysql.fi <>2003-01-13 23:00:11 +0200
commit1b656d45fb23f386607453c22c0d41169dee07f0 (patch)
tree56b15acd119cf38bcb034a91063ce21cc87b1dcf /sql/sql_handler.cc
parent7424bf2ea97b958a392a1e337c3943fe33991733 (diff)
downloadmariadb-git-1b656d45fb23f386607453c22c0d41169dee07f0.tar.gz
sql_handler.cc:
Backport the InnoDB HANDLER bug fix from 4.1
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 289d2434225..66dcf37d07f 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -109,6 +109,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (cond && cond->fix_fields(thd,tables))
return -1;
+ table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it
+
if (keyname)
{
if ((keyno=find_type(keyname, &table->keynames, 1+2)-1)<0)
@@ -128,8 +130,6 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
insert_fields(thd,tables,tables->db,tables->alias,&it);
- table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it
-
select_limit+=offset_limit;
send_fields(thd,list,1);
@@ -139,6 +139,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (!lock)
goto err0; // mysql_lock_tables() printed error message already
+ table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it
+
for (num_rows=0; num_rows < select_limit; )
{
switch(mode) {