summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-12 12:16:40 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-12 12:16:40 +0300
commit60c04be6599597548ad07ce11e1d7d4004a7cc9c (patch)
tree491f1b7b65b82ed270e5af34db4d4cebf760e501 /sql
parentebddd8699c02519f99a313182b96ae1c04a67a63 (diff)
parent9554ef067878c4650ef4b9ad44e0b222cdb313a5 (diff)
downloadmariadb-git-60c04be6599597548ad07ce11e1d7d4004a7cc9c.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql')
-rw-r--r--sql/CMakeLists.txt47
-rw-r--r--sql/events.cc40
-rw-r--r--sql/handler.cc103
-rw-r--r--sql/handler.h16
-rw-r--r--sql/item_func.cc19
-rw-r--r--sql/item_func.h11
-rw-r--r--sql/share/errmsg-utf8.txt2
-rw-r--r--sql/sql_insert.cc7
-rw-r--r--sql/sql_partition.cc65
-rw-r--r--sql/sql_table.cc21
-rw-r--r--sql/sql_yacc.yy17
-rw-r--r--sql/sql_yacc_ora.yy19
-rw-r--r--sql/threadpool_win.cc1
-rw-r--r--sql/wsrep_mysqld.cc1
14 files changed, 237 insertions, 132 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 48416650903..52fab2a029f 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -210,9 +210,9 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
# without necessity.E.g source modifications, that do not
# change list of exported symbols, will not result in a relink for plugins.
- SET(MYSQLD_DEF ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.def)
- SET(MYSQLD_EXP ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.exp)
- SET(MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.lib)
+ SET(MYSQLD_DEF ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib${CMAKE_CFG_INTDIR}.def)
+ SET(MYSQLD_EXP ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib${CMAKE_CFG_INTDIR}.exp)
+ SET(MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib${CMAKE_CFG_INTDIR}.lib)
SET(MYSQLD_CORELIBS sql mysys dbug strings)
FOREACH (CORELIB ${MYSQLD_CORELIBS})
SET (LIB_LOCATIONS ${LIB_LOCATIONS} $<TARGET_FILE:${CORELIB}>)
@@ -225,12 +225,12 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
# Create a cmake script to generate import and export libs
# from a .def file
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "
- IF ((mysqld_lib.def IS_NEWER_THAN mysqld_lib.lib) OR
- (mysqld_lib.def IS_NEWER_THAN mysqld_lib.exp))
- FILE(REMOVE mysqld_lib.lib mysqld_lib.exp)
+ IF ((mysqld_lib\${CFG}.def IS_NEWER_THAN mysqld_lib\${CFG}.lib) OR
+ (mysqld_lib\${CFG}.def IS_NEWER_THAN mysqld_lib\${CFG}.exp))
+ FILE(REMOVE mysqld_lib\${CFG}.lib mysqld_lib\${CFG}.exp)
SET(ENV{VS_UNICODE_OUTPUT})
EXECUTE_PROCESS (
- COMMAND \"${CMAKE_LINKER}\" /lib /NAME:mysqld.exe \"/DEF:${MYSQLD_DEF}\" /MACHINE:${_PLATFORM}
+ COMMAND \"${CMAKE_LINKER}\" /lib /NAME:mysqld.exe \"/DEF:${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib\${CFG}.def\" /MACHINE:${_PLATFORM}
RESULT_VARIABLE ret)
IF(NOT ret EQUAL 0)
MESSAGE(FATAL_ERROR \"process failed ret=\${ret}\")
@@ -240,41 +240,22 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/cmake/configurable_file_content.in
- make_mysqld_lib.cmake)
+ make_mysqld_lib.cmake
+ @ONLY)
IF(CMAKE_VERSION VERSION_GREATER "3.2.0")
SET(MYSQLD_LIB_BYPRODUCTS BYPRODUCTS ${MYSQLD_DEF} ${MYSQLD_LIB} ${MYSQLD_EXP})
ENDIF()
- # Create a cmake script to generate import and export libs
- # from a .def file
- SET(CMAKE_CONFIGURABLE_FILE_CONTENT "
- IF ((mysqld_lib.def IS_NEWER_THAN mysqld_lib.lib) OR
- (mysqld_lib.def IS_NEWER_THAN mysqld_lib.exp))
- FILE(REMOVE mysqld_lib.lib mysqld_lib.exp)
- SET(ENV{VS_UNICODE_OUTPUT})
- EXECUTE_PROCESS (
- COMMAND \"${CMAKE_LINKER}\" /lib /NAME:mysqld.exe \"/DEF:${MYSQLD_DEF}\" /MACHINE:${_PLATFORM}
- RESULT_VARIABLE ret)
- IF(NOT ret EQUAL 0)
- MESSAGE(FATAL_ERROR \"process failed ret=\${ret}\")
- ENDIF()
- ENDIF()
- ")
-
- CONFIGURE_FILE(
- ${PROJECT_SOURCE_DIR}/cmake/configurable_file_content.in
- make_mysqld_lib.cmake)
-
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.stamp
${MYSQLD_LIB_BYPRODUCTS}
- COMMENT "Generating mysqld_lib.def, mysqld_lib.lib, mysqld_lib.exp"
+ COMMENT "Generating ${MYSQLD_DEF}, ${MYSQLD_LIB}, ${MYSQLD_EXP}"
COMMAND cscript //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
- ${_PLATFORM} /forLib ${LIB_LOCATIONS} > mysqld_lib.def.tmp
- COMMAND ${CMAKE_COMMAND} -E copy_if_different mysqld_lib.def.tmp mysqld_lib.def
- COMMAND ${CMAKE_COMMAND} -E remove mysqld_lib.def.tmp
- COMMAND ${CMAKE_COMMAND} -P make_mysqld_lib.cmake
+ ${_PLATFORM} /forLib ${LIB_LOCATIONS} > ${MYSQLD_DEF}.tmp
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MYSQLD_DEF}.tmp ${MYSQLD_DEF}
+ COMMAND ${CMAKE_COMMAND} -E remove ${MYSQLD_DEF}.tmp
+ COMMAND ${CMAKE_COMMAND} "-DCFG=${CMAKE_CFG_INTDIR}" -P make_mysqld_lib.cmake
COMMAND ${CMAKE_COMMAND} -E touch mysqld_lib.stamp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${MYSQLD_CORELIBS}
diff --git a/sql/events.cc b/sql/events.cc
index 166fa992f88..242689f8370 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -1202,6 +1202,46 @@ Events::load_events_from_db(THD *thd)
delete et;
goto end;
}
+
+#ifdef WITH_WSREP
+ /**
+ IF SST is done from a galera node that is also acting as MASTER
+ newly synced node in galera eco-system will also copy-over the event state
+ enabling duplicate event in galera eco-system.
+ DISABLE such events if the current node is not event orginator.
+ (Also, make sure you skip disabling it if is already disabled to avoid
+ creation of redundant action)
+ NOTE:
+ This complete system relies on server-id. Ideally server-id should be
+ same for all nodes of galera eco-system but they aren't same.
+ Infact, based on galera use-case it seems like it recommends to have each
+ node with different server-id.
+ */
+ if (et->originator != thd->variables.server_id)
+ {
+ if (et->status == Event_parse_data::SLAVESIDE_DISABLED)
+ continue;
+
+ store_record(table, record[1]);
+ table->field[ET_FIELD_STATUS]->
+ store((longlong) Event_parse_data::SLAVESIDE_DISABLED,
+ TRUE);
+
+ /* All the dmls to mysql.events tables are stmt bin-logged. */
+ bool save_binlog_row_based;
+ if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
+ thd->set_current_stmt_binlog_format_stmt();
+
+ (void) table->file->ha_update_row(table->record[1], table->record[0]);
+
+ if (save_binlog_row_based)
+ thd->set_current_stmt_binlog_format_row();
+
+ delete et;
+ continue;
+ }
+#endif /* WITH_WSREP */
+
/**
Since the Event_queue_element object could be deleted inside
Event_queue::create_event we should save the value of dropped flag
diff --git a/sql/handler.cc b/sql/handler.cc
index 647848f7702..fe0af08c8cf 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -7375,8 +7375,7 @@ bool Vers_parse_info::fix_implicit(THD *thd, Alter_info *alter_info)
bool Table_scope_and_contents_source_st::vers_fix_system_fields(
- THD *thd, Alter_info *alter_info, const TABLE_LIST &create_table,
- bool create_select)
+ THD *thd, Alter_info *alter_info, const TABLE_LIST &create_table)
{
DBUG_ASSERT(!(alter_info->flags & ALTER_DROP_SYSTEM_VERSIONING));
@@ -7416,41 +7415,59 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
if (vers_info.fix_implicit(thd, alter_info))
return true;
- int plain_cols= 0; // columns don't have WITH or WITHOUT SYSTEM VERSIONING
- int vers_cols= 0; // columns have WITH SYSTEM VERSIONING
- it.rewind();
- while (const Create_field *f= it++)
- {
- if (vers_info.is_start(*f) || vers_info.is_end(*f))
- continue;
-
- if (f->versioning == Column_definition::VERSIONING_NOT_SET)
- plain_cols++;
- else if (f->versioning == Column_definition::WITH_VERSIONING)
- vers_cols++;
- }
-
- if (!thd->lex->tmp_table() &&
- // CREATE from SELECT (Create_fields are not yet added)
- !create_select && vers_cols == 0 && (plain_cols == 0 || !vers_info))
- {
- my_error(ER_VERS_TABLE_MUST_HAVE_COLUMNS, MYF(0),
- create_table.table_name.str);
- return true;
- }
-
return false;
}
bool Table_scope_and_contents_source_st::vers_check_system_fields(
- THD *thd, Alter_info *alter_info, const TABLE_LIST &create_table)
+ THD *thd, Alter_info *alter_info, const Lex_table_name &table_name,
+ const Lex_table_name &db, int select_count)
{
if (!(options & HA_VERSIONED_TABLE))
return false;
- return vers_info.check_sys_fields(
- create_table.table_name, create_table.db, alter_info,
- ha_check_storage_engine_flag(db_type, HTON_NATIVE_SYS_VERSIONING));
+
+ if (!(alter_info->flags & ALTER_DROP_SYSTEM_VERSIONING))
+ {
+ uint versioned_fields= 0;
+ uint fieldnr= 0;
+ List_iterator<Create_field> field_it(alter_info->create_list);
+ while (Create_field *f= field_it++)
+ {
+ /*
+ The field from the CREATE part can be duplicated in the SELECT part of
+ CREATE...SELECT. In that case double counts should be avoided.
+ select_create::create_table_from_items just pushes the fields back into
+ the create_list, without additional manipulations, so the fields from
+ SELECT go last there.
+ */
+ bool is_dup= false;
+ if (fieldnr >= alter_info->create_list.elements - select_count)
+ {
+ List_iterator<Create_field> dup_it(alter_info->create_list);
+ for (Create_field *dup= dup_it++; !is_dup && dup != f; dup= dup_it++)
+ is_dup= my_strcasecmp(default_charset_info,
+ dup->field_name.str, f->field_name.str) == 0;
+ }
+
+ if (!(f->flags & VERS_UPDATE_UNVERSIONED_FLAG) && !is_dup)
+ versioned_fields++;
+ fieldnr++;
+ }
+ if (versioned_fields == VERSIONING_FIELDS)
+ {
+ my_error(ER_VERS_TABLE_MUST_HAVE_COLUMNS, MYF(0), table_name.str);
+ return true;
+ }
+ }
+
+ if (!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING))
+ return false;
+
+ bool can_native= ha_check_storage_engine_flag(db_type,
+ HTON_NATIVE_SYS_VERSIONING)
+ || db_type->db_type == DB_TYPE_PARTITION_DB;
+
+ return vers_info.check_sys_fields(table_name, db, alter_info, can_native);
}
@@ -7554,20 +7571,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
return false;
}
- if (fix_implicit(thd, alter_info))
- return true;
-
- if (alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING)
- {
- const bool can_native=
- ha_check_storage_engine_flag(create_info->db_type,
- HTON_NATIVE_SYS_VERSIONING) ||
- create_info->db_type->db_type == DB_TYPE_PARTITION_DB;
- if (check_sys_fields(table_name, share->db, alter_info, can_native))
- return true;
- }
-
- return false;
+ return fix_implicit(thd, alter_info);
}
bool
@@ -7774,10 +7778,12 @@ bool Table_period_info::check_field(const Create_field* f,
}
bool Table_scope_and_contents_source_st::check_fields(
- THD *thd, Alter_info *alter_info, TABLE_LIST &create_table)
+ THD *thd, Alter_info *alter_info,
+ const Lex_table_name &table_name, const Lex_table_name &db, int select_count)
{
- return vers_check_system_fields(thd, alter_info, create_table)
- || check_period_fields(thd, alter_info);
+ return vers_check_system_fields(thd, alter_info,
+ table_name, db, select_count) ||
+ check_period_fields(thd, alter_info);
}
bool Table_scope_and_contents_source_st::check_period_fields(
@@ -7826,10 +7832,9 @@ bool Table_scope_and_contents_source_st::check_period_fields(
bool
Table_scope_and_contents_source_st::fix_create_fields(THD *thd,
Alter_info *alter_info,
- const TABLE_LIST &create_table,
- bool create_select)
+ const TABLE_LIST &create_table)
{
- return vers_fix_system_fields(thd, alter_info, create_table, create_select)
+ return vers_fix_system_fields(thd, alter_info, create_table)
|| fix_period_fields(thd, alter_info);
}
diff --git a/sql/handler.h b/sql/handler.h
index 5e5c0ffc001..46de5e5f017 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -2163,18 +2163,22 @@ struct Table_scope_and_contents_source_st:
}
bool fix_create_fields(THD *thd, Alter_info *alter_info,
- const TABLE_LIST &create_table,
- bool create_select= false);
+ const TABLE_LIST &create_table);
bool fix_period_fields(THD *thd, Alter_info *alter_info);
- bool check_fields(THD *thd, Alter_info *alter_info, TABLE_LIST &create_table);
+ bool check_fields(THD *thd, Alter_info *alter_info,
+ const Lex_table_name &table_name,
+ const Lex_table_name &db,
+ int select_count= 0);
bool check_period_fields(THD *thd, Alter_info *alter_info);
bool vers_fix_system_fields(THD *thd, Alter_info *alter_info,
- const TABLE_LIST &create_table,
- bool create_select= false);
+ const TABLE_LIST &create_table);
bool vers_check_system_fields(THD *thd, Alter_info *alter_info,
- const TABLE_LIST &create_table);
+ const Lex_table_name &table_name,
+ const Lex_table_name &db,
+ int select_count= 0);
+
};
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 16200bbb48c..aa35b7a3b16 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1223,17 +1223,22 @@ bool Item_func_minus::fix_length_and_dec()
if (Item_func_minus::type_handler()->Item_func_minus_fix_length_and_dec(this))
DBUG_RETURN(TRUE);
DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
- m_sql_mode_dependency= Item_func::value_depends_on_sql_mode();
- if (unsigned_flag)
- {
- m_sql_mode_dependency|= Sql_mode_dependency(0,MODE_NO_UNSIGNED_SUBTRACTION);
- if (current_thd->variables.sql_mode & MODE_NO_UNSIGNED_SUBTRACTION)
- unsigned_flag= false;
- }
+ if ((m_depends_on_sql_mode_no_unsigned_subtraction= unsigned_flag) &&
+ (current_thd->variables.sql_mode & MODE_NO_UNSIGNED_SUBTRACTION))
+ unsigned_flag= false;
DBUG_RETURN(FALSE);
}
+Sql_mode_dependency Item_func_minus::value_depends_on_sql_mode() const
+{
+ Sql_mode_dependency dep= Item_func_additive_op::value_depends_on_sql_mode();
+ if (m_depends_on_sql_mode_no_unsigned_subtraction)
+ dep|= Sql_mode_dependency(0, MODE_NO_UNSIGNED_SUBTRACTION);
+ return dep;
+}
+
+
double Item_func_minus::real_op()
{
double value= args[0]->val_real() - args[1]->val_real();
diff --git a/sql/item_func.h b/sql/item_func.h
index ef221f4b2ef..45030b7a3dc 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1327,16 +1327,15 @@ public:
class Item_func_minus :public Item_func_additive_op
{
- Sql_mode_dependency m_sql_mode_dependency;
+ bool m_depends_on_sql_mode_no_unsigned_subtraction;
public:
Item_func_minus(THD *thd, Item *a, Item *b):
- Item_func_additive_op(thd, a, b) {}
+ Item_func_additive_op(thd, a, b),
+ m_depends_on_sql_mode_no_unsigned_subtraction(false)
+ { }
const char *func_name() const { return "-"; }
enum precedence precedence() const { return ADD_PRECEDENCE; }
- Sql_mode_dependency value_depends_on_sql_mode() const
- {
- return m_sql_mode_dependency;
- }
+ Sql_mode_dependency value_depends_on_sql_mode() const;
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index c91132c1eae..03bd72c41b0 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7340,6 +7340,8 @@ ER_NO_EIS_FOR_FIELD
ER_WARN_AGGFUNC_DEPENDENCE
eng "Aggregate function '%-.192s)' of SELECT #%d belongs to SELECT #%d"
ukr "Агрегатна функція '%-.192s)' з SELECTу #%d належить до SELECTу #%d"
+WARN_INNODB_PARTITION_OPTION_IGNORED
+ eng "<%-.64s> option ignored for InnoDB partition"
#
# Internal errors, not used
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 8404d777334..fe6c5fa8ec4 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4202,7 +4202,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
if (!opt_explicit_defaults_for_timestamp)
promote_first_timestamp_column(&alter_info->create_list);
- if (create_info->fix_create_fields(thd, alter_info, *create_table, true))
+ if (create_info->fix_create_fields(thd, alter_info, *create_table))
DBUG_RETURN(NULL);
while ((item=it++))
@@ -4241,7 +4241,10 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
alter_info->create_list.push_back(cr_field, thd->mem_root);
}
- if (create_info->check_fields(thd, alter_info, *create_table))
+ if (create_info->check_fields(thd, alter_info,
+ create_table->table_name,
+ create_table->db,
+ select_field_count))
DBUG_RETURN(NULL);
DEBUG_SYNC(thd,"create_table_select_before_create");
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 668e8051f3f..65d79ac2d25 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -4790,6 +4790,69 @@ bool compare_partition_options(HA_CREATE_INFO *table_create_info,
}
+/**
+ Check if the ALTER command tries to change DATA DIRECTORY
+ or INDEX DIRECTORY for its partitions and warn if so.
+ @param thd THD
+ @param part_elem partition_element to check
+ */
+static void warn_if_datadir_altered(THD *thd,
+ const partition_element *part_elem)
+{
+ DBUG_ASSERT(part_elem);
+
+ if (part_elem->engine_type &&
+ part_elem->engine_type->db_type != DB_TYPE_INNODB)
+ return;
+
+ if (part_elem->data_file_name)
+ {
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ WARN_INNODB_PARTITION_OPTION_IGNORED,
+ ER(WARN_INNODB_PARTITION_OPTION_IGNORED),
+ "DATA DIRECTORY");
+ }
+ if (part_elem->index_file_name)
+ {
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ WARN_INNODB_PARTITION_OPTION_IGNORED,
+ ER(WARN_INNODB_PARTITION_OPTION_IGNORED),
+ "INDEX DIRECTORY");
+ }
+}
+
+
+/**
+ Currently changing DATA DIRECTORY and INDEX DIRECTORY for InnoDB partitions is
+ not possible. This function checks it and warns on that case.
+ @param thd THD
+ @param tab_part_info old partition info
+ @param alt_part_info new partition info
+ */
+static void check_datadir_altered_for_innodb(THD *thd,
+ partition_info *tab_part_info,
+ partition_info *alt_part_info)
+{
+ if (tab_part_info->default_engine_type->db_type != DB_TYPE_INNODB)
+ return;
+
+ for (List_iterator_fast<partition_element> it(alt_part_info->partitions);
+ partition_element *part_elem= it++;)
+ {
+ if (alt_part_info->is_sub_partitioned())
+ {
+ for (List_iterator_fast<partition_element> it2(part_elem->subpartitions);
+ const partition_element *sub_part_elem= it2++;)
+ {
+ warn_if_datadir_altered(thd, sub_part_elem);
+ }
+ }
+ else
+ warn_if_datadir_altered(thd, part_elem);
+ }
+}
+
+
/*
Prepare for ALTER TABLE of partition structure
@@ -5625,6 +5688,8 @@ state of p1.
{
goto err;
}
+ check_datadir_altered_for_innodb(thd, tab_part_info, alt_part_info);
+
/*
Online handling:
REORGANIZE PARTITION:
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index f736de24bed..9e44eefbf9b 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -8697,13 +8697,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
}
- if (table->versioned() && !(alter_info->flags & ALTER_DROP_SYSTEM_VERSIONING) &&
- new_create_list.elements == VERSIONING_FIELDS)
- {
- my_error(ER_VERS_TABLE_MUST_HAVE_COLUMNS, MYF(0), table->s->table_name.str);
- goto err;
- }
-
if (!create_info->comment.str)
{
create_info->comment.str= table->s->comment.str;
@@ -9787,8 +9780,9 @@ do_continue:;
set_table_default_charset(thd, create_info, alter_ctx.db);
- if (create_info->check_period_fields(thd, alter_info)
- || create_info->fix_period_fields(thd, alter_info))
+ if (create_info->check_fields(thd, alter_info,
+ table_list->table_name, table_list->db) ||
+ create_info->fix_period_fields(thd, alter_info))
DBUG_RETURN(true);
if (!opt_explicit_defaults_for_timestamp)
@@ -10287,7 +10281,7 @@ do_continue:;
close_all_tables_for_name(thd, table->s,
alter_ctx.is_table_renamed() ?
- HA_EXTRA_PREPARE_FOR_RENAME:
+ HA_EXTRA_PREPARE_FOR_RENAME:
HA_EXTRA_NOT_USED,
NULL);
table_list->table= table= NULL; /* Safety */
@@ -10482,7 +10476,7 @@ bool mysql_trans_prepare_alter_copy_data(THD *thd)
/*
Turn off recovery logging since rollback of an alter table is to
delete the new table so there is no need to log the changes to it.
-
+
This needs to be done before external_lock.
*/
DBUG_RETURN(ha_enable_transaction(thd, FALSE) != 0);
@@ -10640,7 +10634,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
char warn_buff[MYSQL_ERRMSG_SIZE];
bool save_abort_on_warning= thd->abort_on_warning;
thd->abort_on_warning= false;
- my_snprintf(warn_buff, sizeof(warn_buff),
+ my_snprintf(warn_buff, sizeof(warn_buff),
"ORDER BY ignored as there is a user-defined clustered index"
" in the table '%-.192s'", from->s->table_name.str);
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
@@ -11409,7 +11403,8 @@ bool Sql_cmd_create_table_like::execute(THD *thd)
else
{
if (create_info.fix_create_fields(thd, &alter_info, *create_table) ||
- create_info.check_fields(thd, &alter_info, *create_table))
+ create_info.check_fields(thd, &alter_info,
+ create_table->table_name, create_table->db))
goto end_with_restore_list;
/*
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index c6fa32d8117..3756982b384 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -7134,7 +7134,8 @@ field_length:
'(' LONG_NUM ')' { $$= $2.str; }
| '(' ULONGLONG_NUM ')' { $$= $2.str; }
| '(' DECIMAL_NUM ')' { $$= $2.str; }
- | '(' NUM ')' { $$= $2.str; };
+ | '(' NUM ')' { $$= $2.str; }
+ ;
opt_field_length:
/* empty */ { $$= (char*) 0; /* use default length */ }
@@ -7753,7 +7754,8 @@ string_list:
text_string
{ Lex->last_field->interval_list.push_back($1, thd->mem_root); }
| string_list ',' text_string
- { Lex->last_field->interval_list.push_back($3, thd->mem_root); };
+ { Lex->last_field->interval_list.push_back($3, thd->mem_root); }
+ ;
/*
** Alter table
@@ -14921,7 +14923,8 @@ line_term:
opt_xml_rows_identified_by:
/* empty */ { }
| ROWS_SYM IDENTIFIED_SYM BY text_string
- { Lex->exchange->line_term = $4; };
+ { Lex->exchange->line_term = $4; }
+ ;
opt_ignore_lines:
/* empty */
@@ -17456,7 +17459,7 @@ opt_release:
{ $$= TVL_UNKNOWN; }
| RELEASE_SYM { $$= TVL_YES; }
| NO_SYM RELEASE_SYM { $$= TVL_NO; }
-;
+ ;
commit:
COMMIT_SYM opt_work opt_chain opt_release
@@ -17931,9 +17934,9 @@ uninstall:
/* Avoid compiler warning from sql_yacc.cc where yyerrlab1 is not used */
keep_gcc_happy:
IMPOSSIBLE_ACTION
- {
- YYERROR;
- }
+ {
+ YYERROR;
+ }
;
/**
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index aac2e009696..eda8834ff6a 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.yy
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
/* sql_yacc.yy */
@@ -7195,7 +7195,8 @@ field_length:
'(' LONG_NUM ')' { $$= $2.str; }
| '(' ULONGLONG_NUM ')' { $$= $2.str; }
| '(' DECIMAL_NUM ')' { $$= $2.str; }
- | '(' NUM ')' { $$= $2.str; };
+ | '(' NUM ')' { $$= $2.str; }
+ ;
opt_field_length:
/* empty */ { $$= (char*) 0; /* use default length */ }
@@ -7854,7 +7855,8 @@ string_list:
text_string
{ Lex->last_field->interval_list.push_back($1, thd->mem_root); }
| string_list ',' text_string
- { Lex->last_field->interval_list.push_back($3, thd->mem_root); };
+ { Lex->last_field->interval_list.push_back($3, thd->mem_root); }
+ ;
/*
** Alter table
@@ -15053,7 +15055,8 @@ line_term:
opt_xml_rows_identified_by:
/* empty */ { }
| ROWS_SYM IDENTIFIED_SYM BY text_string
- { Lex->exchange->line_term = $4; };
+ { Lex->exchange->line_term = $4; }
+ ;
opt_ignore_lines:
/* empty */
@@ -17675,7 +17678,7 @@ opt_release:
{ $$= TVL_UNKNOWN; }
| RELEASE_SYM { $$= TVL_YES; }
| NO_SYM RELEASE_SYM { $$= TVL_NO; }
-;
+ ;
commit:
COMMIT_SYM opt_work opt_chain opt_release
@@ -18162,9 +18165,9 @@ uninstall:
/* Avoid compiler warning from sql_yacc.cc where yyerrlab1 is not used */
keep_gcc_happy:
IMPOSSIBLE_ACTION
- {
- YYERROR;
- }
+ {
+ YYERROR;
+ }
;
/**
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc
index bac4ab9f3b4..6e96fa8e11c 100644
--- a/sql/threadpool_win.cc
+++ b/sql/threadpool_win.cc
@@ -294,6 +294,7 @@ TP_connection_win::~TP_connection_win()
if (timer)
{
+ SetThreadpoolTimer(timer, 0, 0, 0);
WaitForThreadpoolTimerCallbacks(timer, TRUE);
CloseThreadpoolTimer(timer);
}
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index fde29ae434d..4307b41d632 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -47,7 +47,6 @@
#include <string>
#include "log_event.h"
#include <slave.h>
-#include "sql_plugin.h" /* wsrep_plugins_pre_init() */
#include <sstream>