-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1943 from VarunNagaraju/PXC-4474
PXC 4474 Merge PS 5.7.44-51 Q3 2024
- Loading branch information
Showing
30 changed files
with
8,607 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
MYSQL_VERSION_MAJOR=5 | ||
MYSQL_VERSION_MINOR=7 | ||
MYSQL_VERSION_PATCH=44 | ||
MYSQL_VERSION_EXTRA=-50 | ||
MYSQL_VERSION_EXTRA=-51 | ||
PXC_VERSION_EXTRA=65 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
mysql-test/suite/connection_control/r/performance_schema.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Setup | ||
INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB'; | ||
INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB'; | ||
SET @@global.connection_control_failed_connections_threshold = 1; | ||
SET @@global.connection_control_min_connection_delay = 1230; | ||
SET @@global.connection_control_max_connection_delay = 1230; | ||
# Not delayed connection | ||
connect(localhost,u,,test,SOURCE_PORT,SOURCE_SOCKET); | ||
ERROR 28000: Access denied for user 'u'@'localhost' (using password: NO) | ||
# Delayed connection | ||
connect(localhost,u,,test,SOURCE_PORT,SOURCE_SOCKET); | ||
ERROR 28000: Access denied for user 'u'@'localhost' (using password: NO) | ||
# The stage event should be in the history, the timer wait must be slightly bigger | ||
# than configured connection delay, assume not more than 1/10 sec is good approximation, | ||
# so the below must be 0 | ||
SELECT FLOOR((TIMER_WAIT/100000000000 - @@connection_control_min_connection_delay/100)) from performance_schema.events_stages_history_long WHERE EVENT_NAME LIKE 'stage/conn_delay/Waiting in connection_control plugin'; | ||
FLOOR((TIMER_WAIT/100000000000 - @@connection_control_min_connection_delay/100)) | ||
0 | ||
# Cleanup | ||
# Uninstall connection_control plugin | ||
UNINSTALL PLUGIN connection_control; | ||
UNINSTALL PLUGIN connection_control_failed_login_attempts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
mysql-test/suite/connection_control/t/performance_schema-master.opt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$CONNECTION_CONTROL_PLUGIN_OPT | ||
|
||
--performance-schema-instrument='stage/conn_delay/%=ON' | ||
--performance-schema-consumer-events-stages-current=ON | ||
--performance-schema-consumer-events-stages-history=ON | ||
--performance-schema-consumer-events-stages-history-long=ON | ||
--loose-debug='+d,delay_after_connection_delay' |
40 changes: 40 additions & 0 deletions
40
mysql-test/suite/connection_control/t/performance_schema.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This test checks if when connection delay occurs the stage event | ||
# 'stage/conn_delay/Waiting in connection_control plugin' | ||
# lasts around @@global.connection_control_min_connection_delay, | ||
# so the user may get proper monitoring data. | ||
|
||
# The test will work only in debug mode | ||
--source include/have_debug.inc | ||
|
||
# Make sure that connection_control plugin can be loaded | ||
--source ../inc/have_connection_control_plugin.inc | ||
|
||
--echo # Setup | ||
--source ../inc/install_connection_control_plugin.inc | ||
|
||
# set connection_control variables | ||
SET @@global.connection_control_failed_connections_threshold = 1; | ||
SET @@global.connection_control_min_connection_delay = 1230; | ||
SET @@global.connection_control_max_connection_delay = 1230; | ||
|
||
# We don't need to use client side authentication plugin for this test. | ||
let $USE_AUTH_PLUGIN= 0; | ||
|
||
--echo # Not delayed connection | ||
--replace_result $MASTER_MYSOCK SOURCE_SOCKET $MASTER_MYPORT SOURCE_PORT | ||
--error ER_ACCESS_DENIED_ERROR | ||
connect(fail_con, localhost, u,,,,,); | ||
|
||
--echo # Delayed connection | ||
--replace_result $MASTER_MYSOCK SOURCE_SOCKET $MASTER_MYPORT SOURCE_PORT | ||
--error ER_ACCESS_DENIED_ERROR | ||
connect(fail_con, localhost, u,,,,,); | ||
|
||
--echo # The stage event should be in the history, the timer wait must be slightly bigger | ||
--echo # than configured connection delay, assume not more than 1/10 sec is good approximation, | ||
--echo # so the below must be 0 | ||
SELECT FLOOR((TIMER_WAIT/100000000000 - @@connection_control_min_connection_delay/100)) from performance_schema.events_stages_history_long WHERE EVENT_NAME LIKE 'stage/conn_delay/Waiting in connection_control plugin'; | ||
|
||
--echo # Cleanup | ||
--echo # Uninstall connection_control plugin | ||
--source ../inc/uninstall_connection_control_plugin.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CREATE TABLE `tab` ( | ||
`id` INT AUTO_INCREMENT NOT NULL, | ||
`shape` GEOMETRY NOT NULL /*!80003 SRID 0 */, | ||
PRIMARY KEY (`id`), | ||
SPATIAL KEY (`shape`) | ||
) ENGINE=InnoDB; | ||
INSERT INTO tab VALUES (2, POINT(1,100)); | ||
SELECT id FROM tab FORCE INDEX (primary) WHERE id > 0; | ||
id | ||
2 | ||
SELECT id FROM tab FORCE INDEX (shape) WHERE id > 0; | ||
id | ||
2 | ||
DROP TABLE tab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE `tab` ( | ||
`id` INT AUTO_INCREMENT NOT NULL, | ||
`shape` GEOMETRY NOT NULL /*!80003 SRID 0 */, | ||
PRIMARY KEY (`id`), | ||
SPATIAL KEY (`shape`) | ||
) ENGINE=InnoDB; | ||
INSERT INTO tab VALUES (2, POINT(1,100)); | ||
EXPLAIN SELECT id FROM tab FORCE INDEX (shape); | ||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra | ||
1 SIMPLE tab NULL ALL NULL NULL NULL NULL 1 100.00 NULL | ||
Warnings: | ||
Note 1003 /* select#1 */ select `test`.`tab`.`id` AS `id` from `test`.`tab` FORCE INDEX (`shape`) | ||
DROP TABLE tab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
################################################################# | ||
# TEST IF USING SPATIAL INDEX ON COLUMN RETURNS CORRECT RESULTS # | ||
################################################################# | ||
|
||
CREATE TABLE `tab` ( | ||
`id` INT AUTO_INCREMENT NOT NULL, | ||
`shape` GEOMETRY NOT NULL /*!80003 SRID 0 */, | ||
PRIMARY KEY (`id`), | ||
SPATIAL KEY (`shape`) | ||
) ENGINE=InnoDB; | ||
|
||
INSERT INTO tab VALUES (2, POINT(1,100)); | ||
|
||
SELECT id FROM tab FORCE INDEX (primary) WHERE id > 0; | ||
|
||
SELECT id FROM tab FORCE INDEX (shape) WHERE id > 0; | ||
|
||
DROP TABLE tab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
############################################################################### | ||
# TEST IF MYSQL CRASHES WHEN EXPLAINING WITH A FORCE INDEX ON A SPATIAL INDEX # | ||
############################################################################### | ||
|
||
CREATE TABLE `tab` ( | ||
`id` INT AUTO_INCREMENT NOT NULL, | ||
`shape` GEOMETRY NOT NULL /*!80003 SRID 0 */, | ||
PRIMARY KEY (`id`), | ||
SPATIAL KEY (`shape`) | ||
) ENGINE=InnoDB; | ||
|
||
INSERT INTO tab VALUES (2, POINT(1,100)); | ||
|
||
EXPLAIN SELECT id FROM tab FORCE INDEX (shape); | ||
|
||
DROP TABLE tab; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
SET GLOBAL innodb_optimize_fulltext_only=ON; | ||
CREATE TABLE book ( | ||
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, | ||
heading VARCHAR(20), | ||
content TEXT, | ||
FULLTEXT idx (content) | ||
) ENGINE= InnoDB DEFAULT CHARSET=utf8mb4; | ||
CREATE PROCEDURE find (word CHAR(20)) | ||
SELECT heading FROM book WHERE MATCH(content) | ||
AGAINST (word IN NATURAL LANGUAGE MODE) | ||
ORDER BY id; | ||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/lob/frankenstein.txt' INTO TABLE book CHARACTER SET utf8mb4 | ||
FIELDS TERMINATED BY '#' LINES TERMINATED BY '@' (heading, content); | ||
CALL find('they'); | ||
heading | ||
?Letter 1 | ||
Letter 2 | ||
Letter 4 | ||
Chapter 1 | ||
Chapter 2 | ||
Chapter 3 | ||
Chapter 5 | ||
Chapter 6 | ||
Chapter 7 | ||
Chapter 8 | ||
Chapter 9 | ||
Chapter 10 | ||
Chapter 11 | ||
Chapter 12 | ||
Chapter 13 | ||
Chapter 14 | ||
Chapter 15 | ||
Chapter 16 | ||
Chapter 17 | ||
Chapter 18 | ||
Chapter 19 | ||
Chapter 20 | ||
Chapter 21 | ||
Chapter 22 | ||
Chapter 23 | ||
Chapter 24 | ||
CALL find('wretched'); | ||
heading | ||
Letter 4 | ||
Chapter 5 | ||
Chapter 7 | ||
Chapter 8 | ||
Chapter 9 | ||
Chapter 10 | ||
Chapter 11 | ||
Chapter 12 | ||
Chapter 15 | ||
Chapter 20 | ||
Chapter 21 | ||
Chapter 24 | ||
CALL find('mariner'); | ||
heading | ||
Letter 2 | ||
Chapter 5 | ||
SET GLOBAL innodb_ft_aux_table="test/book"; | ||
OPTIMIZE TABLE book; | ||
Table Op Msg_type Msg_text | ||
test.book optimize status OK | ||
CALL find('they'); | ||
heading | ||
?Letter 1 | ||
Letter 2 | ||
Letter 4 | ||
Chapter 1 | ||
Chapter 2 | ||
Chapter 3 | ||
Chapter 5 | ||
Chapter 6 | ||
Chapter 7 | ||
Chapter 8 | ||
Chapter 9 | ||
Chapter 10 | ||
Chapter 11 | ||
Chapter 12 | ||
Chapter 13 | ||
Chapter 14 | ||
Chapter 15 | ||
Chapter 16 | ||
Chapter 17 | ||
Chapter 18 | ||
Chapter 19 | ||
Chapter 20 | ||
Chapter 21 | ||
Chapter 22 | ||
Chapter 23 | ||
Chapter 24 | ||
CALL find('wretched'); | ||
heading | ||
Letter 4 | ||
Chapter 5 | ||
Chapter 7 | ||
Chapter 8 | ||
Chapter 9 | ||
Chapter 10 | ||
Chapter 11 | ||
Chapter 12 | ||
Chapter 15 | ||
Chapter 20 | ||
Chapter 21 | ||
Chapter 24 | ||
CALL find('mariner'); | ||
heading | ||
Letter 2 | ||
Chapter 5 | ||
SET GLOBAL innodb_ft_aux_table="test/book"; | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; | ||
count(*) | ||
47753 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; | ||
count(*) | ||
0 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; | ||
count(*) | ||
0 | ||
DELETE FROM book; | ||
CALL find('they'); | ||
heading | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; | ||
count(*) | ||
28 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; | ||
count(*) | ||
47753 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; | ||
count(*) | ||
0 | ||
OPTIMIZE TABLE book; | ||
Table Op Msg_type Msg_text | ||
test.book optimize status OK | ||
CALL find('they'); | ||
heading | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; | ||
count(*) | ||
28 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; | ||
count(*) | ||
33742 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; | ||
count(*) | ||
0 | ||
SET GLOBAL innodb_ft_num_word_optimize=10000; | ||
OPTIMIZE TABLE book; | ||
Table Op Msg_type Msg_text | ||
test.book optimize status OK | ||
OPTIMIZE TABLE book; | ||
Table Op Msg_type Msg_text | ||
test.book optimize status OK | ||
CALL find('they'); | ||
heading | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_DELETED; | ||
count(*) | ||
0 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; | ||
count(*) | ||
0 | ||
SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; | ||
count(*) | ||
0 | ||
DROP TABLE book; | ||
DROP PROCEDURE find; | ||
SET GLOBAL innodb_optimize_fulltext_only=OFF; | ||
SET GLOBAL innodb_ft_aux_table=default; | ||
SET GLOBAL innodb_ft_num_word_optimize=default; |
Oops, something went wrong.