diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-06-17 17:31:51 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-06-17 17:31:51 +0400 |
commit | cc6dabba377bd05bb9a6a9ffaa985bbe5e38bcc1 (patch) | |
tree | 9413ba739bc0dbf1e647293756a3503f17dcde07 /sql/sql_view.cc | |
parent | 91a7b147056a228804f81726127035aa305702ff (diff) | |
parent | 45c7bf3c54fa852b312773688fdce15bffe49abf (diff) | |
download | mariadb-git-cc6dabba377bd05bb9a6a9ffaa985bbe5e38bcc1.tar.gz |
Merge trunk-bugfixing -> trunk-runtime
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 3c8de0a253c..69abe70e863 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -897,7 +897,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) { @@ -1016,7 +1016,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)) @@ -1217,9 +1217,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 @@ -1377,8 +1378,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 |