Skip to content

Commit

Permalink
MDEV-33701 upgrades from 11.4 to 11.5 don't work
Browse files Browse the repository at this point in the history
A user variable and a literal with different collation
produce an illegal mix of collation error.
Rewriting the script to avoid such arguments.
  • Loading branch information
abarkov committed May 24, 2024
1 parent a0cde36 commit 283b928
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion mysql-test/main/func_json.result
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ create table t2 as select json_object('foo', json_unquote(json_object('bar', c))
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`fld` varchar(39) DEFAULT NULL
`fld` varchar(110) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t2;
drop table t1;
Expand Down
21 changes: 0 additions & 21 deletions mysql-test/main/lowercase_table2.result
Original file line number Diff line number Diff line change
Expand Up @@ -357,27 +357,6 @@ drop user 'mysqltest_1'@'localhost';
drop tables a, B;
drop database db1;
#
# MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2
#
CREATE DATABASE `#mysql50#D+b1`;
ALTER DATABASE `#mysql50#D+b1` UPGRADE DATA DIRECTORY NAME;
SHOW CREATE DATABASE `D+b1`;
Database Create Database
D+b1 CREATE DATABASE `D+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
SHOW CREATE DATABASE `d+b1`;
Database Create Database
d+b1 CREATE DATABASE `d+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
DROP DATABASE `D+b1`;
CREATE DATABASE Db1;
ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
SHOW CREATE DATABASE Db1;
Database Create Database
Db1 CREATE DATABASE `Db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */
DROP DATABASE Db1;
#
# MDEV-32026 lowercase_table2.test failures in 11.3
#
CREATE DATABASE Db1;
Expand Down
6 changes: 3 additions & 3 deletions scripts/mariadb_system_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(255) binary DEFAULT '' NOT NUL


-- Create general_log if CSV is enabled.
SET @have_csv = (SELECT support FROM information_schema.engines WHERE engine = 'CSV');
SET @str = IF (@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci comment="General log"', 'SET @dummy = 0');
SET @have_csv = 'YES'=(SELECT support FROM information_schema.engines WHERE engine = 'CSV');
SET @str = IF (@have_csv, 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci comment="General log"', 'SET @dummy = 0');

PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;

-- Create slow_log if CSV is enabled.

SET @str = IF (@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, query_time TIME(6) NOT NULL, lock_time TIME(6) NOT NULL, rows_sent BIGINT UNSIGNED NOT NULL, rows_examined BIGINT UNSIGNED NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, rows_affected BIGINT UNSIGNED NOT NULL) engine=CSV CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci comment="Slow log"', 'SET @dummy = 0');
SET @str = IF (@have_csv, 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, query_time TIME(6) NOT NULL, lock_time TIME(6) NOT NULL, rows_sent BIGINT UNSIGNED NOT NULL, rows_examined BIGINT UNSIGNED NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, rows_affected BIGINT UNSIGNED NOT NULL) engine=CSV CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci comment="Slow log"', 'SET @dummy = 0');

PREPARE stmt FROM @str;
EXECUTE stmt;
Expand Down

0 comments on commit 283b928

Please sign in to comment.