Skip to content

Commit 851b31b

Browse files
committed
Merge branch 'bb-10.8-vp-MDEV-27691' into 10.8
2 parents 618d820 + a4234f0 commit 851b31b

File tree

323 files changed

+2234
-199
lines changed

Some content is hidden

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

323 files changed

+2234
-199
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",
@@ -9029,25 +9035,30 @@ int util_query(MYSQL* org_mysql, const char* query){
90299035
MYSQL* mysql;
90309036
DBUG_ENTER("util_query");
90319037

9032-
if(!(mysql= cur_con->util_mysql))
9038+
if (service_connection_enabled)
90339039
{
9034-
DBUG_PRINT("info", ("Creating util_mysql"));
9035-
if (!(mysql= mysql_init(mysql)))
9036-
die("Failed in mysql_init()");
9040+
if(!(mysql= cur_con->util_mysql))
9041+
{
9042+
DBUG_PRINT("info", ("Creating util_mysql"));
9043+
if (!(mysql= mysql_init(mysql)))
9044+
die("Failed in mysql_init()");
90379045

9038-
if (opt_connect_timeout)
9039-
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
9040-
(void *) &opt_connect_timeout);
9046+
if (opt_connect_timeout)
9047+
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
9048+
(void *) &opt_connect_timeout);
90419049

9042-
/* enable local infile, in non-binary builds often disabled by default */
9043-
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
9044-
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
9045-
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
9046-
org_mysql->passwd, org_mysql->db, org_mysql->port,
9047-
org_mysql->unix_socket);
9050+
/* enable local infile, in non-binary builds often disabled by default */
9051+
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
9052+
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
9053+
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
9054+
org_mysql->passwd, org_mysql->db, org_mysql->port,
9055+
org_mysql->unix_socket);
90489056

9049-
cur_con->util_mysql= mysql;
9057+
cur_con->util_mysql= mysql;
9058+
}
90509059
}
9060+
else
9061+
mysql= org_mysql;
90519062

90529063
int ret= mysql_query(mysql, query);
90539064
DBUG_RETURN(ret);
@@ -9196,7 +9207,10 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
91969207
Collect warnings from create of the view that should otherwise
91979208
have been produced when the SELECT was executed
91989209
*/
9199-
append_warnings(&ds_warnings, cur_con->util_mysql);
9210+
append_warnings(&ds_warnings,
9211+
service_connection_enabled ?
9212+
cur_con->util_mysql :
9213+
mysql);
92009214
}
92019215

92029216
dynstr_free(&query_str);
@@ -10250,6 +10264,14 @@ int main(int argc, char **argv)
1025010264
case Q_ENABLE_VIEW_PROTOCOL:
1025110265
set_property(command, P_VIEW, view_protocol);
1025210266
break;
10267+
case Q_DISABLE_SERVICE_CONNECTION:
10268+
set_property(command, P_CONN, 0);
10269+
/* Close only util connections */
10270+
close_util_connections();
10271+
break;
10272+
case Q_ENABLE_SERVICE_CONNECTION:
10273+
set_property(command, P_CONN, view_protocol);
10274+
break;
1025310275
case Q_DISABLE_NON_BLOCKING_API:
1025410276
non_blocking_api_enabled= 0;
1025510277
break;

mysql-test/include/concurrent.inc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ GRANT USAGE ON test.* TO mysqltest@localhost;
5555
--echo **
5656
--echo ** two UPDATE's running and both changing distinct result sets
5757
--echo **
58+
--disable_view_protocol
5859
connect (thread1, localhost, mysqltest,,);
5960
connection thread1;
6061
--echo ** Set up table
@@ -140,7 +141,6 @@ GRANT USAGE ON test.* TO mysqltest@localhost;
140141
connection default;
141142
drop table t1;
142143

143-
144144
--echo
145145
--echo **
146146
--echo ** two UPDATE's running and one changing result set
@@ -228,7 +228,7 @@ drop table t1;
228228

229229
connection default;
230230
drop table t1;
231-
231+
--enable_view_protocol
232232

233233
--echo
234234
--echo **
@@ -306,8 +306,9 @@ drop table t1;
306306
--echo ** Begin a new transaction on thread 2
307307
begin;
308308
--echo ** Select a range for update.
309+
--disable_view_protocol
309310
select * from t1 where tipo=2 FOR UPDATE;
310-
311+
--enable_view_protocol
311312
connection thread1;
312313
--echo ** Begin a new transaction on thread 1
313314
begin;
@@ -346,6 +347,7 @@ drop table t1;
346347
--echo **
347348
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
348349
--echo **
350+
--disable_view_protocol
349351
#connect (thread1, localhost, mysqltest,,);
350352
connection thread1;
351353
--echo ** Set up table
@@ -369,7 +371,6 @@ drop table t1;
369371
begin;
370372
--echo ** Starting SELECT .. FOR UPDATE
371373
select * from t1 where tipo=2 FOR UPDATE;
372-
373374
connection thread1;
374375
--echo
375376
--echo ** Starting new transaction on thread 1
@@ -439,14 +440,15 @@ drop table t1;
439440
--echo ** Begin a new transaction on thread 2
440441
begin;
441442
select * from t1 where tipo=2 FOR UPDATE;
442-
443443
connection thread1;
444444
--echo ** Begin a new transaction on thread 1
445445
begin;
446446
--echo ** Selecting a range for update by table scan will be blocked
447447
--echo ** because of on-going transaction on thread 2.
448+
--disable_view_protocol
448449
--error ER_LOCK_WAIT_TIMEOUT
449-
select * from t1 where tipo=1 FOR UPDATE;
450+
select * from t1 where tipo=1 FOR UPDATE;
451+
--enable_view_protocol
450452

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

470472
connection default;
471473
drop table t1;
472-
474+
--enable_view_protocol
473475

474476
--echo
475477
--echo **
@@ -555,7 +557,7 @@ drop table t1;
555557
# succeding update in the following thread. Also the used status variables '%lock%' and
556558
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
557559
sleep 1;
558-
560+
--disable_view_protocol
559561
connection thread1;
560562
begin;
561563
--echo ** Update on t1 will cause a table scan which will be blocked because
@@ -578,7 +580,7 @@ drop table t1;
578580
reap;
579581
select * from t1;
580582
send commit;
581-
583+
--enable_view_protocol
582584
connection thread1;
583585
commit;
584586

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)