1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

small code cleanup taken from MySQL 5.6

This commit is contained in:
Sergei Golubchik
2012-12-16 21:45:45 +01:00
parent fe7c2aaeea
commit 4923d19b7c
12 changed files with 29 additions and 60 deletions

View File

@@ -790,9 +790,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
FALSE,
(fields.elements || !value_count ||
table_list->view != 0),
!ignore && (thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES))))
!ignore && thd->is_strict_mode()))
goto abort;
/* mysql_prepare_insert set table_list->table if it was not set */
@@ -904,9 +902,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
}
}
thd->abort_on_warning= (!ignore && (thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
thd->abort_on_warning= !ignore && thd->is_strict_mode();
prepare_triggers_for_insert_stmt(table);
@@ -3339,9 +3335,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (!res && fields->elements)
{
bool saved_abort_on_warning= thd->abort_on_warning;
thd->abort_on_warning= !info.ignore && (thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES));
thd->abort_on_warning= !info.ignore && thd->is_strict_mode();
res= check_that_all_fields_are_given_values(thd, table_list->table,
table_list);
thd->abort_on_warning= saved_abort_on_warning;
@@ -3456,10 +3450,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
if (info.handle_duplicates == DUP_UPDATE)
table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
thd->abort_on_warning= !info.ignore && thd->is_strict_mode();
res= (table_list->prepare_where(thd, 0, TRUE) ||
table_list->prepare_check_option(thd));
@@ -4076,10 +4067,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
if (thd->locked_tables_mode <= LTM_LOCK_TABLES)
table->file->ha_start_bulk_insert((ha_rows) 0);
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES |
MODE_STRICT_ALL_TABLES)));
thd->abort_on_warning= !info.ignore && thd->is_strict_mode();
if (check_that_all_fields_are_given_values(thd, table, table_list))
DBUG_RETURN(1);
table->mark_columns_needed_for_insert();