diff options
author | Igor Babaev <igor@askmonty.org> | 2011-05-16 22:39:43 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-05-16 22:39:43 -0700 |
commit | 704f97035fed1a454ea3300d2ad5dda906dbce50 (patch) | |
tree | 7204d0246b026782b99b8effe9a0ec682e90e209 /sql/sql_parse.cc | |
parent | 7b797fe66d7167a8f5cbb071a06a640a627f2186 (diff) | |
parent | a8be09a9f26b43139ad84ead314898d23394f673 (diff) | |
download | mariadb-git-704f97035fed1a454ea3300d2ad5dda906dbce50.tar.gz |
Merged the code of MWL#106 into 5.3
Resolved all conflicts, bad merges and fixed a few minor bugs in the code.
Commented out the queries from multi_update, view, subselect_sj, func_str,
derived_view, view_grant that failed either with crashes in ps-protocol or
with wrong results.
The failures are clear indications of some bugs in the code and these bugs
are to be fixed.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e2031c129b0..0f796b92f30 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2709,6 +2709,9 @@ mysql_execute_command(THD *thd) } } } + if (mysql_handle_single_derived(thd->lex, create_table, + DT_MERGE_FOR_INSERT)) + DBUG_RETURN(1); /* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */ if (create_info.options & HA_LEX_CREATE_TMP_TABLE) @@ -3235,6 +3238,10 @@ end_with_restore_list: if (!(res= open_and_lock_tables(thd, all_tables))) { + /* + Only the INSERT table should be merged. Other will be handled by + select. + */ /* Skip first table, which is the table we are inserting in */ TABLE_LIST *second_table= first_table->next_local; select_lex->table_list.first= second_table; @@ -5200,6 +5207,8 @@ bool check_single_table_access(THD *thd, ulong privilege, /* Show only 1 table for check_grant */ if (!(all_tables->belong_to_view && (thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) && + !(all_tables->is_view() && + all_tables->is_merged_derived()) && check_grant(thd, privilege, all_tables, 0, 1, no_errors)) goto deny; |