mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-28866: mariadb-upgrade to 10.8 mysql.column_stats hist_type + histogram errors
The incorrect type of mysql.column_stats caused the server during the upgrade of every other table to complain: [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 and expected column 'histogram' at position 10 to have type longblob. To prevent these verbose server errors, we upgrade the mysql.column_stats table first. Consequently limit "Incorrect definition of table mysql.*" to the appropriate set of limited test cases. The rpl_gtid_errorhandling.result changes the GTID number by one because of the added early suppression (adding a table row). Reviewer: Vicențiu Ciorbaru Fixes MariaDB/mariadb-docker#438
This commit is contained in:
@@ -105,7 +105,6 @@ INSERT INTO global_suppressions VALUES
|
||||
*/
|
||||
|
||||
("Got error [0-9]* when reading table"),
|
||||
("Incorrect definition of table"),
|
||||
("Incorrect information in file"),
|
||||
("InnoDB: Warning: we did not need to do crash recovery"),
|
||||
/*("Invalid \\(old\\?\\) table or database name"),*/
|
||||
|
@@ -1,5 +1,6 @@
|
||||
set sql_mode="";
|
||||
call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
|
||||
drop database if exists events_test;
|
||||
drop database if exists db_x;
|
||||
drop database if exists mysqltest_db2;
|
||||
|
@@ -8,6 +8,7 @@ set sql_mode="";
|
||||
--source include/default_charset.inc
|
||||
|
||||
call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists events_test;
|
||||
|
@@ -21,6 +21,7 @@ insert into event_like select * from mysql.event;
|
||||
alter table mysql.event
|
||||
change column body body longtext character set utf8 collate utf8_bin;
|
||||
"Now we restart the server"
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
|
||||
# restart
|
||||
use events_test;
|
||||
select @@event_scheduler;
|
||||
|
@@ -45,6 +45,7 @@ alter table mysql.event
|
||||
change column body body longtext character set utf8 collate utf8_bin;
|
||||
--echo "Now we restart the server"
|
||||
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
use events_test;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
set sql_mode="";
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.column_stats:.*");
|
||||
Run mysql_upgrade once
|
||||
Phase 1/7: Checking and upgrading mysql database
|
||||
Processing databases
|
||||
|
@@ -5,6 +5,7 @@
|
||||
|
||||
set sql_mode="";
|
||||
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.column_stats:.*");
|
||||
#
|
||||
# Basic test that we can run mysql_upgrde and that it finds the
|
||||
# expected binaries it uses.
|
||||
|
@@ -85,3 +85,7 @@ db_name table_name hist_type_equal histogram_equal
|
||||
test t1 1 1
|
||||
test t2 1 1
|
||||
drop table t1,t2,t4;
|
||||
#
|
||||
# MDEV-28866 mariadb-upgrade to 10.8 mysql.column_stats hist_type + histogram errors
|
||||
#
|
||||
FOUND 2 /Incorrect definition of table mysql.column_stats:/ in mysqld.1.err
|
||||
|
@@ -65,3 +65,13 @@ from
|
||||
A.column_name=B.column_name;
|
||||
|
||||
drop table t1,t2,t4;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28866 mariadb-upgrade to 10.8 mysql.column_stats hist_type + histogram errors
|
||||
--echo #
|
||||
# There should only be two count here corresponding the test creation of mysql.column_stats, and
|
||||
# none generated by the $MYSQL_UPGRADE run.
|
||||
--let $error_log= $MYSQLTEST_VARDIR/log/mysqld.1.err
|
||||
--let SEARCH_FILE= $error_log
|
||||
--let SEARCH_PATTERN= Incorrect definition of table mysql.column_stats:
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
@@ -3,6 +3,7 @@ include/master-slave.inc
|
||||
*** Test that we check against incorrect table definition for mysql.gtid_slave_pos ***
|
||||
connection master;
|
||||
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.gtid_slave_pos:.*");
|
||||
connection slave;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
@@ -83,16 +84,16 @@ ERROR 25000: You are not allowed to execute this command in a transaction
|
||||
ROLLBACK;
|
||||
SET GLOBAL gtid_strict_mode= 1;
|
||||
SET GLOBAL gtid_slave_pos = "0-1-1";
|
||||
ERROR HY000: Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
ERROR HY000: Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
SET GLOBAL gtid_slave_pos = "";
|
||||
ERROR HY000: Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
ERROR HY000: Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
SET GLOBAL gtid_strict_mode= 0;
|
||||
SET GLOBAL gtid_slave_pos = "0-1-1";
|
||||
Warnings:
|
||||
Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
SET GLOBAL gtid_slave_pos = "";
|
||||
Warnings:
|
||||
Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-11. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-12. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
|
||||
RESET MASTER;
|
||||
SET GLOBAL gtid_slave_pos = "0-1-1";
|
||||
START SLAVE;
|
||||
|
@@ -5,6 +5,7 @@
|
||||
--echo *** Test that we check against incorrect table definition for mysql.gtid_slave_pos ***
|
||||
--connection master
|
||||
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
call mtr.add_suppression("Incorrect definition of table mysql.gtid_slave_pos:.*");
|
||||
--sync_slave_with_master
|
||||
|
||||
--connection slave
|
||||
|
@@ -29,6 +29,18 @@ set default_storage_engine=Aria;
|
||||
set enforce_storage_engine=NULL;
|
||||
set alter_algorithm=DEFAULT;
|
||||
|
||||
|
||||
--
|
||||
-- Upgrade mysql.column_stats table early because its quite noisy otherwise
|
||||
--
|
||||
|
||||
ALTER TABLE column_stats
|
||||
modify min_value varbinary(255) DEFAULT NULL,
|
||||
modify max_value varbinary(255) DEFAULT NULL,
|
||||
modify hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'),
|
||||
modify histogram longblob,
|
||||
ENGINE=Aria transactional=0;
|
||||
|
||||
set @have_innodb= (select count(engine) from information_schema.engines where engine='INNODB' and support != 'NO');
|
||||
|
||||
# MDEV-21873: 10.2 to 10.3 upgrade doesn't remove semi-sync reference from
|
||||
@@ -66,7 +78,6 @@ ALTER TABLE help_category ENGINE=Aria transactional=0;
|
||||
ALTER TABLE help_relation ENGINE=Aria transactional=0;
|
||||
ALTER TABLE help_keyword ENGINE=Aria transactional=0;
|
||||
ALTER TABLE table_stats ENGINE=Aria transactional=0;
|
||||
ALTER TABLE column_stats ENGINE=Aria transactional=0;
|
||||
ALTER TABLE index_stats ENGINE=Aria transactional=0;
|
||||
|
||||
ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
|
||||
@@ -780,9 +791,6 @@ flush privileges;
|
||||
ALTER TABLE help_category MODIFY url TEXT NOT NULL;
|
||||
ALTER TABLE help_topic MODIFY url TEXT NOT NULL;
|
||||
|
||||
# MDEV-7383 - varbinary on mix/max of column_stats
|
||||
alter table column_stats modify min_value varbinary(255) DEFAULT NULL, modify max_value varbinary(255) DEFAULT NULL;
|
||||
|
||||
DELIMITER //
|
||||
IF 'BASE TABLE' = (select table_type from information_schema.tables where table_schema=database() and table_name='user') THEN
|
||||
CREATE TABLE IF NOT EXISTS global_priv (Host char(255) binary DEFAULT '', User char(128) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY Host (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'
|
||||
@@ -842,11 +850,3 @@ IF 1 = (SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def
|
||||
END IF//
|
||||
|
||||
DELIMITER ;
|
||||
|
||||
--
|
||||
-- Upgrade mysql.column_stats table
|
||||
--
|
||||
|
||||
ALTER TABLE column_stats
|
||||
modify hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'),
|
||||
modify histogram longblob;
|
||||
|
Reference in New Issue
Block a user