summaryrefslogtreecommitdiffstats
path: root/storage/innobase/handler/ha_innodb.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /storage/innobase/handler/ha_innodb.cc
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-rw-r--r--storage/innobase/handler/ha_innodb.cc84
1 files changed, 42 insertions, 42 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 21bf10a1..407834f2 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1575,7 +1575,8 @@ static void innodb_drop_database(handlerton*, char *path)
ibuf_delete_for_discarded_space(id);
/* Any changes must be persisted before we return. */
- log_write_up_to(mtr.commit_lsn(), true);
+ if (mtr.commit_lsn())
+ log_write_up_to(mtr.commit_lsn(), true);
}
my_free(namebuf);
@@ -2080,7 +2081,7 @@ all_fail:
ut_d(purge_sys.resume_FTS());
}
-static void innodb_ddl_recovery_done(handlerton*)
+static int innodb_ddl_recovery_done(handlerton*)
{
ut_ad(!ddl_recovery_done);
ut_d(ddl_recovery_done= true);
@@ -2091,6 +2092,7 @@ static void innodb_ddl_recovery_done(handlerton*)
drop_garbage_tables_after_restore();
srv_init_purge_tasks();
}
+ return 0;
}
/********************************************************************//**
@@ -4001,7 +4003,7 @@ static int innodb_init_params()
data_mysql_default_charset_coll = (ulint) default_charset_info->number;
-#ifndef _WIN32
+#ifdef HAVE_FCNTL_DIRECT
if (srv_use_atomic_writes && my_may_have_atomic_write) {
/*
Force O_DIRECT on Unixes (on Windows writes are always
@@ -4026,11 +4028,6 @@ static int innodb_init_params()
}
#endif
- if (srv_read_only_mode) {
- ib::info() << "Started in read only mode";
- srv_use_doublewrite_buf = FALSE;
- }
-
#if !defined LINUX_NATIVE_AIO && !defined HAVE_URING && !defined _WIN32
/* Currently native AIO is supported only on windows and linux
and that also when the support is compiled in. In all other
@@ -4046,9 +4043,7 @@ static int innodb_init_params()
}
#endif
-#ifndef _WIN32
- ut_ad(srv_file_flush_method <= SRV_O_DIRECT_NO_FSYNC);
-#else
+#ifdef _WIN32
switch (srv_file_flush_method) {
case SRV_ALL_O_DIRECT_FSYNC + 1 /* "async_unbuffered"="unbuffered" */:
srv_file_flush_method = SRV_ALL_O_DIRECT_FSYNC;
@@ -4059,6 +4054,8 @@ static int innodb_init_params()
default:
ut_ad(srv_file_flush_method <= SRV_ALL_O_DIRECT_FSYNC);
}
+#else
+ ut_ad(srv_file_flush_method <= SRV_O_DIRECT_NO_FSYNC);
#endif
innodb_buffer_pool_size_init();
@@ -7817,20 +7814,6 @@ ha_innobase::write_row(
#endif
if ((error_result = update_auto_increment())) {
- /* We don't want to mask autoinc overflow errors. */
-
- /* Handle the case where the AUTOINC sub-system
- failed during initialization. */
- if (m_prebuilt->autoinc_error == DB_UNSUPPORTED) {
- error_result = ER_AUTOINC_READ_FAILED;
- /* Set the error message to report too. */
- my_error(ER_AUTOINC_READ_FAILED, MYF(0));
- goto func_exit;
- } else if (m_prebuilt->autoinc_error != DB_SUCCESS) {
- error = m_prebuilt->autoinc_error;
- goto report_error;
- }
-
/* MySQL errors are passed straight back. */
goto func_exit;
}
@@ -7968,7 +7951,6 @@ set_max_autoinc:
}
}
-report_error:
/* Cleanup and exit. */
if (error == DB_TABLESPACE_DELETED) {
ib_senderrf(
@@ -11809,8 +11791,6 @@ index_bad:
/* Set the flags2 when create table or alter tables */
m_flags2 |= DICT_TF2_FTS_AUX_HEX_NAME;
- DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name",
- m_flags2 &= ~DICT_TF2_FTS_AUX_HEX_NAME;);
DBUG_RETURN(true);
}
@@ -14710,12 +14690,7 @@ ha_innobase::info_low(
DBUG_ASSERT(ib_table->get_ref_count() > 0);
if (!ib_table->is_readable()) {
- ib_table->stats_mutex_lock();
- ib_table->stat_initialized = true;
- ib_table->stat_n_rows = 0;
- ib_table->stat_clustered_index_size = 0;
- ib_table->stat_sum_of_other_index_sizes = 0;
- ib_table->stats_mutex_unlock();
+ dict_stats_empty_table(ib_table, true);
}
if (flag & HA_STATUS_TIME) {
@@ -15674,15 +15649,17 @@ ha_innobase::extra(
{
/* Warning: since it is not sure that MariaDB calls external_lock()
before calling this function, m_prebuilt->trx can be obsolete! */
- trx_t* trx = check_trx_exists(ha_thd());
+ trx_t* trx;
switch (operation) {
case HA_EXTRA_FLUSH:
+ (void)check_trx_exists(ha_thd());
if (m_prebuilt->blob_heap) {
row_mysql_prebuilt_free_blob_heap(m_prebuilt);
}
break;
case HA_EXTRA_RESET_STATE:
+ trx = check_trx_exists(ha_thd());
reset_template();
trx->duplicates = 0;
stmt_boundary:
@@ -15691,18 +15668,23 @@ ha_innobase::extra(
trx->bulk_insert = false;
break;
case HA_EXTRA_NO_KEYREAD:
+ (void)check_trx_exists(ha_thd());
m_prebuilt->read_just_key = 0;
break;
case HA_EXTRA_KEYREAD:
+ (void)check_trx_exists(ha_thd());
m_prebuilt->read_just_key = 1;
break;
case HA_EXTRA_KEYREAD_PRESERVE_FIELDS:
+ (void)check_trx_exists(ha_thd());
m_prebuilt->keep_other_fields_on_keyread = 1;
break;
case HA_EXTRA_INSERT_WITH_UPDATE:
+ trx = check_trx_exists(ha_thd());
trx->duplicates |= TRX_DUP_IGNORE;
goto stmt_boundary;
case HA_EXTRA_NO_IGNORE_DUP_KEY:
+ trx = check_trx_exists(ha_thd());
trx->duplicates &= ~TRX_DUP_IGNORE;
if (trx->is_bulk_insert()) {
/* Allow a subsequent INSERT into an empty table
@@ -15714,9 +15696,11 @@ ha_innobase::extra(
}
goto stmt_boundary;
case HA_EXTRA_WRITE_CAN_REPLACE:
+ trx = check_trx_exists(ha_thd());
trx->duplicates |= TRX_DUP_REPLACE;
goto stmt_boundary;
case HA_EXTRA_WRITE_CANNOT_REPLACE:
+ trx = check_trx_exists(ha_thd());
trx->duplicates &= ~TRX_DUP_REPLACE;
if (trx->is_bulk_insert()) {
/* Allow a subsequent INSERT into an empty table
@@ -15725,6 +15709,7 @@ ha_innobase::extra(
}
goto stmt_boundary;
case HA_EXTRA_BEGIN_ALTER_COPY:
+ trx = check_trx_exists(ha_thd());
m_prebuilt->table->skip_alter_undo = 1;
if (m_prebuilt->table->is_temporary()
|| !m_prebuilt->table->versioned_by_id()) {
@@ -15737,8 +15722,10 @@ ha_innobase::extra(
.first->second.set_versioned(0);
break;
case HA_EXTRA_END_ALTER_COPY:
+ trx = check_trx_exists(ha_thd());
m_prebuilt->table->skip_alter_undo = 0;
- if (!m_prebuilt->table->is_temporary()) {
+ if (!m_prebuilt->table->is_temporary()
+ && !high_level_read_only) {
log_buffer_flush_to_disk();
}
break;
@@ -18270,11 +18257,18 @@ static
void
buf_flush_list_now_set(THD*, st_mysql_sys_var*, void*, const void* save)
{
- if (*(my_bool*) save) {
- mysql_mutex_unlock(&LOCK_global_system_variables);
- buf_flush_sync();
- mysql_mutex_lock(&LOCK_global_system_variables);
- }
+ if (!*(my_bool*) save)
+ return;
+ const uint s= srv_fil_make_page_dirty_debug;
+ mysql_mutex_unlock(&LOCK_global_system_variables);
+ if (s)
+ buf_flush_sync();
+ else
+ {
+ while (buf_flush_list_space(fil_system.sys_space, nullptr));
+ os_aio_wait_until_no_pending_writes(true);
+ }
+ mysql_mutex_lock(&LOCK_global_system_variables);
}
/** Override current MERGE_THRESHOLD setting for all indexes at dictionary
@@ -19368,8 +19362,10 @@ static MYSQL_SYSVAR_ULONGLONG(max_undo_log_size, srv_max_undo_log_size,
10 << 20, 10 << 20,
1ULL << (32 + UNIV_PAGE_SIZE_SHIFT_MAX), 0);
+static ulong innodb_purge_rseg_truncate_frequency;
+
static MYSQL_SYSVAR_ULONG(purge_rseg_truncate_frequency,
- srv_purge_rseg_truncate_frequency,
+ innodb_purge_rseg_truncate_frequency,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_DEPRECATED,
"Deprecated parameter with no effect",
NULL, NULL, 128, 1, 128, 0);
@@ -20606,6 +20602,10 @@ Compare_keys ha_innobase::compare_key_parts(
if (old_part.length >= new_part.length)
return Compare_keys::NotEqual;
+ if (old_part.length == old_field.key_length() &&
+ new_part.length != new_field.length)
+ return Compare_keys::NotEqual;
+
return Compare_keys::EqualButKeyPartLength;
}