@@ -1134,6 +1134,15 @@ innobase_end(
11341134handlerton* hton, /* in: Innodb handlerton */
11351135ha_panic_function type);
11361136
1137+ /*****************************************************************//**
1138+ Stores the current binlog coordinates in the trx system header. */
1139+ static
1140+ int
1141+ innobase_store_binlog_info(
1142+ /*=======================*/
1143+ handlerton* hton, /*!< in: InnoDB handlerton */
1144+ THD* thd); /*!< in: MySQL thread handle */
1145+
11371146/*****************************************************************//**
11381147Creates an InnoDB transaction struct for the thd if it does not yet have one.
11391148Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -3197,6 +3206,9 @@ innobase_init(
31973206innobase_hton->clone_consistent_snapshot =
31983207innobase_start_trx_and_clone_read_view;
31993208
3209+ innobase_hton->store_binlog_info =
3210+ innobase_store_binlog_info;
3211+
32003212innobase_hton->flush_logs = innobase_flush_logs;
32013213innobase_hton->show_status = innobase_show_status;
32023214innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS |
@@ -3897,6 +3909,35 @@ innobase_commit_low(
38973909}
38983910}
38993911
3912+ /*****************************************************************//**
3913+ Stores the current binlog coordinates in the trx system header. */
3914+ static
3915+ int
3916+ innobase_store_binlog_info(
3917+ /*=======================*/
3918+ handlerton* hton, /*!< in: InnoDB handlerton */
3919+ THD* thd) /*!< in: MySQL thread handle */
3920+ {
3921+ const char* file_name;
3922+ unsigned long long pos;
3923+ mtr_t mtr;
3924+
3925+ DBUG_ENTER("innobase_store_binlog_info");
3926+
3927+ thd_binlog_pos(thd, &file_name, &pos);
3928+
3929+ mtr_start(&mtr);
3930+
3931+ trx_sys_update_mysql_binlog_offset(file_name, pos,
3932+ TRX_SYS_MYSQL_LOG_INFO, &mtr);
3933+
3934+ mtr_commit(&mtr);
3935+
3936+ innobase_flush_logs(hton);
3937+
3938+ DBUG_RETURN(0);
3939+ }
3940+
39003941/*****************************************************************//**
39013942Creates an InnoDB transaction struct for the thd if it does not yet have one.
39023943Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -9240,7 +9281,8 @@ create_table_def(
92409281
92419282/* MySQL does the name length check. But we do additional check
92429283on the name length here */
9243- if (strlen(table_name) > MAX_FULL_NAME_LEN) {
9284+ const size_t table_name_len = strlen(table_name);
9285+ if (table_name_len > MAX_FULL_NAME_LEN) {
92449286push_warning_printf(
92459287thd, Sql_condition::WARN_LEVEL_WARN,
92469288ER_TABLE_NAME,
@@ -9249,6 +9291,15 @@ create_table_def(
92499291DBUG_RETURN(ER_TABLE_NAME);
92509292}
92519293
9294+ if (table_name[table_name_len - 1] == '/') {
9295+ push_warning_printf(
9296+ thd, Sql_condition::WARN_LEVEL_WARN,
9297+ ER_TABLE_NAME,
9298+ "InnoDB: Table name is empty");
9299+
9300+ DBUG_RETURN(ER_WRONG_TABLE_NAME);
9301+ }
9302+
92529303n_cols = form->s->fields;
92539304
92549305/* Check whether there already exists a FTS_DOC_ID column */
@@ -10566,6 +10617,10 @@ ha_innobase::discard_or_import_tablespace(
1056610617DBUG_RETURN(HA_ERR_TABLE_READONLY);
1056710618}
1056810619
10620+ if (UNIV_UNLIKELY(prebuilt->trx->fake_changes)) {
10621+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
10622+ }
10623+
1056910624dict_table = prebuilt->table;
1057010625
1057110626if (dict_table->space == TRX_SYS_SPACE) {
@@ -12239,8 +12294,8 @@ ha_innobase::check(
1223912294thd_set_kill_status(user_thd);
1224012295}
1224112296
12242- if (UNIV_UNLIKELY(share->ib_table->is_corrupt )) {
12243- return (HA_ADMIN_CORRUPT);
12297+ if (UNIV_UNLIKELY(prebuilt->table && prebuilt->table->corrupted )) {
12298+ DBUG_RETURN (HA_ADMIN_CORRUPT);
1224412299}
1224512300
1224612301DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
@@ -14720,6 +14775,9 @@ innodb_log_archive_update(
1472014775void* var_ptr,
1472114776const void* save)
1472214777{
14778+ if (srv_read_only_mode)
14779+ return;
14780+
1472314781my_bool in_val = *static_cast<const my_bool*>(save);
1472414782
1472514783if (in_val) {
0 commit comments