summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 183b55ca12f..8cc342e99fe 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -271,9 +271,9 @@ int mysql_create_view(THD *thd,
}
#endif
- if (wait_if_global_read_lock(thd, 0))
+ if (wait_if_global_read_lock(thd, 0, 0))
{
- VOID(pthread_mutex_unlock(&LOCK_open));
+ res= -1;
goto err;
}
VOID(pthread_mutex_lock(&LOCK_open));
@@ -513,7 +513,9 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
will be TRUE as far as we make new table cache).
*/
Item_arena *arena= thd->current_arena, backup;
- if (arena)
+ if (!arena->is_stmt_prepare())
+ arena= 0;
+ else
thd->set_n_backup_item_arena(arena, &backup);
/* init timestamp */