Skip to content

Commit 25ede13

Browse files
committed
Merge branch '10.4' into 10.5
2 parents 080522d + 79e32e4 commit 25ede13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+777
-141
lines changed

client/mysql_upgrade.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ static int check_version_match(void)
11821182
extract_variable_from_show(&ds_version, version_str))
11831183
{
11841184
print_error("Version check failed. Got the following error when calling "
1185-
"the 'mysql_upgrade' command line client", &ds_version);
1185+
"the 'mysql' command line client", &ds_version);
11861186
dynstr_free(&ds_version);
11871187
return 1; /* Query failed */
11881188
}

debian/additions/mariadb-report

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env perl -w
1+
#!/usr/bin/perl
22

33
# mariadb-report v4.0 Oct 23 2015
44
# renamed to from mysqlreport in 2020

mysql-test/main/mysql_upgrade.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ test
145145
Phase 7/7: Running 'FLUSH PRIVILEGES'
146146
OK
147147
DROP USER mysqltest1@'%';
148-
Version check failed. Got the following error when calling the 'mysql_upgrade' command line client
148+
Version check failed. Got the following error when calling the 'mysql' command line client
149149
ERROR 1045 (28000): Access denied for user 'mysqltest1'@'localhost' (using password: YES)
150150
FATAL ERROR: Upgrade failed
151151
Run mysql_upgrade with a non existing server socket
@@ -412,7 +412,7 @@ OK
412412
# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
413413
#
414414
Run mysql_upgrade with unauthorized access
415-
Version check failed. Got the following error when calling the 'mysql_upgrade' command line client
415+
Version check failed. Got the following error when calling the 'mysql' command line client
416416
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
417417
FATAL ERROR: Upgrade failed
418418
#

mysql-test/main/type_blob.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,5 +1125,20 @@ LENGTH(a) LENGTH(DEFAULT(a))
11251125
256 256
11261126
DROP TABLE t1;
11271127
#
1128+
# ASAN heap-use-after-free in my_hash_sort_bin or ER_KEY_NOT_FOUND
1129+
# upon INSERT into table with long unique blob
1130+
#
1131+
SET @save_sql_mode=@@sql_mode;
1132+
SET SQL_MODE='STRICT_ALL_TABLES';
1133+
CREATE TABLE t1 (a INT, b BLOB) ENGINE=innodb;
1134+
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
1135+
CREATE TABLE t2 (c BIT, d BLOB, UNIQUE(d)) ENGINE=innodb;
1136+
INSERT INTO t2 SELECT * FROM t1;
1137+
ERROR 22001: Data too long for column 'c' at row 2
1138+
select * from t2;
1139+
c d
1140+
DROP TABLE t1, t2;
1141+
SET @@sql_mode=@save_sql_mode;
1142+
#
11281143
# End of 10.4 test
11291144
#

mysql-test/main/type_blob.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This test can't be run with running server (--extern) as this uses
22
# load_file() on a file in the tree.
33
#
4+
--source include/have_innodb.inc
45

56
#
67
# Basic cleanup
@@ -735,6 +736,25 @@ INSERT INTO t1 VALUES ();
735736
SELECT LENGTH(a), LENGTH(DEFAULT(a)) FROM t1;
736737
DROP TABLE t1;
737738

739+
--echo #
740+
--echo # ASAN heap-use-after-free in my_hash_sort_bin or ER_KEY_NOT_FOUND
741+
--echo # upon INSERT into table with long unique blob
742+
--echo #
743+
744+
# Note that this test worked with myisam as it caches blobs differently than
745+
# InnoDB
746+
747+
SET @save_sql_mode=@@sql_mode;
748+
SET SQL_MODE='STRICT_ALL_TABLES';
749+
750+
CREATE TABLE t1 (a INT, b BLOB) ENGINE=innodb;
751+
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
752+
CREATE TABLE t2 (c BIT, d BLOB, UNIQUE(d)) ENGINE=innodb;
753+
--error ER_DATA_TOO_LONG
754+
INSERT INTO t2 SELECT * FROM t1;
755+
select * from t2;
756+
DROP TABLE t1, t2;
757+
SET @@sql_mode=@save_sql_mode;
738758

739759
--echo #
740760
--echo # End of 10.4 test

mysql-test/mysql-test-run.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,8 @@ sub environment_setup {
23562356
$ENV{'MARIADB_CONV'}= $exe_mariadb_conv;
23572357
if(IS_WINDOWS)
23582358
{
2359-
$ENV{'MYSQL_INSTALL_DB_EXE'}= mtr_exe_exists("$bindir/sql$opt_vs_config/mysql_install_db");
2359+
$ENV{'MYSQL_INSTALL_DB_EXE'}= mtr_exe_exists("$bindir/sql$opt_vs_config/mysql_install_db",
2360+
"$bindir/bin/mysql_install_db");
23602361
}
23612362

23622363
my $client_config_exe=

mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,11 @@ a
349349
999.99
350350
DROP TABLE t1dec102;
351351
flush logs;
352+
CREATE TABLE t1 (a GEOMETRY DEFAULT NULL);
353+
INSERT INTO t1 VALUES (NULL);
354+
INSERT INTO t1 VALUES (POINT(10,10));
355+
DROP TABLE t1;
356+
FLUSH LOGS;
352357
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
353358
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
354359
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
@@ -5358,3 +5363,92 @@ START TRANSACTION
53585363
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
53595364

53605365
Error: Found Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value.
5366+
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
5367+
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
5368+
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
5369+
DELIMITER /*!*/;
5370+
# at #
5371+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 010909 4:46:40
5372+
# at #
5373+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Gtid list [0-1-323]
5374+
# at #
5375+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
5376+
# at #
5377+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000003
5378+
# at #
5379+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-324 ddl
5380+
/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
5381+
/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
5382+
/*!100001 SET @@session.server_id=1*//*!*/;
5383+
/*!100001 SET @@session.gtid_seq_no=324*//*!*/;
5384+
# at #
5385+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
5386+
use `test`/*!*/;
5387+
SET TIMESTAMP=1000000000/*!*/;
5388+
SET @@session.pseudo_thread_id=#/*!*/;
5389+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
5390+
SET @@session.sql_mode=1411383296/*!*/;
5391+
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
5392+
/*!\C latin1 *//*!*/;
5393+
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
5394+
SET @@session.lc_time_names=0/*!*/;
5395+
SET @@session.collation_database=DEFAULT/*!*/;
5396+
CREATE TABLE t1 (a GEOMETRY DEFAULT NULL)
5397+
/*!*/;
5398+
# at #
5399+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-325
5400+
/*!100001 SET @@session.gtid_seq_no=325*//*!*/;
5401+
START TRANSACTION
5402+
/*!*/;
5403+
# at #
5404+
# at #
5405+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
5406+
#Q> INSERT INTO t1 VALUES (NULL)
5407+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
5408+
# at #
5409+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
5410+
### INSERT INTO `test`.`t1`
5411+
### SET
5412+
### @1=NULL /* GEOMETRY meta=4 nullable=1 is_null=1 */
5413+
# Number of rows: 1
5414+
# at #
5415+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
5416+
SET TIMESTAMP=1000000000/*!*/;
5417+
COMMIT
5418+
/*!*/;
5419+
# at #
5420+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-326
5421+
/*!100001 SET @@session.gtid_seq_no=326*//*!*/;
5422+
START TRANSACTION
5423+
/*!*/;
5424+
# at #
5425+
# at #
5426+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
5427+
#Q> INSERT INTO t1 VALUES (POINT(10,10))
5428+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
5429+
# at #
5430+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
5431+
### INSERT INTO `test`.`t1`
5432+
### SET
5433+
### @1='\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00$@\x00\x00\x00\x00\x00\x00$@' /* GEOMETRY meta=4 nullable=1 is_null=0 */
5434+
# Number of rows: 1
5435+
# at #
5436+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
5437+
SET TIMESTAMP=1000000000/*!*/;
5438+
COMMIT
5439+
/*!*/;
5440+
# at #
5441+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-327 ddl
5442+
/*!100001 SET @@session.gtid_seq_no=327*//*!*/;
5443+
# at #
5444+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
5445+
SET TIMESTAMP=1000000000/*!*/;
5446+
DROP TABLE `t1` /* generated by server */
5447+
/*!*/;
5448+
# at #
5449+
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000004 pos: 4
5450+
DELIMITER ;
5451+
# End of log file
5452+
ROLLBACK /* added by mysqlbinlog */;
5453+
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
5454+
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;

mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,17 @@ SELECT * FROM t1dec102 ORDER BY a;
465465
DROP TABLE t1dec102;
466466

467467
flush logs;
468+
#
469+
# MDEV-22330: mysqlbinlog stops with an error Don't know how to handle column
470+
# type: 255 meta: 4 (0004)
471+
# Check support for GEOMETRY type with verbose mode.
472+
#
473+
CREATE TABLE t1 (a GEOMETRY DEFAULT NULL);
474+
475+
INSERT INTO t1 VALUES (NULL);
476+
INSERT INTO t1 VALUES (POINT(10,10));
477+
DROP TABLE t1;
478+
FLUSH LOGS;
468479

469480
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
470481
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
@@ -475,3 +486,6 @@ flush logs;
475486
--error 1
476487
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000002 2>&1
477488

489+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
490+
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/
491+
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000003

mysql-test/suite/federated/federatedx_create_handlers.result

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,50 @@ DROP TABLE federated.t1, federated.t2, federated.t3, federated.t4;
378378
connection slave;
379379
DROP TABLE federated.t1, federated.t2;
380380
connection default;
381+
#
382+
# MDEV-23778: Derived handler used for big derived tables
383+
#
384+
connection slave;
385+
CREATE TABLE federated.t1 (
386+
a varchar(100) NOT NULL default '123'
387+
)
388+
DEFAULT CHARSET=latin1;
389+
CREATE TABLE federated.t2 LIKE federated.t1;
390+
BEGIN NOT ATOMIC
391+
DECLARE i INT DEFAULT 0;
392+
START TRANSACTION;
393+
WHILE i < 70000 DO
394+
INSERT INTO federated.t1 VALUES (i);
395+
SET i = i + 1;
396+
END WHILE;
397+
COMMIT;
398+
END
399+
$$
400+
connection master;
401+
CREATE TABLE federated.t1 (
402+
a varchar(100) NOT NULL default '123'
403+
)
404+
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
405+
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
406+
CREATE TABLE federated.t2 (
407+
a varchar(100) NOT NULL default '123'
408+
)
409+
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
410+
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t2';
411+
SELECT COUNT(DISTINCT a) FROM federated.t1;
412+
COUNT(DISTINCT a)
413+
70000
414+
INSERT INTO federated.t2
415+
SELECT * FROM (SELECT * FROM federated.t1 LIMIT 100) dt;
416+
SELECT COUNT(DISTINCT a) FROM federated.t2;
417+
COUNT(DISTINCT a)
418+
100
419+
TRUNCATE TABLE federated.t2;
420+
INSERT INTO federated.t2
421+
SELECT * FROM (SELECT * FROM federated.t1 LIMIT 70000) dt;
422+
SELECT COUNT(DISTINCT a) FROM federated.t2;
423+
COUNT(DISTINCT a)
424+
70000
381425
set global federated_pushdown=0;
382426
connection master;
383427
DROP TABLE IF EXISTS federated.t1;

mysql-test/suite/federated/federatedx_create_handlers.test

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,63 @@ DROP TABLE federated.t1, federated.t2;
208208

209209
connection default;
210210

211+
--echo #
212+
--echo # MDEV-23778: Derived handler used for big derived tables
213+
--echo #
214+
215+
connection slave;
216+
217+
CREATE TABLE federated.t1 (
218+
a varchar(100) NOT NULL default '123'
219+
)
220+
DEFAULT CHARSET=latin1;
221+
222+
CREATE TABLE federated.t2 LIKE federated.t1;
223+
224+
DELIMITER $$;
225+
BEGIN NOT ATOMIC
226+
DECLARE i INT DEFAULT 0;
227+
START TRANSACTION;
228+
WHILE i < 70000 DO
229+
INSERT INTO federated.t1 VALUES (i);
230+
SET i = i + 1;
231+
END WHILE;
232+
COMMIT;
233+
END
234+
$$
235+
236+
DELIMITER ;$$
237+
238+
connection master;
239+
240+
--replace_result $SLAVE_MYPORT SLAVE_PORT
241+
eval
242+
CREATE TABLE federated.t1 (
243+
a varchar(100) NOT NULL default '123'
244+
)
245+
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
246+
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
247+
248+
249+
--replace_result $SLAVE_MYPORT SLAVE_PORT
250+
eval
251+
CREATE TABLE federated.t2 (
252+
a varchar(100) NOT NULL default '123'
253+
)
254+
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
255+
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2';
256+
257+
SELECT COUNT(DISTINCT a) FROM federated.t1;
258+
259+
INSERT INTO federated.t2
260+
SELECT * FROM (SELECT * FROM federated.t1 LIMIT 100) dt;
261+
SELECT COUNT(DISTINCT a) FROM federated.t2;
262+
263+
TRUNCATE TABLE federated.t2;
264+
INSERT INTO federated.t2
265+
SELECT * FROM (SELECT * FROM federated.t1 LIMIT 70000) dt;
266+
SELECT COUNT(DISTINCT a) FROM federated.t2;
267+
211268
set global federated_pushdown=0;
212269

213270
source include/federated_cleanup.inc;

0 commit comments

Comments
 (0)