summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2006-01-06 12:48:14 +0200
committerunknown <monty@mysql.com>2006-01-06 12:48:14 +0200
commit44bebd541f62ad71d6ec268b62962e58d56fd55e (patch)
tree793ca256831446270fd408c83d3b9199d44e6e72 /sql/sql_handler.cc
parenta0979fe1f0c566cf2d85cfe3dd35641afb28454b (diff)
downloadmariadb-git-44bebd541f62ad71d6ec268b62962e58d56fd55e.tar.gz
After merge fix and a safety fix for handler
sql/sql_handler.cc: Move lock tables before conditions as lock tables may reopen tables sql/sql_trigger.cc: After merge fix
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 545cf41eeeb..fae48c7d164 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -414,6 +414,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
}
tables->table=table;
+ HANDLER_TABLES_HACK(thd);
+ lock= mysql_lock_tables(thd, &tables->table, 1, 0, &not_used);
+ HANDLER_TABLES_HACK(thd);
+
+ if (!lock)
+ goto err0; // mysql_lock_tables() printed error message already
+
if (cond && ((!cond->fixed &&
cond->fix_fields(thd, &cond)) || cond->check_cols(1)))
goto err0;
@@ -427,13 +434,6 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
}
}
- HANDLER_TABLES_HACK(thd);
- lock= mysql_lock_tables(thd, &tables->table, 1, 0, &not_used);
- HANDLER_TABLES_HACK(thd);
-
- if (!lock)
- goto err0; // mysql_lock_tables() printed error message already
-
if (insert_fields(thd, &thd->lex->select_lex.context,
tables->db, tables->alias, &it, 0))
goto err0;