@@ -1173,6 +1173,17 @@ innobase_end(
11731173handlerton* hton, /* in: Innodb handlerton */
11741174ha_panic_function type);
11751175
1176+ #if NOT_USED
1177+ /*****************************************************************//**
1178+ Stores the current binlog coordinates in the trx system header. */
1179+ static
1180+ int
1181+ innobase_store_binlog_info(
1182+ /*=======================*/
1183+ handlerton* hton, /*!< in: InnoDB handlerton */
1184+ THD* thd); /*!< in: MySQL thread handle */
1185+ #endif
1186+
11761187/*****************************************************************//**
11771188Creates an InnoDB transaction struct for the thd if it does not yet have one.
11781189Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -3268,6 +3279,9 @@ innobase_init(
32683279innobase_hton->start_consistent_snapshot =
32693280innobase_start_trx_and_assign_read_view;
32703281
3282+ /*innobase_hton->store_binlog_info =
3283+ innobase_store_binlog_info;*/
3284+
32713285innobase_hton->flush_logs = innobase_flush_logs;
32723286innobase_hton->show_status = innobase_show_status;
32733287innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS |
@@ -3978,6 +3992,38 @@ innobase_commit_low(
39783992}
39793993}
39803994
3995+ #if NOT_USED
3996+ /*****************************************************************//**
3997+ Stores the current binlog coordinates in the trx system header. */
3998+ static
3999+ int
4000+ innobase_store_binlog_info(
4001+ /*=======================*/
4002+ handlerton* hton, /*!< in: InnoDB handlerton */
4003+ THD* thd) /*!< in: MySQL thread handle */
4004+
4005+ {
4006+ const char* file_name;
4007+ unsigned long long pos;
4008+ mtr_t mtr;
4009+
4010+ DBUG_ENTER("innobase_store_binlog_info");
4011+
4012+ thd_binlog_pos(thd, &file_name, &pos);
4013+
4014+ mtr_start(&mtr);
4015+
4016+ trx_sys_update_mysql_binlog_offset(file_name, pos,
4017+ TRX_SYS_MYSQL_LOG_INFO, &mtr);
4018+
4019+ mtr_commit(&mtr);
4020+
4021+ innobase_flush_logs(hton);
4022+
4023+ DBUG_RETURN(0);
4024+ }
4025+ #endif
4026+
39814027/*****************************************************************//**
39824028Creates an InnoDB transaction struct for the thd if it does not yet have one.
39834029Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -9571,7 +9617,8 @@ create_table_def(
95719617
95729618/* MySQL does the name length check. But we do additional check
95739619on the name length here */
9574- if (strlen(table_name) > MAX_FULL_NAME_LEN) {
9620+ const size_t table_name_len = strlen(table_name);
9621+ if (table_name_len > MAX_FULL_NAME_LEN) {
95759622push_warning_printf(
95769623thd, Sql_condition::WARN_LEVEL_WARN,
95779624ER_TABLE_NAME,
@@ -9580,6 +9627,15 @@ create_table_def(
95809627DBUG_RETURN(ER_TABLE_NAME);
95819628}
95829629
9630+ if (table_name[table_name_len - 1] == '/') {
9631+ push_warning_printf(
9632+ thd, Sql_condition::WARN_LEVEL_WARN,
9633+ ER_TABLE_NAME,
9634+ "InnoDB: Table name is empty");
9635+
9636+ DBUG_RETURN(ER_WRONG_TABLE_NAME);
9637+ }
9638+
95839639n_cols = form->s->fields;
95849640s_cols = form->s->stored_fields;
95859641
@@ -10894,6 +10950,10 @@ ha_innobase::discard_or_import_tablespace(
1089410950DBUG_RETURN(HA_ERR_TABLE_READONLY);
1089510951}
1089610952
10953+ if (UNIV_UNLIKELY(prebuilt->trx->fake_changes)) {
10954+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
10955+ }
10956+
1089710957dict_table = prebuilt->table;
1089810958
1089910959if (dict_table->space == TRX_SYS_SPACE) {
@@ -12590,8 +12650,8 @@ ha_innobase::check(
1259012650my_error(ER_QUERY_INTERRUPTED, MYF(0));
1259112651}
1259212652
12593- if (UNIV_UNLIKELY(share->ib_table->is_corrupt )) {
12594- return (HA_ADMIN_CORRUPT);
12653+ if (UNIV_UNLIKELY(prebuilt->table && prebuilt->table->corrupted )) {
12654+ DBUG_RETURN (HA_ADMIN_CORRUPT);
1259512655}
1259612656
1259712657DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
@@ -15083,6 +15143,9 @@ innodb_log_archive_update(
1508315143void* var_ptr,
1508415144const void* save)
1508515145{
15146+ if (srv_read_only_mode)
15147+ return;
15148+
1508615149my_bool in_val = *static_cast<const my_bool*>(save);
1508715150
1508815151if (in_val) {
0 commit comments