Skip to content

Commit

Permalink
Merge 10.4 into 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Feb 17, 2022
2 parents 5948d76 + 6f4740f commit cac995e
Show file tree
Hide file tree
Showing 42 changed files with 676 additions and 775 deletions.
23 changes: 23 additions & 0 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static struct property prop_list[] = {
{ &display_session_track_info, 0, 1, 1, "$ENABLED_STATE_CHANGE_INFO" },
{ &display_metadata, 0, 0, 0, "$ENABLED_METADATA" },
{ &ps_protocol_enabled, 0, 0, 0, "$ENABLED_PS_PROTOCOL" },
{ &view_protocol_enabled, 0, 0, 0, "$ENABLED_VIEW_PROTOCOL"},
{ &disable_query_log, 0, 0, 1, "$ENABLED_QUERY_LOG" },
{ &disable_result_log, 0, 0, 1, "$ENABLED_RESULT_LOG" },
{ &disable_warnings, 0, 0, 1, "$ENABLED_WARNINGS" }
Expand All @@ -171,6 +172,7 @@ enum enum_prop {
P_SESSION_TRACK,
P_META,
P_PS,
P_VIEW,
P_QUERY,
P_RESULT,
P_WARN,
Expand Down Expand Up @@ -376,6 +378,7 @@ enum enum_commands {
Q_LOWERCASE,
Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
Q_DISABLE_VIEW_PROTOCOL, Q_ENABLE_VIEW_PROTOCOL,
Q_ENABLE_NON_BLOCKING_API, Q_DISABLE_NON_BLOCKING_API,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
Q_IF,
Expand Down Expand Up @@ -463,6 +466,8 @@ const char *command_names[]=
"character_set",
"disable_ps_protocol",
"enable_ps_protocol",
"disable_view_protocol",
"enable_view_protocol",
"enable_non_blocking_api",
"disable_non_blocking_api",
"disable_reconnect",
Expand Down Expand Up @@ -1388,6 +1393,16 @@ void close_connections()
DBUG_VOID_RETURN;
}

void close_util_connections()
{
DBUG_ENTER("close_util_connections");
if (cur_con->util_mysql)
{
mysql_close(cur_con->util_mysql);
cur_con->util_mysql = 0;
}
DBUG_VOID_RETURN;
}

void close_statements()
{
Expand Down Expand Up @@ -9674,6 +9689,14 @@ int main(int argc, char **argv)
case Q_ENABLE_PS_PROTOCOL:
set_property(command, P_PS, ps_protocol);
break;
case Q_DISABLE_VIEW_PROTOCOL:
set_property(command, P_VIEW, 0);
/* Close only util connections */
close_util_connections();
break;
case Q_ENABLE_VIEW_PROTOCOL:
set_property(command, P_VIEW, view_protocol);
break;
case Q_DISABLE_NON_BLOCKING_API:
non_blocking_api_enabled= 0;
break;
Expand Down
2 changes: 1 addition & 1 deletion man/mysqladmin.1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.\" administration: server
.\" server administration
.SH "NAME"
mysqladmin \- client for administering a MariaB server
mysqladmin \- client for administering a MariaDB server
.SH "SYNOPSIS"
.HP \w'\fBmysqladmin\ [\fR\fB\fIoptions\fR\fR\fB]\ \fR\fB\fIcommand\fR\fR\fB\ [\fR\fB\fIcommand\-arg\fR\fR\fB]\ [\fR\fB\fIcommand\fR\fR\fB\ [\fR\fB\fIcommand\-arg\fR\fR\fB]]\ \&.\&.\&.\fR\ 'u
\fBmysqladmin [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB] [\fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand\-arg\fR\fR\fB]] \&.\&.\&.\fR
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/include/have_view_protocol.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The file with expected results fits only to a run with
# view-protocol.
if (`SELECT $VIEW_PROTOCOL = 0`)
{
--skip Test requires view-protocol
}
19 changes: 19 additions & 0 deletions mysql-test/main/check_view_protocol.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
flush status;
create table t1 (a int);
insert into t1 (a) values (1);
create table t2 (b int);
insert into t2 (b) values (2);
select * from t1;
a
1
show status like 'Opened_views';
Variable_name Value
Opened_views 1
flush status;
select * from t2;
b
2
show status like 'Opened_views';
Variable_name Value
Opened_views 0
drop table t1, t2;
21 changes: 21 additions & 0 deletions mysql-test/main/check_view_protocol.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- source include/have_view_protocol.inc

flush status;

create table t1 (a int);
insert into t1 (a) values (1);
create table t2 (b int);
insert into t2 (b) values (2);
select * from t1;
show status like 'Opened_views';

flush status;
--disable_view_protocol
select * from t2;
--enable_view_protocol

show status like 'Opened_views';

drop table t1, t2;


1 change: 1 addition & 0 deletions mysql-test/main/session_tracker_last_gtid.result
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ drop table t1;
-- last_gtid
-- 0-1-1002

reset master;
1 change: 1 addition & 0 deletions mysql-test/main/session_tracker_last_gtid.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ select @@last_gtid;
drop table t1;

--disable_session_track_info
reset master;
23 changes: 21 additions & 2 deletions mysql-test/suite/innodb/r/foreign_key.result
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,9 @@ START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE IGNORE FROM t1 WHERE b = 1;
Warnings:
Warning 152 InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 20. Please drop extra constraints and try again
Warning 152 InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 15. Please drop extra constraints and try again
Warning 1296 Got error 193 '`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`b`) ON DELETE CASCADE' from InnoDB
Warning 152 InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 20. Please drop extra constraints and try again
Warning 152 InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 15. Please drop extra constraints and try again
Warning 1296 Got error 193 '`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`b`) ON DELETE CASCADE' from InnoDB
SELECT a FROM t1 FORCE INDEX(a);
a
Expand Down Expand Up @@ -808,6 +808,25 @@ ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint
Parsing foreign keys 3...
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
Parsing foreign keys 4...
#
# MDEV-27583 InnoDB uses different constants for FK cascade
# error message in SQL vs error log
#
CREATE TABLE t1
(a INT, b INT, KEY(b),
CONSTRAINT FOREIGN KEY (a) REFERENCES t1 (b) ON DELETE CASCADE)
ENGINE=InnoDB;
INSERT INTO t1 (a,b) VALUES
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,1),(1,0);
DELETE FROM t1 WHERE b = 1;
ERROR HY000: Got error 193 '`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`b`) ON DELETE CASCADE' from InnoDB
SHOW WARNINGS;
Level Code Message
Warning 152 InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 15. Please drop extra constraints and try again
Error 1296 Got error 193 '`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`b`) ON DELETE CASCADE' from InnoDB
DROP TABLE t1;
FOUND 1 /InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 15.*/ in mysqld.1.err
# End of 10.2 tests
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
Expand Down
14 changes: 10 additions & 4 deletions mysql-test/suite/innodb/r/innodb-16k.result
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ WHERE LOWER(variable_name) = 'innodb_page_size';
variable_value
16384
# Test 4) The maximum row size is dependent upon the page size.
# Redundant: 8123, Compact: 8126.
# Compressed: 8126, Dynamic: 8126.
# Redundant: 8123, Compact: 8126, Dynamic: 8126.
# Each row format has its own amount of overhead that
# varies depending on number of fields and other overhead.
SET SESSION innodb_strict_mode = ON;
SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET @save_level=@@GLOBAL.innodb_compression_level;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
SET GLOBAL innodb_compression_level=1;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
Expand All @@ -18,7 +21,7 @@ c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200),
c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200),
c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200),
c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200),
c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(157)
c36 char(200), c37 char(200), c38 char(196)
) ROW_FORMAT=compressed;
DROP TABLE t1;
CREATE TABLE t1 (
Expand Down Expand Up @@ -495,10 +498,13 @@ drop table t1;
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
CREATE TABLE t1(c text, PRIMARY KEY (c(292)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
InnoDB 0 transactions not purged
SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_frequency;
SET GLOBAL innodb_compression_level=@save_level;
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
DROP TABLE tlong;
DROP TABLE tlong2;
34 changes: 16 additions & 18 deletions mysql-test/suite/innodb/r/instant_alter,32k.rdiff
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
--- instant_alter.result
+++ instant_alter,32k.result
@@ -2,7 +2,7 @@
# MDEV-11369: Instant ADD COLUMN for InnoDB
#
@@ -5,7 +5,7 @@
SET GLOBAL innodb_instant_alter_column_allowed = DEFAULT;
call mtr.add_suppression("Cannot add field `.*` in table `test`.`.*` because after adding it, the row size is");
CREATE TABLE t(a INT UNIQUE)ENGINE=InnoDB ROW_FORMAT=COMPACT;
-ALTER TABLE t ADD e INT, ROW_FORMAT=COMPRESSED;
+ALTER TABLE t ADD e INT, ROW_FORMAT=DYNAMIC;
INSERT INTO t SET a=1;
SET @old_instant=
(SELECT variable_value FROM information_schema.global_status
@@ -33,17 +33,17 @@
@@ -36,17 +36,17 @@
`c` int(11) NOT NULL,
`d` int(11) NOT NULL,
UNIQUE KEY `a` (`a`)
Expand All @@ -30,7 +28,7 @@
DROP TABLE t;
connect analyze, localhost, root;
connection default;
@@ -374,7 +374,7 @@
@@ -404,7 +404,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
Expand All @@ -39,7 +37,7 @@
connection default;
ALTER TABLE big ADD COLUMN
(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
@@ -397,7 +397,7 @@
@@ -428,7 +428,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
Expand All @@ -48,16 +46,16 @@
connection default;
ROLLBACK;
CHECKSUM TABLE big;
@@ -410,7 +410,7 @@
@@ -442,7 +442,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
-3
+1
connection default;
InnoDB 0 transactions not purged
DROP TABLE t1,t2,t3,big;
@@ -734,7 +734,7 @@
DROP TABLE t1,t2,t3,t4,big;
@@ -1326,7 +1326,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
Expand All @@ -66,7 +64,7 @@
connection default;
ALTER TABLE big ADD COLUMN
(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
@@ -757,7 +757,7 @@
@@ -1350,7 +1350,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
Expand All @@ -75,16 +73,16 @@
connection default;
ROLLBACK;
CHECKSUM TABLE big;
@@ -770,7 +770,7 @@
@@ -1364,7 +1364,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
-3
+1
connection default;
InnoDB 0 transactions not purged
DROP TABLE t1,t2,t3,big;
@@ -1094,7 +1094,7 @@
DROP TABLE t1,t2,t3,t4,big;
@@ -2248,7 +2248,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
Expand All @@ -93,7 +91,7 @@
connection default;
ALTER TABLE big ADD COLUMN
(d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde',
@@ -1117,7 +1117,7 @@
@@ -2272,7 +2272,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
Expand All @@ -102,12 +100,12 @@
connection default;
ROLLBACK;
CHECKSUM TABLE big;
@@ -1130,7 +1130,7 @@
@@ -2286,7 +2286,7 @@
SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/big';
clust_index_size
-3
+1
connection default;
InnoDB 0 transactions not purged
DROP TABLE t1,t2,t3,big;
DROP TABLE t1,t2,t3,t4,big;
Loading

0 comments on commit cac995e

Please sign in to comment.