summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-08-05 22:56:11 +0300
committerMichael Widenius <monty@askmonty.org>2010-08-05 22:56:11 +0300
commitd042146e5b41b6222df3e6b4c16a44f3ef2939b7 (patch)
treee40f5b435f7d17ed1c24dfb787ab8cd5f4f7d5d8 /sql/sp.cc
parent3e610bc58d0ba325fdca3b06dfa976ecc513dc1e (diff)
parentf0f21036951f6fed2fddeb58375425f957751fd5 (diff)
downloadmariadb-git-d042146e5b41b6222df3e6b4c16a44f3ef2939b7.tar.gz
Merge with MariaDB 5.1.49
Removed references to HA_END_SPACE_KEY (which has been 0 for a long time)
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc31
1 files changed, 16 insertions, 15 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index ac509a3bb2d..e2e7583b901 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -784,7 +784,12 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
thd->spcont= NULL;
{
- Parser_state parser_state(thd, defstr.c_ptr(), defstr.length());
+ Parser_state parser_state;
+ if (parser_state.init(thd, defstr.c_ptr(), defstr.length()))
+ {
+ ret= SP_INTERNAL_ERROR;
+ goto end;
+ }
lex_start(thd);
@@ -1634,8 +1639,7 @@ extern "C" uchar* sp_sroutine_key(const uchar *ptr, size_t *plen,
void sp_get_prelocking_info(THD *thd, bool *need_prelocking,
bool *first_no_prelocking)
{
- Sroutine_hash_entry *routine;
- routine= (Sroutine_hash_entry*)thd->lex->sroutines_list.first;
+ Sroutine_hash_entry *routine= thd->lex->sroutines_list.first;
DBUG_ASSERT(routine);
bool first_is_procedure= (routine->key.str[0] == TYPE_ENUM_PROCEDURE);
@@ -1698,7 +1702,7 @@ static bool add_used_routine(LEX *lex, Query_arena *arena,
memcpy(rn->key.str, key->str, key->length + 1);
if (my_hash_insert(&lex->sroutines, (uchar *)rn))
return FALSE;
- lex->sroutines_list.link_in_list((uchar *)rn, (uchar **)&rn->next);
+ lex->sroutines_list.link_in_list(rn, &rn->next);
rn->belong_to_view= belong_to_view;
return TRUE;
}
@@ -1744,7 +1748,7 @@ void sp_add_used_routine(LEX *lex, Query_arena *arena,
void sp_remove_not_own_routines(LEX *lex)
{
Sroutine_hash_entry *not_own_rt, *next_rt;
- for (not_own_rt= *(Sroutine_hash_entry **)lex->sroutines_list_own_last;
+ for (not_own_rt= *lex->sroutines_list_own_last;
not_own_rt; not_own_rt= next_rt)
{
/*
@@ -1755,7 +1759,7 @@ void sp_remove_not_own_routines(LEX *lex)
hash_delete(&lex->sroutines, (uchar *)not_own_rt);
}
- *(Sroutine_hash_entry **)lex->sroutines_list_own_last= NULL;
+ *lex->sroutines_list_own_last= NULL;
lex->sroutines_list.next= lex->sroutines_list_own_last;
lex->sroutines_list.elements= lex->sroutines_list_own_elements;
}
@@ -1836,11 +1840,11 @@ sp_update_stmt_used_routines(THD *thd, LEX *lex, HASH *src,
It will also add elements to end of 'LEX::sroutines_list' list.
*/
-static void sp_update_stmt_used_routines(THD *thd, LEX *lex, SQL_LIST *src,
+static void sp_update_stmt_used_routines(THD *thd, LEX *lex,
+ SQL_I_List<Sroutine_hash_entry> *src,
TABLE_LIST *belong_to_view)
{
- for (Sroutine_hash_entry *rt= (Sroutine_hash_entry *)src->first;
- rt; rt= rt->next)
+ for (Sroutine_hash_entry *rt= src->first; rt; rt= rt->next)
(void)add_used_routine(lex, thd->stmt_arena, &rt->key, belong_to_view);
}
@@ -1975,8 +1979,7 @@ int
sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock)
{
return sp_cache_routines_and_add_tables_aux(thd, lex,
- (Sroutine_hash_entry *)lex->sroutines_list.first,
- first_no_prelock);
+ lex->sroutines_list.first, first_no_prelock);
}
@@ -2000,8 +2003,7 @@ sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock)
int
sp_cache_routines_and_add_tables_for_view(THD *thd, LEX *lex, TABLE_LIST *view)
{
- Sroutine_hash_entry **last_cached_routine_ptr=
- (Sroutine_hash_entry **)lex->sroutines_list.next;
+ Sroutine_hash_entry **last_cached_routine_ptr= lex->sroutines_list.next;
sp_update_stmt_used_routines(thd, lex, &view->view->sroutines_list,
view->top_table());
return sp_cache_routines_and_add_tables_aux(thd, lex,
@@ -2030,8 +2032,7 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex,
{
int ret= 0;
- Sroutine_hash_entry **last_cached_routine_ptr=
- (Sroutine_hash_entry **)lex->sroutines_list.next;
+ Sroutine_hash_entry **last_cached_routine_ptr= lex->sroutines_list.next;
if (static_cast<int>(table->lock_type) >=
static_cast<int>(TL_WRITE_ALLOW_WRITE))