1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00
This commit is contained in:
Igor Babaev
2011-05-20 12:47:39 -07:00
99 changed files with 4333 additions and 1174 deletions

View File

@@ -2712,6 +2712,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)
@@ -3238,6 +3241,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;
@@ -5203,6 +5210,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;