Commit 5b1406ff authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.6 into 10.11

parents 3dd7b0a8 042c3fc4
call mtr.add_suppression("InnoDB: Added system generated FTS_DOC_ID and FTS_DOC_ID_INDEX while importing the tablespace");
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) not null, fulltext f_idx(f2),
f3 INT as (f1) VIRTUAL, INDEX(f3),
f4 INT as (f1) STORED, INDEX(f4),
f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, "on");
INSERT INTO t1(f1, f2) SELECT seq, "si" FROM seq_2_to_256;
ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
ALTER TABLE t1 DROP COLUMN f6;
ALTER TABLE t1 DROP INDEX f_idx;
connect con1,localhost,root,,;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1 WHERE f1 > 1;
FLUSH TABLE t1 FOR EXPORT;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
backup: t1
UNLOCK TABLES;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) not null,
f3 INT as (f1) VIRTUAL, INDEX(f3),
f4 INT as (f1) STORED, INDEX(f4),
f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(2) NOT NULL,
`f3` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
`f4` int(11) GENERATED ALWAYS AS (`f1`) STORED,
`f5` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
PRIMARY KEY (`f1`),
KEY `f3` (`f3`),
KEY `f4` (`f4`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL, FULLTEXT f_idx(f2),
f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, "on");
ALTER TABLE t1 DROP INDEX f_idx;
FLUSH TABLE t1 FOR EXPORT;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
backup: t1
UNLOCK TABLES;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL,
f3 CHAR(2) NOT NULL,
f4 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Number of indexes don't match, table has 2 indexes but the tablespace meta-data file has 3 indexes)
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL,
f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
SET DEBUG_DBUG="+d,ib_import_set_index_root_failure";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Too many active concurrent transactions
SET DEBUG_DBUG="-d,ib_import_set_index_root_failure";
SET DEBUG_DBUG="+d,ib_import_vcol_update_fail";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR 23000: Can't write; duplicate key in table 't1'
SET DEBUG_DBUG="-d,ib_import_vcol_update_fail";
restore: t1 .ibd and .cfg files
SET DEBUG_DBUG="+d,ib_import_fts_error";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR 23000: Can't write; duplicate key in table 't1'
SET DEBUG_DBUG="-d,ib_import_fts_error";
unlink: t1.ibd
unlink: t1.cfg
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
WHERE table_id IN (SELECT table_id FROM information_schema.innodb_sys_tables where name="test/t1");
NAME
f1
f2
f3
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(2) NOT NULL,
`f3` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
PRIMARY KEY (`f1`),
KEY `f3` (`f3`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
FTS_DOC_ID BIGINT SIGNED NOT NULL,
f2 CHAR(2) NOT NULL,
FULLTEXT f_idx(f2))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 1, "on");
ALTER TABLE t1 DROP INDEX f_idx;
FLUSH TABLE t1 FOR EXPORT;
backup: t1
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL)ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Column f2 ordinal value mismatch, it's at 1 in the table and 2 in the tablespace meta-data file)
DROP TABLE t1;
...@@ -27,6 +27,7 @@ delete from t1; ...@@ -27,6 +27,7 @@ delete from t1;
connection con2; connection con2;
delete from t2; delete from t2;
connection con1; connection con1;
SET GLOBAL innodb_max_undo_log_size = @@GLOBAL.innodb_page_size * 4294967296;
SET GLOBAL innodb_undo_log_truncate = 1; SET GLOBAL innodb_undo_log_truncate = 1;
commit; commit;
disconnect con1; disconnect con1;
...@@ -35,6 +36,8 @@ commit; ...@@ -35,6 +36,8 @@ commit;
disconnect con2; disconnect con2;
connection default; connection default;
SET GLOBAL innodb_max_purge_lag_wait=0; SET GLOBAL innodb_max_purge_lag_wait=0;
SET GLOBAL innodb_max_undo_log_size=DEFAULT;
SET GLOBAL innodb_max_purge_lag_wait=0;
set global innodb_fast_shutdown=0; set global innodb_fast_shutdown=0;
# restart # restart
drop table t1, t2; drop table t1, t2;
--source include/have_innodb.inc
--source include/have_sequence.inc
# Table with virtual, fulltext, instant add, instant drop column
# and purgeable rows
call mtr.add_suppression("InnoDB: Added system generated FTS_DOC_ID and FTS_DOC_ID_INDEX while importing the tablespace");
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) not null, fulltext f_idx(f2),
f3 INT as (f1) VIRTUAL, INDEX(f3),
f4 INT as (f1) STORED, INDEX(f4),
f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, "on");
INSERT INTO t1(f1, f2) SELECT seq, "si" FROM seq_2_to_256;
ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
ALTER TABLE t1 DROP COLUMN f6;
ALTER TABLE t1 DROP INDEX f_idx;
connect(con1,localhost,root,,);
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1 WHERE f1 > 1;
FLUSH TABLE t1 FOR EXPORT;
let MYSQLD_DATADIR =`SELECT @@datadir`;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) not null,
f3 INT as (f1) VIRTUAL, INDEX(f3),
f4 INT as (f1) STORED, INDEX(f4),
f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
--disable_warnings
ALTER TABLE t1 IMPORT TABLESPACE;
--enable_warnings
SHOW CREATE TABLE t1;
DROP TABLE t1;
--source include/have_innodb.inc
--source include/have_debug.inc
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL, FULLTEXT f_idx(f2),
f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, "on");
ALTER TABLE t1 DROP INDEX f_idx;
FLUSH TABLE t1 FOR EXPORT;
let MYSQLD_DATADIR =`SELECT @@datadir`;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL,
f3 CHAR(2) NOT NULL,
f4 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
--error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t1 IMPORT TABLESPACE;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL,
f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
--disable_warnings
SET DEBUG_DBUG="+d,ib_import_set_index_root_failure";
--error ER_TOO_MANY_CONCURRENT_TRXS
ALTER TABLE t1 IMPORT TABLESPACE;
SET DEBUG_DBUG="-d,ib_import_set_index_root_failure";
SET DEBUG_DBUG="+d,ib_import_vcol_update_fail";
--error ER_DUP_KEY
ALTER TABLE t1 IMPORT TABLESPACE;
SET DEBUG_DBUG="-d,ib_import_vcol_update_fail";
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET DEBUG_DBUG="+d,ib_import_fts_error";
--error ER_DUP_KEY
ALTER TABLE t1 IMPORT TABLESPACE;
SET DEBUG_DBUG="-d,ib_import_fts_error";
--enable_warnings
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_unlink_tablespace("test", "t1");
EOF
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
WHERE table_id IN (SELECT table_id FROM information_schema.innodb_sys_tables where name="test/t1");
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Manually add the FTS_DOC_ID Column with mismatched data type
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
FTS_DOC_ID BIGINT SIGNED NOT NULL,
f2 CHAR(2) NOT NULL,
FULLTEXT f_idx(f2))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 1, "on");
ALTER TABLE t1 DROP INDEX f_idx;
FLUSH TABLE t1 FOR EXPORT;
let MYSQLD_DATADIR =`SELECT @@datadir`;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL)ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_discard_tablespaces("test", "t1");
ib_restore_tablespaces("test", "t1");
EOF
--error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t1 IMPORT TABLESPACE;
DROP TABLE t1;
...@@ -46,6 +46,7 @@ connection con1; reap; send delete from t1; ...@@ -46,6 +46,7 @@ connection con1; reap; send delete from t1;
connection con2; reap; delete from t2; connection con2; reap; delete from t2;
connection con1; reap; connection con1; reap;
SET GLOBAL innodb_max_undo_log_size = @@GLOBAL.innodb_page_size * 4294967296;
SET GLOBAL innodb_undo_log_truncate = 1; SET GLOBAL innodb_undo_log_truncate = 1;
commit; disconnect con1; commit; disconnect con1;
connection con2; commit; disconnect con2; connection con2; commit; disconnect con2;
...@@ -56,6 +57,8 @@ connection default; ...@@ -56,6 +57,8 @@ connection default;
let $trx_before= `SHOW ENGINE INNODB STATUS`; let $trx_before= `SHOW ENGINE INNODB STATUS`;
let $trx_before= `select substr('$trx_before',9)+2`; let $trx_before= `select substr('$trx_before',9)+2`;
SET GLOBAL innodb_max_purge_lag_wait=0;
SET GLOBAL innodb_max_undo_log_size=DEFAULT;
SET GLOBAL innodb_max_purge_lag_wait=0; SET GLOBAL innodb_max_purge_lag_wait=0;
set global innodb_fast_shutdown=0; set global innodb_fast_shutdown=0;
let $restart_parameters=; let $restart_parameters=;
......
...@@ -220,6 +220,25 @@ static const char *get_svc_name(const char *arg) ...@@ -220,6 +220,25 @@ static const char *get_svc_name(const char *arg)
return arg ? arg : "MySQL"; return arg ? arg : "MySQL";
} }
/*
Disable CPU throttling for the process.
Windows 11 heuristics misdetects server as a background process and runs it
on "efficiency" cores, in hybrid architectures such as Alder Lake (12th
generation Intel Core).This results in serious performance degradation.
*/
void disable_cpu_throttling()
{
#ifdef PROCESS_POWER_THROTTLING_EXECUTION_SPEED
PROCESS_POWER_THROTTLING_STATE power_throttling{};
power_throttling.Version= PROCESS_POWER_THROTTLING_CURRENT_VERSION;
power_throttling.ControlMask= PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
power_throttling.StateMask= 0;
SetProcessInformation(GetCurrentProcess(), ProcessPowerThrottling,
&power_throttling, sizeof(power_throttling));
#endif
}
/* /*
Main function on Windows. Main function on Windows.
Runs mysqld as normal process, or as a service. Runs mysqld as normal process, or as a service.
...@@ -231,6 +250,7 @@ __declspec(dllexport) int mysqld_win_main(int argc, char **argv) ...@@ -231,6 +250,7 @@ __declspec(dllexport) int mysqld_win_main(int argc, char **argv)
save_argv= argv; save_argv= argv;
save_argc= argc; save_argc= argc;
disable_cpu_throttling();
/* /*
If no special arguments are given, service name is nor present If no special arguments are given, service name is nor present
run as normal program. run as normal program.
......
This diff is collapsed.
...@@ -646,7 +646,9 @@ bool srw_lock_debug::have_rd() const noexcept ...@@ -646,7 +646,9 @@ bool srw_lock_debug::have_rd() const noexcept
readers_lock.wr_lock(); readers_lock.wr_lock();
bool found= r->find(pthread_self()) != r->end(); bool found= r->find(pthread_self()) != r->end();
readers_lock.wr_unlock(); readers_lock.wr_unlock();
# ifndef SUX_LOCK_GENERIC
ut_ad(!found || is_locked()); ut_ad(!found || is_locked());
# endif
return found; return found;
} }
return false; return false;
...@@ -656,7 +658,9 @@ bool srw_lock_debug::have_wr() const noexcept ...@@ -656,7 +658,9 @@ bool srw_lock_debug::have_wr() const noexcept
{ {
if (writer != pthread_self()) if (writer != pthread_self())
return false; return false;
# ifndef SUX_LOCK_GENERIC
ut_ad(is_write_locked()); ut_ad(is_write_locked());
# endif
return true; return true;
} }
......
...@@ -670,7 +670,9 @@ fil_space_t *purge_sys_t::truncating_tablespace() ...@@ -670,7 +670,9 @@ fil_space_t *purge_sys_t::truncating_tablespace()
if (space || srv_undo_tablespaces_active < 2 || !srv_undo_log_truncate) if (space || srv_undo_tablespaces_active < 2 || !srv_undo_log_truncate)
return space; return space;
const uint32_t size= uint32_t(srv_max_undo_log_size >> srv_page_size_shift); const uint32_t size=
uint32_t(std::min(ulonglong{std::numeric_limits<uint32_t>::max()},
srv_max_undo_log_size >> srv_page_size_shift));
for (uint32_t i= truncate_undo_space.last, j= i;; ) for (uint32_t i= truncate_undo_space.last, j= i;; )
{ {
if (fil_space_t *s= undo_truncate_try(srv_undo_space_id_start + i, size)) if (fil_space_t *s= undo_truncate_try(srv_undo_space_id_start + i, size))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment