summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-03-06 11:30:08 -0700
committerunknown <malff/marcsql@weblab.(none)>2007-03-06 11:30:08 -0700
commit307c9f1e8ff9eb455ba86a08c45862773cd1f9d8 (patch)
tree2ab466ff32d7fa9c1e75823809ef9548dde1f137 /sql/sp_head.cc
parenta6b09226226b19f801f9c3c6c73ce84718e5fccf (diff)
parent266a7fff520eb2253226158df236865f2ad16ffe (diff)
downloadmariadb-git-307c9f1e8ff9eb455ba86a08c45862773cd1f9d8.tar.gz
Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into weblab.(none):/home/marcsql/TREE/mysql-5.0-8407_b mysql-test/r/view.result: Auto merged sql/mysqld.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/sql_base.cc: Manual merge
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc49
1 files changed, 40 insertions, 9 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 71460a67934..baeedc1c9b3 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -2390,16 +2390,11 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
m_lex->mark_as_requiring_prelocking(lex_query_tables_own_last);
}
}
-
+
reinit_stmt_before_use(thd, m_lex);
- /*
- If requested check whenever we have access to tables in LEX's table list
- and open and lock them before executing instructtions core function.
- */
- if (open_tables &&
- (check_table_access(thd, SELECT_ACL, m_lex->query_tables, 0) ||
- open_and_lock_tables(thd, m_lex->query_tables)))
- res= -1;
+
+ if (open_tables)
+ res= instr->exec_open_and_lock_tables(thd, m_lex->query_tables, nextp);
if (!res)
res= instr->exec_core(thd, nextp);
@@ -2448,6 +2443,33 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
sp_instr class functions
*/
+int sp_instr::exec_open_and_lock_tables(THD *thd, TABLE_LIST *tables,
+ uint *nextp)
+{
+ int result;
+
+ /*
+ Check whenever we have access to tables for this statement
+ and open and lock them before executing instructions core function.
+ */
+ if (check_table_access(thd, SELECT_ACL, tables, 0)
+ || open_and_lock_tables(thd, tables))
+ {
+ get_cont_dest(nextp);
+ result= -1;
+ }
+ else
+ result= 0;
+
+ return result;
+}
+
+void sp_instr::get_cont_dest(uint *nextp)
+{
+ *nextp= m_ip+1;
+}
+
+
int sp_instr::exec_core(THD *thd, uint *nextp)
{
DBUG_ASSERT(0);
@@ -2628,6 +2650,15 @@ sp_instr_set_trigger_field::print(String *str)
value->print(str);
}
+/*
+ sp_instr_opt_meta
+*/
+
+void sp_instr_opt_meta::get_cont_dest(uint *nextp)
+{
+ *nextp= m_cont_dest;
+}
+
/*
sp_instr_jump class functions