summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-03-06 10:33:10 -0700
committerunknown <malff/marcsql@weblab.(none)>2007-03-06 10:33:10 -0700
commit0708859ba8a7490cf3f4ba73c667105d2a6edbd7 (patch)
tree89e46d1e53cc7db75cbfc56e2cadc40161bebc1e /sql/sp_head.cc
parentc155c66da65e3d19b2baec7d141648dfd9b55f52 (diff)
parent266a7fff520eb2253226158df236865f2ad16ffe (diff)
downloadmariadb-git-0708859ba8a7490cf3f4ba73c667105d2a6edbd7.tar.gz
Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-8407_b
into weblab.(none):/home/marcsql/TREE/mysql-5.1-8407-merge mysql-test/r/information_schema_db.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/sp.test: Auto merged sql/lock.cc: Auto merged sql/mysqld.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged
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 20d45af7415..1e0986f6e82 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -2444,16 +2444,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)
{
@@ -2505,6 +2500,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);
@@ -2690,6 +2712,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