summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-08-02 12:01:24 +0300
committerMichael Widenius <monty@askmonty.org>2010-08-02 12:01:24 +0300
commite0a6b02c5d0a311e7167295494786077009743d1 (patch)
tree72c934fe42261ad5de3139961e092f57e9d147df /sql/sql_view.cc
parentd2f8b7d04503478ab6b6998194a2070891f0c2bb (diff)
parent6ad06b15222300e4eed4fe3972d1ad249c4c42a2 (diff)
downloadmariadb-git-e0a6b02c5d0a311e7167295494786077009743d1.tar.gz
Merge with MySQL 5.1.49
Fixed Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins' in a better way (patch from Sergey Petrunya)
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