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.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index b9379d8898f..280d33aa654 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -887,7 +887,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view->algorithm != VIEW_ALGORITHM_TMPTABLE)))
{
/* TODO: change here when we will support UNIONs */
- for (TABLE_LIST *tbl= (TABLE_LIST *)lex->select_lex.table_list.first;
+ for (TABLE_LIST *tbl= lex->select_lex.table_list.first;
tbl;
tbl= tbl->next_local)
{
@@ -1006,7 +1006,7 @@ loop_out:
*/
if (view->updatable_view &&
!lex->select_lex.master_unit()->is_union() &&
- !((TABLE_LIST*)lex->select_lex.table_list.first)->next_local &&
+ !(lex->select_lex.table_list.first)->next_local &&
find_table_in_global_list(lex->query_tables->next_global,
lex->query_tables->db,
lex->query_tables->table_name))
@@ -1192,9 +1192,10 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
char old_db_buf[NAME_LEN+1];
LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) };
bool dbchanged;
- Parser_state parser_state(thd,
- table->select_stmt.str,
- table->select_stmt.length);
+ Parser_state parser_state;
+ if (parser_state.init(thd, table->select_stmt.str,
+ table->select_stmt.length))
+ goto err;
/*
Use view db name as thread default database, in order to ensure
@@ -1351,8 +1352,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
This may change in future, for example if we enable merging of
views with subqueries in select list.
*/
- view_main_select_tables=
- (TABLE_LIST*)lex->select_lex.table_list.first;
+ view_main_select_tables= lex->select_lex.table_list.first;
/*
Let us set proper lock type for tables of the view's main