Skip to content

Commit 7cad2e9

Browse files
committed
Merge branch 'bb-10.4-vp-MDEV-27691' into 10.4
2 parents 0cddb1a + 184e659 commit 7cad2e9

File tree

301 files changed

+2041
-194
lines changed

Some content is hidden

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

301 files changed

+2041
-194
lines changed

client/mysqltest.cc

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ static my_bool opt_mark_progress= 0;
119119
static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
120120
static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
121121
static my_bool view_protocol= 0, view_protocol_enabled= 0;
122+
static my_bool service_connection_enabled= 1;
122123
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
123124
static my_bool parsing_disabled= 0;
124125
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
@@ -157,6 +158,7 @@ static struct property prop_list[] = {
157158
{ &display_metadata, 0, 0, 0, "$ENABLED_METADATA" },
158159
{ &ps_protocol_enabled, 0, 0, 0, "$ENABLED_PS_PROTOCOL" },
159160
{ &view_protocol_enabled, 0, 0, 0, "$ENABLED_VIEW_PROTOCOL"},
161+
{ &service_connection_enabled, 0, 1, 0, "$ENABLED_SERVICE_CONNECTION"},
160162
{ &disable_query_log, 0, 0, 1, "$ENABLED_QUERY_LOG" },
161163
{ &disable_result_log, 0, 0, 1, "$ENABLED_RESULT_LOG" },
162164
{ &disable_warnings, 0, 0, 1, "$ENABLED_WARNINGS" }
@@ -172,6 +174,7 @@ enum enum_prop {
172174
P_META,
173175
P_PS,
174176
P_VIEW,
177+
P_CONN,
175178
P_QUERY,
176179
P_RESULT,
177180
P_WARN,
@@ -379,6 +382,7 @@ enum enum_commands {
379382
Q_START_TIMER, Q_END_TIMER,
380383
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
381384
Q_DISABLE_VIEW_PROTOCOL, Q_ENABLE_VIEW_PROTOCOL,
385+
Q_DISABLE_SERVICE_CONNECTION, Q_ENABLE_SERVICE_CONNECTION,
382386
Q_ENABLE_NON_BLOCKING_API, Q_DISABLE_NON_BLOCKING_API,
383387
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
384388
Q_IF,
@@ -472,6 +476,8 @@ const char *command_names[]=
472476
"enable_ps_protocol",
473477
"disable_view_protocol",
474478
"enable_view_protocol",
479+
"disable_service_connection",
480+
"enable_service_connection",
475481
"enable_non_blocking_api",
476482
"disable_non_blocking_api",
477483
"disable_reconnect",
@@ -8898,25 +8904,30 @@ int util_query(MYSQL* org_mysql, const char* query){
88988904
MYSQL* mysql;
88998905
DBUG_ENTER("util_query");
89008906

8901-
if(!(mysql= cur_con->util_mysql))
8907+
if (service_connection_enabled)
89028908
{
8903-
DBUG_PRINT("info", ("Creating util_mysql"));
8904-
if (!(mysql= mysql_init(mysql)))
8905-
die("Failed in mysql_init()");
8909+
if(!(mysql= cur_con->util_mysql))
8910+
{
8911+
DBUG_PRINT("info", ("Creating util_mysql"));
8912+
if (!(mysql= mysql_init(mysql)))
8913+
die("Failed in mysql_init()");
89068914

8907-
if (opt_connect_timeout)
8908-
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
8909-
(void *) &opt_connect_timeout);
8915+
if (opt_connect_timeout)
8916+
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
8917+
(void *) &opt_connect_timeout);
89108918

8911-
/* enable local infile, in non-binary builds often disabled by default */
8912-
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
8913-
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
8914-
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
8915-
org_mysql->passwd, org_mysql->db, org_mysql->port,
8916-
org_mysql->unix_socket);
8919+
/* enable local infile, in non-binary builds often disabled by default */
8920+
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
8921+
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
8922+
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
8923+
org_mysql->passwd, org_mysql->db, org_mysql->port,
8924+
org_mysql->unix_socket);
89178925

8918-
cur_con->util_mysql= mysql;
8926+
cur_con->util_mysql= mysql;
8927+
}
89198928
}
8929+
else
8930+
mysql= org_mysql;
89208931

89218932
int ret= mysql_query(mysql, query);
89228933
DBUG_RETURN(ret);
@@ -9065,7 +9076,10 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
90659076
Collect warnings from create of the view that should otherwise
90669077
have been produced when the SELECT was executed
90679078
*/
9068-
append_warnings(&ds_warnings, cur_con->util_mysql);
9079+
append_warnings(&ds_warnings,
9080+
service_connection_enabled ?
9081+
cur_con->util_mysql :
9082+
mysql);
90699083
}
90709084

90719085
dynstr_free(&query_str);
@@ -10099,6 +10113,14 @@ int main(int argc, char **argv)
1009910113
case Q_ENABLE_VIEW_PROTOCOL:
1010010114
set_property(command, P_VIEW, view_protocol);
1010110115
break;
10116+
case Q_DISABLE_SERVICE_CONNECTION:
10117+
set_property(command, P_CONN, 0);
10118+
/* Close only util connections */
10119+
close_util_connections();
10120+
break;
10121+
case Q_ENABLE_SERVICE_CONNECTION:
10122+
set_property(command, P_CONN, view_protocol);
10123+
break;
1010210124
case Q_DISABLE_NON_BLOCKING_API:
1010310125
non_blocking_api_enabled= 0;
1010410126
break;

mysql-test/include/concurrent.inc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ drop table if exists t1;
6464
--echo **
6565
--echo ** two UPDATE's running and both changing distinct result sets
6666
--echo **
67+
--disable_view_protocol
6768
connect (thread1, localhost, mysqltest,,);
6869
connection thread1;
6970
--echo ** Set up table
@@ -149,7 +150,6 @@ drop table if exists t1;
149150
connection default;
150151
drop table t1;
151152

152-
153153
--echo
154154
--echo **
155155
--echo ** two UPDATE's running and one changing result set
@@ -237,7 +237,7 @@ drop table t1;
237237

238238
connection default;
239239
drop table t1;
240-
240+
--enable_view_protocol
241241

242242
--echo
243243
--echo **
@@ -315,8 +315,9 @@ drop table t1;
315315
--echo ** Begin a new transaction on thread 2
316316
begin;
317317
--echo ** Select a range for update.
318+
--disable_view_protocol
318319
select * from t1 where tipo=2 FOR UPDATE;
319-
320+
--enable_view_protocol
320321
connection thread1;
321322
--echo ** Begin a new transaction on thread 1
322323
begin;
@@ -355,6 +356,7 @@ drop table t1;
355356
--echo **
356357
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
357358
--echo **
359+
--disable_view_protocol
358360
#connect (thread1, localhost, mysqltest,,);
359361
connection thread1;
360362
--echo ** Set up table
@@ -378,7 +380,6 @@ drop table t1;
378380
begin;
379381
--echo ** Starting SELECT .. FOR UPDATE
380382
select * from t1 where tipo=2 FOR UPDATE;
381-
382383
connection thread1;
383384
--echo
384385
--echo ** Starting new transaction on thread 1
@@ -448,14 +449,15 @@ drop table t1;
448449
--echo ** Begin a new transaction on thread 2
449450
begin;
450451
select * from t1 where tipo=2 FOR UPDATE;
451-
452452
connection thread1;
453453
--echo ** Begin a new transaction on thread 1
454454
begin;
455455
--echo ** Selecting a range for update by table scan will be blocked
456456
--echo ** because of on-going transaction on thread 2.
457+
--disable_view_protocol
457458
--error ER_LOCK_WAIT_TIMEOUT
458-
select * from t1 where tipo=1 FOR UPDATE;
459+
select * from t1 where tipo=1 FOR UPDATE;
460+
--enable_view_protocol
459461

460462
connection thread2;
461463
--echo ** Table will be unchanged and the select command will not be
@@ -478,7 +480,7 @@ drop table t1;
478480

479481
connection default;
480482
drop table t1;
481-
483+
--enable_view_protocol
482484

483485
--echo
484486
--echo **
@@ -564,7 +566,7 @@ drop table t1;
564566
# succeding update in the following thread. Also the used status variables '%lock%' and
565567
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
566568
sleep 1;
567-
569+
--disable_view_protocol
568570
connection thread1;
569571
begin;
570572
--echo ** Update on t1 will cause a table scan which will be blocked because
@@ -587,7 +589,7 @@ drop table t1;
587589
reap;
588590
select * from t1;
589591
send commit;
590-
592+
--enable_view_protocol
591593
connection thread1;
592594
commit;
593595

mysql-test/include/count_sessions.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@
1818
# Created: 2009-01-14 mleich
1919
#
2020

21+
# Tests will be skipped for the view protocol because the view protocol creates
22+
# an additional util connection and other statistics data
23+
-- source include/no_view_protocol.inc
24+
2125
let $count_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);

mysql-test/include/ctype_E05C.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ DROP TABLE t1;
8181
# even if character_set_connection is big5/cp932/gbk/sjis.
8282
# Note, the other 0x5C which is before 0xE05C is also treated as escape.
8383
#
84+
#check after fix MDEV-29290
85+
--disable_view_protocol
8486
SET character_set_client=binary, character_set_results=binary;
8587
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
8688
SELECT HEX('à\['), HEX('\à\[');
@@ -105,7 +107,7 @@ SHOW CREATE TABLE t1;
105107
INSERT INTO t1 VALUES ('à\['),('\à\[');
106108
SELECT HEX(a) FROM t1;
107109
DROP TABLE t1;
108-
110+
--enable_view_protocol
109111
110112
--echo # Start of ctype_E05C.inc
111113

mysql-test/include/ctype_common.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ drop table t1;
6767
--echo #
6868
--echo # MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found
6969
--echo #
70+
--disable_service_connection
7071
SET character_set_client=latin1;
7172
SET character_set_connection= @test_character_set;
7273
SET collation_connection= @test_collation;
7374
SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1;
75+
--enable_service_connection
7476

7577
#
7678
# Bug#27580 SPACE() function collation bug?

mysql-test/include/ctype_datetime.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ SET time_zone=default;
1818

1919
# TODO: remove "--disable_ps_protocol" when MDEV-5444 is fixed
2020
--disable_ps_protocol
21+
#remove "--disable_view_protocol" in 10.6 version
22+
--disable_view_protocol
2123
SELECT CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY);
2224
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
2325
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
@@ -55,3 +57,4 @@ SELECT * FROM t1 WHERE t = CONCAT('2001-01-08 00:00:00',LEFT(RAND(),0)) - INTERV
5557
SELECT * FROM t1 WHERE t < TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY;
5658
SELECT * FROM t1 WHERE t = TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY;
5759
DROP TABLE t1;
60+
--enable_view_protocol

mysql-test/include/ctype_german.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@ INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C);
4646
#
4747
# Check order
4848
#
49+
#enable after fix MDEV-29290
50+
--disable_view_protocol
4951
select s1, hex(s1) from t1 order by s1, binary s1;
5052
select group_concat(s1 order by binary s1) from t1 group by s1;
5153

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

5557
drop table t1;
56-
58+
--enable_view_protocol
5759

5860
#
5961
# Check filesort for 'S' and "U+00DF SHARP S",

mysql-test/include/ctype_like_range_f1f2.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
1717
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
1818
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
1919

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

2325
--echo 3 rows expected
2426
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
2527
DROP TABLE t1;
28+
--enable_view_protocol

mysql-test/include/ctype_myanmar.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,11 @@ INSERT INTO t1 (s1) VALUES
12931293
(_ucs2 0x101C1000103A10181000103A),
12941294
(_ucs2 0x101C103910181000103A /* tea */);
12951295

1296+
# enable view-protocol after fix MDEV-27871
1297+
--disable_view_protocol
1298+
12961299
SELECT id, IF(LEFT(s1,1)='-',s1,CONCAT(HEX(WEIGHT_STRING(s1)),'\t', HEX(CONVERT(s1 USING ucs2)))) FROM t1 ORDER BY id;
1300+
--enable_view_protocol
12971301

12981302
DROP TABLE t1;
12991303

mysql-test/include/ctype_numconv.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#remove this include after fix MDEV-27871
2+
# maybe some tests need to be excluded separately after fix
3+
--source include/no_view_protocol.inc
4+
15
SET TIME_ZONE = _latin1 '+03:00';
26

37
--echo #
@@ -1631,6 +1635,7 @@ SELECT charset(@x), collation(@x);
16311635
--echo #
16321636
--echo # Bug#54916 GROUP_CONCAT + IFNULL truncates output
16331637
--echo #
1638+
16341639
SELECT @@collation_connection;
16351640
# ENGINE=MYISAM is very important to make sure "SYSTEM" join type
16361641
# is in use, which will create instances of Item_copy.

0 commit comments

Comments
 (0)