Skip to content

Commit

Permalink
Merge branch 'bb-10.5-all-builders' into bb-10.6-all-builders
Browse files Browse the repository at this point in the history
  • Loading branch information
mariadb-lenastartseva committed Sep 27, 2022
2 parents 789f55c + 2abf499 commit f8f25b4
Show file tree
Hide file tree
Showing 309 changed files with 2,112 additions and 196 deletions.
52 changes: 37 additions & 15 deletions client/mysqltest.cc
Expand Up @@ -119,6 +119,7 @@ static my_bool opt_mark_progress= 0;
static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
static my_bool view_protocol= 0, view_protocol_enabled= 0;
static my_bool service_connection_enabled= 1;
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
static my_bool parsing_disabled= 0;
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
Expand Down Expand Up @@ -157,6 +158,7 @@ static struct property prop_list[] = {
{ &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"},
{ &service_connection_enabled, 0, 1, 0, "$ENABLED_SERVICE_CONNECTION"},
{ &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 @@ -172,6 +174,7 @@ enum enum_prop {
P_META,
P_PS,
P_VIEW,
P_CONN,
P_QUERY,
P_RESULT,
P_WARN,
Expand Down Expand Up @@ -379,6 +382,7 @@ enum enum_commands {
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_DISABLE_SERVICE_CONNECTION, Q_ENABLE_SERVICE_CONNECTION,
Q_ENABLE_NON_BLOCKING_API, Q_DISABLE_NON_BLOCKING_API,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
Q_IF,
Expand Down Expand Up @@ -472,6 +476,8 @@ const char *command_names[]=
"enable_ps_protocol",
"disable_view_protocol",
"enable_view_protocol",
"disable_service_connection",
"enable_service_connection",
"enable_non_blocking_api",
"disable_non_blocking_api",
"disable_reconnect",
Expand Down Expand Up @@ -8979,25 +8985,30 @@ int util_query(MYSQL* org_mysql, const char* query){
MYSQL* mysql;
DBUG_ENTER("util_query");

if(!(mysql= cur_con->util_mysql))
if (service_connection_enabled)
{
DBUG_PRINT("info", ("Creating util_mysql"));
if (!(mysql= mysql_init(mysql)))
die("Failed in mysql_init()");
if(!(mysql= cur_con->util_mysql))
{
DBUG_PRINT("info", ("Creating util_mysql"));
if (!(mysql= mysql_init(mysql)))
die("Failed in mysql_init()");

if (opt_connect_timeout)
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
(void *) &opt_connect_timeout);
if (opt_connect_timeout)
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
(void *) &opt_connect_timeout);

/* enable local infile, in non-binary builds often disabled by default */
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
org_mysql->passwd, org_mysql->db, org_mysql->port,
org_mysql->unix_socket);
/* enable local infile, in non-binary builds often disabled by default */
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
org_mysql->passwd, org_mysql->db, org_mysql->port,
org_mysql->unix_socket);

cur_con->util_mysql= mysql;
cur_con->util_mysql= mysql;
}
}
else
mysql= org_mysql;

int ret= mysql_query(mysql, query);
DBUG_RETURN(ret);
Expand Down Expand Up @@ -9146,7 +9157,10 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
Collect warnings from create of the view that should otherwise
have been produced when the SELECT was executed
*/
append_warnings(&ds_warnings, cur_con->util_mysql);
append_warnings(&ds_warnings,
service_connection_enabled ?
cur_con->util_mysql :
mysql);
}

dynstr_free(&query_str);
Expand Down Expand Up @@ -10200,6 +10214,14 @@ int main(int argc, char **argv)
case Q_ENABLE_VIEW_PROTOCOL:
set_property(command, P_VIEW, view_protocol);
break;
case Q_DISABLE_SERVICE_CONNECTION:
set_property(command, P_CONN, 0);
/* Close only util connections */
close_util_connections();
break;
case Q_ENABLE_SERVICE_CONNECTION:
set_property(command, P_CONN, view_protocol);
break;
case Q_DISABLE_NON_BLOCKING_API:
non_blocking_api_enabled= 0;
break;
Expand Down
20 changes: 11 additions & 9 deletions mysql-test/include/concurrent.inc
Expand Up @@ -55,6 +55,7 @@ GRANT USAGE ON test.* TO mysqltest@localhost;
--echo **
--echo ** two UPDATE's running and both changing distinct result sets
--echo **
--disable_view_protocol
connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
Expand Down Expand Up @@ -140,7 +141,6 @@ GRANT USAGE ON test.* TO mysqltest@localhost;
connection default;
drop table t1;


--echo
--echo **
--echo ** two UPDATE's running and one changing result set
Expand Down Expand Up @@ -228,7 +228,7 @@ drop table t1;

connection default;
drop table t1;

--enable_view_protocol

--echo
--echo **
Expand Down Expand Up @@ -306,8 +306,9 @@ drop table t1;
--echo ** Begin a new transaction on thread 2
begin;
--echo ** Select a range for update.
--disable_view_protocol
select * from t1 where tipo=2 FOR UPDATE;

--enable_view_protocol
connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
Expand Down Expand Up @@ -346,6 +347,7 @@ drop table t1;
--echo **
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
--echo **
--disable_view_protocol
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
Expand All @@ -369,7 +371,6 @@ drop table t1;
begin;
--echo ** Starting SELECT .. FOR UPDATE
select * from t1 where tipo=2 FOR UPDATE;

connection thread1;
--echo
--echo ** Starting new transaction on thread 1
Expand Down Expand Up @@ -439,14 +440,15 @@ drop table t1;
--echo ** Begin a new transaction on thread 2
begin;
select * from t1 where tipo=2 FOR UPDATE;

connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
--echo ** Selecting a range for update by table scan will be blocked
--echo ** because of on-going transaction on thread 2.
--disable_view_protocol
--error ER_LOCK_WAIT_TIMEOUT
select * from t1 where tipo=1 FOR UPDATE;
select * from t1 where tipo=1 FOR UPDATE;
--enable_view_protocol

connection thread2;
--echo ** Table will be unchanged and the select command will not be
Expand All @@ -469,7 +471,7 @@ drop table t1;

connection default;
drop table t1;

--enable_view_protocol

--echo
--echo **
Expand Down Expand Up @@ -555,7 +557,7 @@ drop table t1;
# succeding update in the following thread. Also the used status variables '%lock%' and
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;

--disable_view_protocol
connection thread1;
begin;
--echo ** Update on t1 will cause a table scan which will be blocked because
Expand All @@ -578,7 +580,7 @@ drop table t1;
reap;
select * from t1;
send commit;

--enable_view_protocol
connection thread1;
commit;

Expand Down
4 changes: 4 additions & 0 deletions mysql-test/include/count_sessions.inc
Expand Up @@ -18,4 +18,8 @@
# Created: 2009-01-14 mleich
#

# Tests will be skipped for the view protocol because the view protocol creates
# an additional util connection and other statistics data
-- source include/no_view_protocol.inc

let $count_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
4 changes: 3 additions & 1 deletion mysql-test/include/ctype_E05C.inc
Expand Up @@ -81,6 +81,8 @@ DROP TABLE t1;
# even if character_set_connection is big5/cp932/gbk/sjis.
# Note, the other 0x5C which is before 0xE05C is also treated as escape.
#
#check after fix MDEV-29290
--disable_view_protocol
SET character_set_client=binary, character_set_results=binary;
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
SELECT HEX('�\['), HEX('\�\[');
Expand All @@ -105,7 +107,7 @@ SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('�\['),('\�\[');
SELECT HEX(a) FROM t1;
DROP TABLE t1;

--enable_view_protocol

--echo # Start of ctype_E05C.inc

2 changes: 2 additions & 0 deletions mysql-test/include/ctype_common.inc
Expand Up @@ -67,10 +67,12 @@ drop table t1;
--echo #
--echo # MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
--echo #
--disable_service_connection
SET character_set_client=latin1;
SET character_set_connection= @test_character_set;
SET collation_connection= @test_collation;
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
--enable_service_connection

#
# Bug#27580 SPACE() function collation bug?
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/include/ctype_datetime.inc
Expand Up @@ -18,6 +18,8 @@ SET time_zone=default;

# TODO: remove "--disable_ps_protocol" when MDEV-5444 is fixed
--disable_ps_protocol
#remove "--disable_view_protocol" in 10.6 version
--disable_view_protocol
SELECT CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY);
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
Expand Down Expand Up @@ -55,3 +57,4 @@ SELECT * FROM t1 WHERE t = CONCAT('2001-01-08 00:00:00',LEFT(RAND(),0)) - INTERV
SELECT * FROM t1 WHERE t < TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY;
SELECT * FROM t1 WHERE t = TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY;
DROP TABLE t1;
--enable_view_protocol
4 changes: 3 additions & 1 deletion mysql-test/include/ctype_german.inc
Expand Up @@ -46,14 +46,16 @@ INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C);
#
# Check order
#
#enable after fix MDEV-29290
--disable_view_protocol
select s1, hex(s1) from t1 order by s1, binary s1;
select group_concat(s1 order by binary s1) from t1 group by s1;

SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1);
SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1);

drop table t1;

--enable_view_protocol

#
# Check filesort for 'S' and "U+00DF SHARP S",
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/include/ctype_like_range_f1f2.inc
Expand Up @@ -17,9 +17,12 @@ INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));

#check after fix MDEV-29290
--disable_view_protocol
# Check pattern (important for ucs2, utf16, utf32)
SELECT hex(concat(repeat(0xF1F2, 10), '%'));

--echo 3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
DROP TABLE t1;
--enable_view_protocol
4 changes: 4 additions & 0 deletions mysql-test/include/ctype_myanmar.inc
Expand Up @@ -1293,7 +1293,11 @@ INSERT INTO t1 (s1) VALUES
(_ucs2 0x101C1000103A10181000103A),
(_ucs2 0x101C103910181000103A /* tea */);

# enable view-protocol after fix MDEV-27871
--disable_view_protocol

SELECT id, IF(LEFT(s1,1)='-',s1,CONCAT(HEX(WEIGHT_STRING(s1)),'\t', HEX(CONVERT(s1 USING ucs2)))) FROM t1 ORDER BY id;
--enable_view_protocol

DROP TABLE t1;

Expand Down
5 changes: 5 additions & 0 deletions mysql-test/include/ctype_numconv.inc
@@ -1,3 +1,7 @@
#remove this include after fix MDEV-27871
# maybe some tests need to be excluded separately after fix
--source include/no_view_protocol.inc

SET TIME_ZONE = _latin1 '+03:00';

--echo #
Expand Down Expand Up @@ -1631,6 +1635,7 @@ SELECT charset(@x), collation(@x);
--echo #
--echo # Bug#54916 GROUP_CONCAT + IFNULL truncates output
--echo #

SELECT @@collation_connection;
# ENGINE=MYISAM is very important to make sure "SYSTEM" join type
# is in use, which will create instances of Item_copy.
Expand Down
5 changes: 3 additions & 2 deletions mysql-test/include/ctype_pad.inc
Expand Up @@ -52,13 +52,14 @@ DROP TABLE t1;
--echo #
--echo # IF, CASE, LEAST
--echo #

#enable after fix MDEV-27871
--disable_view_protocol
eval SELECT IF('abc' COLLATE $coll = 'abc ', 'pad', 'nopad');
eval SELECT CASE 'abc' COLLATE $coll WHEN 'abc ' THEN 'pad' ELSE 'nopad' END;
eval SELECT CASE WHEN 'abc' COLLATE $coll = 'abc ' THEN 'pad' ELSE 'nopad' END;
eval SELECT HEX(LEAST('abc ' COLLATE $coll, 'abc '));
eval SELECT HEX(GREATEST('abc ' COLLATE $coll, 'abc '));

--enable_view_protocol
--echo #
--echo # Collation mix
--echo #
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/include/ctype_str_to_date.inc
Expand Up @@ -3,7 +3,10 @@
--echo #

SELECT @@character_set_connection, HEX(CAST(_utf8'÷' AS CHAR));
# enable view-protocol after fix MDEV-27871
--disable_view_protocol
SELECT STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR));
--enable_view_protocol
CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
SHOW COLUMNS FROM t1;
INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/include/ctype_unescape.inc
Expand Up @@ -309,12 +309,15 @@ CALL p2();
--disable_warnings
# All records marked with '[BAD]' mean that the string was unescaped
# in a unexpected way, that means there is a bug in UNESCAPE() above.
#check after fix MDEV-29290
--disable_view_protocol
SELECT HEX(a),HEX(b),
CONCAT(unescape_type(a,b),
wellformedness(a,b),
mysql_real_escape_string_generated(a),
IF(UNESCAPE(a)<>b,CONCAT('[BAD',HEX(UNESCAPE(a)),']'),'')) AS comment
FROM t1 ORDER BY LENGTH(a),a;
--enable_view_protocol
--enable_warnings
DROP TABLE t1;
DROP PROCEDURE p1;
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/include/ctype_utf8mb4.inc
@@ -1,6 +1,12 @@
#
# Tests with the utf8mb4 character set
#

# Tests will be skipped for the view protocol because the view protocol uses
# an additional util connection and don't use for this nessesary configurations
# Also need to resolve MDEV-27871
-- source include/no_view_protocol.inc

--source include/default_optimizer_switch.inc
--disable_warnings
drop table if exists t1,t2;
Expand Down

0 comments on commit f8f25b4

Please sign in to comment.