diff options
author | Igor Babaev <igor@askmonty.org> | 2010-09-23 08:10:53 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-09-23 08:10:53 -0700 |
commit | b969df8bbdc6acbaf1506b52346d24306e84a48c (patch) | |
tree | b0b9eaa82a121c87f17487c57926bd9968d3ef20 /sql/sql_parse.cc | |
parent | cfbd9270243e4b429cdc26e8554bcc99690f2422 (diff) | |
parent | 709a0a131021135e9fb7a2095fcfcbc223dfb126 (diff) | |
download | mariadb-git-b969df8bbdc6acbaf1506b52346d24306e84a48c.tar.gz |
Merge of the mwl106 tree into the latest 5.3 tree.
Resolved conflicts. Adjusted some test results
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 971dc7c42d3..e9ab3984fae 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -457,7 +457,7 @@ static void handle_bootstrap_impl(THD *thd) thd->init_for_queries(); while (fgets(buff, thd->net.max_packet, file)) { - char *query; + char *query, *res; /* strlen() can't be deleted because fgets() doesn't return length */ ulong length= (ulong) strlen(buff); while (buff[length-1] != '\n' && !feof(file)) @@ -2716,6 +2716,9 @@ mysql_execute_command(THD *thd) } } } + if (mysql_handle_single_derived(thd->lex, create_table, + DT_MERGE_FOR_INSERT)) + DBUG_RETURN(1); /* select_create is currently not re-execution friendly and @@ -3247,6 +3250,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= (uchar*) second_table; @@ -5131,6 +5138,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; |