diff options
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/ctype_utf16le.result | 33 | ||||
-rw-r--r-- | mysql-test/main/ctype_utf16le.test | 37 | ||||
-rw-r--r-- | mysql-test/main/ctype_utf8.result | 17 | ||||
-rw-r--r-- | mysql-test/main/ctype_utf8.test | 18 | ||||
-rw-r--r-- | mysql-test/main/func_json.result | 6 | ||||
-rw-r--r-- | mysql-test/main/func_json.test | 6 | ||||
-rw-r--r-- | mysql-test/main/information_schema.result | 20 | ||||
-rw-r--r-- | mysql-test/main/information_schema.test | 21 | ||||
-rw-r--r-- | mysql-test/main/long_unique_innodb.opt | 1 | ||||
-rw-r--r-- | mysql-test/main/long_unique_innodb.result | 3 | ||||
-rw-r--r-- | mysql-test/main/long_unique_innodb.test | 5 | ||||
-rw-r--r-- | mysql-test/main/mysql-metadata.result | 2 | ||||
-rw-r--r-- | mysql-test/main/mysql_upgrade.result | 72 | ||||
-rw-r--r-- | mysql-test/main/mysql_upgrade.test | 38 | ||||
-rw-r--r-- | mysql-test/main/sp-code.result | 30 | ||||
-rw-r--r-- | mysql-test/main/sp-code.test | 32 | ||||
-rw-r--r-- | mysql-test/main/type_json.result | 4 | ||||
-rw-r--r-- | mysql-test/main/view.result | 11 | ||||
-rw-r--r-- | mysql-test/main/view.test | 19 | ||||
-rw-r--r-- | mysql-test/main/xa.result | 15 | ||||
-rw-r--r-- | mysql-test/main/xa.test | 17 |
21 files changed, 404 insertions, 3 deletions
diff --git a/mysql-test/main/ctype_utf16le.result b/mysql-test/main/ctype_utf16le.result index c43106aa042..aff755d95ae 100644 --- a/mysql-test/main/ctype_utf16le.result +++ b/mysql-test/main/ctype_utf16le.result @@ -3000,5 +3000,38 @@ DROP TABLE t1; # SET DEFAULT_STORAGE_ENGINE=Default; # +# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +# +SET NAMES utf8; +SET SESSION character_set_connection= utf16le; +CREATE TABLE kv (v TEXT CHARACTER SET latin1); +CREATE TABLE t (a INT); +CREATE VIEW v AS SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v.frm' REPLACE INTO TABLE kv CHARACTER SET latin1; +SELECT LOWER(v) FROM kv WHERE v LIKE _binary'query=%'; +LOWER(v) +query=select `information_schema`.`tables`.`table_catalog` as `table_catalog`,`information_schema`.`tables`.`table_schema` as `table_schema`,`information_schema`.`tables`.`table_name` as `table_name`,`information_schema`.`tables`.`table_type` as `table_type`,`information_schema`.`tables`.`engine` as `engine`,`information_schema`.`tables`.`version` as `version`,`information_schema`.`tables`.`row_format` as `row_format`,`information_schema`.`tables`.`table_rows` as `table_rows`,`information_schema`.`tables`.`avg_row_length` as `avg_row_length`,`information_schema`.`tables`.`data_length` as `data_length`,`information_schema`.`tables`.`max_data_length` as `max_data_length`,`information_schema`.`tables`.`index_length` as `index_length`,`information_schema`.`tables`.`data_free` as `data_free`,`information_schema`.`tables`.`auto_increment` as `auto_increment`,`information_schema`.`tables`.`create_time` as `create_time`,`information_schema`.`tables`.`update_time` as `update_time`,`information_schema`.`tables`.`check_time` as `check_time`,`information_schema`.`tables`.`table_collation` as `table_collation`,`information_schema`.`tables`.`checksum` as `checksum`,`information_schema`.`tables`.`create_options` as `create_options`,`information_schema`.`tables`.`table_comment` as `table_comment`,`information_schema`.`tables`.`max_index_length` as `max_index_length`,`information_schema`.`tables`.`temporary` as `temporary` from `information_schema`.`tables` where `information_schema`.`tables`.`table_name` = 't1' +TRUNCATE TABLE kv; +SELECT * FROM v; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY +LOCK TABLE t WRITE; +UNLOCK TABLES; +DROP VIEW v; +DROP TABLE t; +DROP TABLE kv; +CREATE TABLE t (a INT); +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1'); +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY +LOCK TABLE t WRITE; +UNLOCK TABLES; +DROP TABLE t; +CREATE TABLE t (a INT); +SELECT TABLE_NAME, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1'); +TABLE_NAME HEX(TABLE_NAME) +SELECT TABLE_NAME, TABLE_SCHEMA, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1'); +TABLE_NAME TABLE_SCHEMA HEX(TABLE_NAME) +DROP TABLE t; +SET NAMES utf8; +# # End of 10.2 tests # diff --git a/mysql-test/main/ctype_utf16le.test b/mysql-test/main/ctype_utf16le.test index 6f8fd71ec34..e3163d2f73e 100644 --- a/mysql-test/main/ctype_utf16le.test +++ b/mysql-test/main/ctype_utf16le.test @@ -3,6 +3,7 @@ -- source include/have_utf32.inc -- source include/have_utf8mb4.inc +let $MYSQLD_DATADIR= `select @@datadir`; SET TIME_ZONE='+03:00'; @@ -811,5 +812,41 @@ let $coll_pad='utf16le_bin'; --source include/ctype_pad_all_engines.inc --echo # +--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +--echo # + + + +SET NAMES utf8; +SET SESSION character_set_connection= utf16le; + +CREATE TABLE kv (v TEXT CHARACTER SET latin1); +CREATE TABLE t (a INT); +CREATE VIEW v AS SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v.frm' REPLACE INTO TABLE kv CHARACTER SET latin1; +SELECT LOWER(v) FROM kv WHERE v LIKE _binary'query=%'; +TRUNCATE TABLE kv; +SELECT * FROM v; +LOCK TABLE t WRITE; +UNLOCK TABLES; +DROP VIEW v; +DROP TABLE t; +DROP TABLE kv; + +CREATE TABLE t (a INT); +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1'); +LOCK TABLE t WRITE; +UNLOCK TABLES; +DROP TABLE t; + +CREATE TABLE t (a INT); +SELECT TABLE_NAME, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1'); +SELECT TABLE_NAME, TABLE_SCHEMA, HEX(TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1'); +DROP TABLE t; + +SET NAMES utf8; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result index 266292edab6..967cfdf8fbc 100644 --- a/mysql-test/main/ctype_utf8.result +++ b/mysql-test/main/ctype_utf8.result @@ -11244,6 +11244,23 @@ DROP TABLE t1; # SET DEFAULT_STORAGE_ENGINE=Default; # +# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +# +SET NAMES utf8; +SET SESSION character_set_connection=latin1; +CREATE VIEW v1 AS SELECT 'ä' AS c1; +SELECT c1, HEX(c1) FROM v1; +c1 HEX(c1) +ä E4 +CREATE TABLE kv (v BLOB); +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv; +SELECT * FROM kv WHERE v LIKE _binary'query=%'; +v +query=select 'ä' AS `c1` +DROP TABLE kv; +DROP VIEW v1; +SET NAMES utf8; +# # End of 10.2 tests # # diff --git a/mysql-test/main/ctype_utf8.test b/mysql-test/main/ctype_utf8.test index 01e5a0e8c80..d01190b2049 100644 --- a/mysql-test/main/ctype_utf8.test +++ b/mysql-test/main/ctype_utf8.test @@ -2,6 +2,8 @@ # Tests with the utf8 character set # +let $MYSQLD_DATADIR= `select @@datadir`; + let collation=utf8_unicode_ci; --source include/have_collation.inc SET TIME_ZONE='+03:00'; @@ -2167,6 +2169,22 @@ let $coll_pad='utf8_bin'; --source include/ctype_pad_all_engines.inc --echo # +--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +--echo # + +SET NAMES utf8; +SET SESSION character_set_connection=latin1; +CREATE VIEW v1 AS SELECT 'ä' AS c1; +SELECT c1, HEX(c1) FROM v1; +CREATE TABLE kv (v BLOB); +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv; +SELECT * FROM kv WHERE v LIKE _binary'query=%'; +DROP TABLE kv; +DROP VIEW v1; +SET NAMES utf8; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index 4ad7efea8af..74d301abf7a 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -934,6 +934,12 @@ CAST(JSON_EXTRACT('{"x":false}', '$.x') AS DECIMAL) AS cd; cf cd 0 0 # +# MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice. +# +SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' ); +JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' ) +["x"] +# # End of 10.2 tests # # diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index d598809adf5..668675551f6 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -552,6 +552,12 @@ SELECT --echo # +--echo # MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice. +--echo # + +SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' ); + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index 82f04e0aeb1..be209d1435c 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -2242,6 +2242,26 @@ SELECT * FROM v LIMIT ROWS EXAMINED 9; ERROR HY000: Sort aborted: DROP VIEW v; # +# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +# +CREATE TABLE t (a INT); +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1'); +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1'); +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY +DROP TABLE t; +CREATE TABLE `a/~.b` (a INT); +SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='a/~.b'; +TABLE_SCHEMA TABLE_NAME +test a/~.b +DROP TABLE `a/~.b`; +CREATE DATABASE `a/~.b`; +CREATE TABLE `a/~.b`.t1 (a INT); +SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='a/~.b'; +TABLE_SCHEMA TABLE_NAME +a/~.b t1 +DROP DATABASE `a/~.b`; +# # End of 10.2 Test # # diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test index 17c029bc81f..284ecdfdf49 100644 --- a/mysql-test/main/information_schema.test +++ b/mysql-test/main/information_schema.test @@ -1949,6 +1949,27 @@ SELECT * FROM v LIMIT ROWS EXAMINED 9; DROP VIEW v; --echo # +--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +--echo # + +# Expect empty sets if requested TABLE_NAME or TABLE_SCHEMA with zero bytes +CREATE TABLE t (a INT); +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=CONCAT('t',0x00,'1'); +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=CONCAT('test',0x00,'1'); +DROP TABLE t; + +# Make sure check_table_name() does not reject special characters +CREATE TABLE `a/~.b` (a INT); +SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='a/~.b'; +DROP TABLE `a/~.b`; + +# Make sure check_db_name() does not reject special characters +CREATE DATABASE `a/~.b`; +CREATE TABLE `a/~.b`.t1 (a INT); +SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='a/~.b'; +DROP DATABASE `a/~.b`; + +--echo # --echo # End of 10.2 Test --echo # diff --git a/mysql-test/main/long_unique_innodb.opt b/mysql-test/main/long_unique_innodb.opt new file mode 100644 index 00000000000..058a129cdc2 --- /dev/null +++ b/mysql-test/main/long_unique_innodb.opt @@ -0,0 +1 @@ +--innodb-page-size=8K diff --git a/mysql-test/main/long_unique_innodb.result b/mysql-test/main/long_unique_innodb.result index 135bb0808cc..96e5fac7310 100644 --- a/mysql-test/main/long_unique_innodb.result +++ b/mysql-test/main/long_unique_innodb.result @@ -131,3 +131,6 @@ connection default; drop table t1; disconnect con1; disconnect con2; +# MDEV-20131 Assertion `!pk->has_virtual()' failed +create table t1 (a text, primary key(a(1871))) engine=innodb; +ERROR 42000: Specified key was too long; max key length is 1536 bytes diff --git a/mysql-test/main/long_unique_innodb.test b/mysql-test/main/long_unique_innodb.test index aac68cd2271..dd2d9f94de3 100644 --- a/mysql-test/main/long_unique_innodb.test +++ b/mysql-test/main/long_unique_innodb.test @@ -138,3 +138,8 @@ connection default; drop table t1; disconnect con1; disconnect con2; + +--echo # MDEV-20131 Assertion `!pk->has_virtual()' failed + +--error ER_TOO_LONG_KEY +create table t1 (a text, primary key(a(1871))) engine=innodb; diff --git a/mysql-test/main/mysql-metadata.result b/mysql-test/main/mysql-metadata.result index 51b3eb24f2b..1530465eaf8 100644 --- a/mysql-test/main/mysql-metadata.result +++ b/mysql-test/main/mysql-metadata.result @@ -79,7 +79,7 @@ Database: `` Table: `` Org_table: `` Type: LONG_BLOB (format=json) -Collation: binary (63) +Collation: latin1_swedish_ci (8) Length: 4294967295 Max_length: 0 Decimals: 0 diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result index 6bb236b6fb8..2b74c22a078 100644 --- a/mysql-test/main/mysql_upgrade.result +++ b/mysql-test/main/mysql_upgrade.result @@ -842,6 +842,78 @@ count(*) 5 drop table mysql.global_priv; rename table mysql.global_priv_bak to mysql.global_priv; +# +# Ensure that mysql_upgrade accounted for 0 password_last_changed +# and doesn't PASSWORD EXPIRE a user account because < 10.4 zeroed it. +# +# switching from mysql.global_priv to mysql.user +drop view mysql.user_bak; +drop table mysql.user; +truncate table mysql.tables_priv; +FLUSH TABLES mysql.user; +FLUSH PRIVILEGES; +CREATE USER mariadb_102; +UPDATE mysql.user SET password_last_changed=0 WHERE user='mariadb_102'; +FLUSH PRIVILEGES; +Phase 1/7: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.global_priv_bak OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.index_stats OK +mysql.innodb_index_stats OK +mysql.innodb_table_stats OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.transaction_registry OK +mysql.user OK +Upgrading from a version before MariaDB-10.1 +Phase 2/7: Installing used storage engines +Checking for tables with unknown storage engine +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +Phase 7/7: Running 'FLUSH PRIVILEGES' +OK +SHOW CREATE USER mariadb_102; +CREATE USER for mariadb_102@% +CREATE USER `mariadb_102`@`%` +connect con1,localhost,mariadb_102; +select current_user(); +current_user() +mariadb_102@% +disconnect con1; +connection default; +drop table mysql.global_priv; +rename table mysql.global_priv_bak to mysql.global_priv; # End of 10.4 tests # # Check that mysql_upgrade can be run on mysqldump diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test index c40bf8b10be..54f47ae8657 100644 --- a/mysql-test/main/mysql_upgrade.test +++ b/mysql-test/main/mysql_upgrade.test @@ -356,6 +356,44 @@ select count(*) from mysql.global_priv; drop table mysql.global_priv; rename table mysql.global_priv_bak to mysql.global_priv; +# +# MDEV-26363 Former mysql-5.7 tables have password_last_changed to 0 +# on MariaDB updates, resulting in mysql_upgrade leaving them +# with password expired. +# + +--echo # +--echo # Ensure that mysql_upgrade accounted for 0 password_last_changed +--echo # and doesn't PASSWORD EXPIRE a user account because < 10.4 zeroed it. +--echo # + +--source include/switch_to_mysql_user.inc +drop view mysql.user_bak; +drop table mysql.user; +truncate table mysql.tables_priv; +--copy_file std_data/mysql57user.frm $MYSQLD_DATADIR/mysql/user.frm +--copy_file std_data/mysql57user.MYI $MYSQLD_DATADIR/mysql/user.MYI +--copy_file std_data/mysql57user.MYD $MYSQLD_DATADIR/mysql/user.MYD +FLUSH TABLES mysql.user; +FLUSH PRIVILEGES; + +CREATE USER mariadb_102; +# manually set the value like <10.4 previously did for testing mysql_upgrade. +UPDATE mysql.user SET password_last_changed=0 WHERE user='mariadb_102'; +FLUSH PRIVILEGES; + +--exec $MYSQL_UPGRADE --force 2>&1 +# Should not have "PASSWORD EXPIRED" +SHOW CREATE USER mariadb_102; +connect con1,localhost,mariadb_102; +select current_user(); +disconnect con1; +connection default; + +drop table mysql.global_priv; +rename table mysql.global_priv_bak to mysql.global_priv; +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info + --echo # End of 10.4 tests # diff --git a/mysql-test/main/sp-code.result b/mysql-test/main/sp-code.result index f9cbdcce691..462c9f80263 100644 --- a/mysql-test/main/sp-code.result +++ b/mysql-test/main/sp-code.result @@ -972,6 +972,30 @@ DROP PROCEDURE testp_bug11763507; DROP FUNCTION testf_bug11763507; #END OF BUG#11763507 test. # +# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +# +SET NAMES utf8; +SET SESSION character_set_connection=latin1; +CREATE PROCEDURE p1() +BEGIN +DECLARE a VARCHAR(10) CHARACTER SET utf8; +SET a='ä'; +SELECT a, 'ä' AS b; +END; +$$ +SHOW PROCEDURE CODE p1; +Pos Instruction +0 set a@0 NULL +1 set a@0 'ä' +2 stmt 0 "SELECT a, 'ä' AS b" +CALL p1; +a b +ä ä +DROP PROCEDURE p1; +# +# End of 10.2 tests +# +# # MDEV-13581 ROW TYPE OF t1 and t1%ROWTYPE for routine parameters # CREATE TABLE t1 (a INT, b TEXT); @@ -1330,6 +1354,9 @@ Pos Instruction 5 hpop 1 drop function f1; # +# End of 10.3 tests +# +# # MDEV-19640 Wrong SHOW PROCEDURE output for SET GLOBAL sysvar1=expr, sysvar2=expr # CREATE OR REPLACE PROCEDURE p1() @@ -1344,3 +1371,6 @@ Pos Instruction 1 stmt 31 "SET GLOBAL max_error_count=60" 2 stmt 0 "SELECT @@GLOBAL.max_allowed_packet, @..." DROP PROCEDURE p1; +# +# End of 10.5 tests +# diff --git a/mysql-test/main/sp-code.test b/mysql-test/main/sp-code.test index 10bf1ba1322..eef3382f214 100644 --- a/mysql-test/main/sp-code.test +++ b/mysql-test/main/sp-code.test @@ -738,6 +738,30 @@ DROP FUNCTION testf_bug11763507; --echo # +--echo # MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset +--echo # + +SET NAMES utf8; +SET SESSION character_set_connection=latin1; +DELIMITER $$; +CREATE PROCEDURE p1() +BEGIN + DECLARE a VARCHAR(10) CHARACTER SET utf8; + SET a='ä'; + SELECT a, 'ä' AS b; +END; +$$ +DELIMITER ;$$ +SHOW PROCEDURE CODE p1; +CALL p1; +DROP PROCEDURE p1; + +--echo # +--echo # End of 10.2 tests +--echo # + + +--echo # --echo # MDEV-13581 ROW TYPE OF t1 and t1%ROWTYPE for routine parameters --echo # @@ -948,6 +972,10 @@ delimiter ;| show function code f1; drop function f1; +--echo # +--echo # End of 10.3 tests +--echo # + --echo # --echo # MDEV-19640 Wrong SHOW PROCEDURE output for SET GLOBAL sysvar1=expr, sysvar2=expr @@ -963,3 +991,7 @@ $$ DELIMITER ;$$ SHOW PROCEDURE CODE p1; DROP PROCEDURE p1; + +--echo # +--echo # End of 10.5 tests +--echo # diff --git a/mysql-test/main/type_json.result b/mysql-test/main/type_json.result index 2c4f7b7d42b..dfe4699b361 100644 --- a/mysql-test/main/type_json.result +++ b/mysql-test/main/type_json.result @@ -121,8 +121,8 @@ js0 js1 js2 js3 SELECT js0, JSON_COMPACT(js0), JSON_COMPACT('{}') FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t1 t1 js0 js0 252 (format=json) 4294967295 0 Y 144 0 33 -def JSON_COMPACT(js0) 251 (format=json) 4294967295 0 Y 128 0 63 -def JSON_COMPACT('{}') 253 (format=json) 6 0 Y 128 0 63 +def JSON_COMPACT(js0) 251 (format=json) 4294967295 0 Y 128 0 33 +def JSON_COMPACT('{}') 253 (format=json) 6 0 Y 0 0 33 js0 JSON_COMPACT(js0) JSON_COMPACT('{}') DROP TABLE t1; # diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index c9ef634e447..fa3afd93dfa 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6835,6 +6835,17 @@ SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ; drop view v1; drop table t1; # +# MDEV-26299: Some views force server (and mysqldump) to generate +# invalid SQL for their definitions +# +create view v1 as +select * from +(select +"12345678901234567890123456789012345678901234567890123456789012345") as t1; +drop view v1; +CREATE VIEW v1 AS select `t1`.`12345678901234567890123456789012345678901234567890123456789012345` AS `Name_exp_1` from (select '12345678901234567890123456789012345678901234567890123456789012345') `t1`; +drop view v1; +# # End of 10.2 tests # # diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index 4345abf1bd8..11476d5d49e 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -6549,6 +6549,25 @@ SELECT 1 FROM (SELECT count(((SELECT i1 FROM v1))) FROM v1) dt ; drop view v1; drop table t1; + +--echo # +--echo # MDEV-26299: Some views force server (and mysqldump) to generate +--echo # invalid SQL for their definitions +--echo # + +create view v1 as + select * from + (select + "12345678901234567890123456789012345678901234567890123456789012345") as t1; + +let $definition=`select VIEW_DEFINITION from information_schema.views where TABLE_NAME="v1"`; + +drop view v1; + +eval CREATE VIEW v1 AS $definition; + +drop view v1; + --echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/xa.result b/mysql-test/main/xa.result index 50089bb1d5e..75f32a1a0aa 100644 --- a/mysql-test/main/xa.result +++ b/mysql-test/main/xa.result @@ -453,6 +453,21 @@ Message XAER_RMFAIL: The command cannot be executed when global transaction is i xa commit 'foo'; drop table t1; # +# MDEV-22445 Crash on HANDLER READ NEXT after XA PREPARE +# +CREATE TABLE t (a INT KEY) ENGINE=InnoDB; +HANDLER t OPEN AS t; +XA START '0'; +SELECT * FROM t; +a +XA END '0'; +XA PREPARE '0'; +HANDLER t READ NEXT; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state +# Cleanup +XA COMMIT '0'; +DROP TABLE t; +# # End of 10.2 tests # XA BEGIN 'xid'; diff --git a/mysql-test/main/xa.test b/mysql-test/main/xa.test index 499cbeaa88f..408c7e01c9d 100644 --- a/mysql-test/main/xa.test +++ b/mysql-test/main/xa.test @@ -597,6 +597,23 @@ xa commit 'foo'; drop table t1; --echo # +--echo # MDEV-22445 Crash on HANDLER READ NEXT after XA PREPARE +--echo # + +CREATE TABLE t (a INT KEY) ENGINE=InnoDB; +HANDLER t OPEN AS t; +XA START '0'; +SELECT * FROM t; +XA END '0'; +XA PREPARE '0'; +--error ER_XAER_RMFAIL +HANDLER t READ NEXT; + +--echo # Cleanup +XA COMMIT '0'; +DROP TABLE t; + +--echo # --echo # End of 10.2 tests --echo # |