Skip to content

Commit b42dbdb

Browse files
committed
Merge 10.2 into 10.3
2 parents 490dcfd + cbac8f9 commit b42dbdb

Some content is hidden

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

46 files changed

+612
-128
lines changed

client/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c)
7272
TARGET_LINK_LIBRARIES(mysql_plugin ${CLIENT_LIB})
7373

7474
MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
75-
TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB})
75+
TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB} mysys_ssl)
7676

7777
MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc ../sql/password.c)
78-
TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB})
78+
TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB} mysys_ssl)
7979

8080
MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
8181
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")

client/mysqldump.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
979979
exit(1);
980980
}
981981
break;
982+
case (int) OPT_DEFAULT_CHARSET:
983+
if (default_charset == disabled_my_option)
984+
default_charset= (char *)mysql_universal_client_charset;
985+
break;
982986
}
983987
return 0;
984988
}

extra/mariabackup/xtrabackup.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5189,7 +5189,11 @@ xb_process_datadir(
51895189
goto next_datadir_item;
51905190
}
51915191

5192-
snprintf(dbpath, sizeof(dbpath)-1, "%s/%s", path, dbinfo.name);
5192+
snprintf(dbpath, sizeof(dbpath), "%.*s/%.*s",
5193+
OS_FILE_MAX_PATH/2-1,
5194+
path,
5195+
OS_FILE_MAX_PATH/2-1,
5196+
dbinfo.name);
51935197

51945198
os_normalize_path(dbpath);
51955199

mysql-test/lib/My/Config.pm

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ use strict;
2121
use warnings;
2222
use Carp;
2323

24+
# Define all MariaDB options that the user should be able to specify
25+
# many times in the config file. Note that options must be written
26+
# using '-' instead of '_' here!
27+
28+
my %multipart_options=
29+
(
30+
"plugin-load-add" => 1,
31+
"optimizer-switch" => 1,
32+
);
33+
34+
2435
sub new {
2536
my ($class, $option_name, $option_value)= @_;
2637
my $self= bless { name => $option_name,
@@ -327,7 +338,6 @@ sub new {
327338
# Skip comment
328339
next;
329340
}
330-
331341
else {
332342
croak "Unexpected line '$line' found in '$path'";
333343
}
@@ -355,6 +365,11 @@ sub insert {
355365

356366
if ( defined $option ) {
357367
#print "option: $option, value: $value\n";
368+
my $tmp_option= $option;
369+
$tmp_option =~ s/_/-/g;
370+
371+
# If the option is an option that one can specify many times, always add
372+
$if_not_exist= 1 if ($multipart_options{$tmp_option});
358373

359374
# Add the option to the group
360375
$group->insert($option, $value, $if_not_exist);

mysql-test/lib/My/ConfigFactory.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ sub post_check_client_groups {
311311
$first_mysqld->name());
312312

313313
# Then generate [client.<suffix>] for each [mysqld.<suffix>]
314-
foreach my $mysqld ( $config->like('mysqld.') ) {
314+
foreach my $mysqld ( $config->like('mysqld\.') ) {
315315
$self->post_check_client_group($config,
316316
'client'.$mysqld->after('mysqld'),
317317
$mysqld->name())
@@ -333,7 +333,7 @@ sub post_check_embedded_group {
333333
my $mysqld= $config->group('mysqld') or
334334
croak "Can't run with embedded, config has no default mysqld section";
335335

336-
my $first_mysqld= $config->first_like('mysqld.') or
336+
my $first_mysqld= $config->first_like('mysqld\.') or
337337
croak "Can't run with embedded, config has no mysqld";
338338

339339
my %no_copy = map { $_ => 1 }
@@ -372,7 +372,7 @@ sub resolve_at_variable {
372372
}
373373
$res .= $after;
374374

375-
$config->insert($group->name(), $option->name(), $res)
375+
$option->{value}= $res;
376376
}
377377

378378

@@ -457,7 +457,7 @@ sub new_config {
457457
}
458458

459459
$self->run_section_rules($config,
460-
'mysqld.',
460+
'mysqld\.',
461461
@mysqld_rules);
462462

463463
# [mysqlbinlog] need additional settings

mysql-test/main/subselect_no_semijoin.result

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7290,5 +7290,60 @@ pk i c pk i c
72907290
1 10 foo 1 10 foo
72917291
DROP TABLE t;
72927292
# End of 10.2 tests
7293+
#
7294+
# MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
7295+
#
7296+
CREATE TABLE t1 ( a INT );
7297+
INSERT INTO t1 VALUES (1),(5);
7298+
CREATE TABLE t2 ( b INT ) ENGINE=MyISAM;
7299+
INSERT INTO t2 VALUES (1);
7300+
CREATE TABLE t3 ( c INT );
7301+
INSERT INTO t3 VALUES (4),(5);
7302+
SET @tmp19714=@@optimizer_switch;
7303+
SET optimizer_switch='subquery_cache=off';
7304+
explain format=json
7305+
SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
7306+
EXPLAIN
7307+
{
7308+
"query_block": {
7309+
"select_id": 1,
7310+
"table": {
7311+
"table_name": "t1",
7312+
"access_type": "ALL",
7313+
"rows": 2,
7314+
"filtered": 100
7315+
},
7316+
"subqueries": [
7317+
{
7318+
"query_block": {
7319+
"select_id": 2,
7320+
"pseudo_bits_condition": "1 = t1.a or <in_optimizer>(1,<exists>(subquery#3))",
7321+
"table": {
7322+
"table_name": "t2",
7323+
"access_type": "system",
7324+
"rows": 1,
7325+
"filtered": 100
7326+
},
7327+
"subqueries": [
7328+
{
7329+
"query_block": {
7330+
"select_id": 3,
7331+
"table": {
7332+
"table_name": "t3",
7333+
"access_type": "ALL",
7334+
"rows": 2,
7335+
"filtered": 100,
7336+
"attached_condition": "1 = t3.c"
7337+
}
7338+
}
7339+
}
7340+
]
7341+
}
7342+
}
7343+
]
7344+
}
7345+
}
7346+
SET optimizer_switch=@tmp19714;
7347+
drop table t1,t2,t3;
72937348
set @optimizer_switch_for_subselect_test=null;
72947349
set @join_cache_level_for_subselect_test=NULL;

mysql-test/main/subselect_no_semijoin.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,28 @@ set @join_cache_level_for_subselect_test=@@join_cache_level;
88

99
--source subselect.test
1010

11+
--echo #
12+
--echo # MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
13+
--echo #
14+
CREATE TABLE t1 ( a INT );
15+
INSERT INTO t1 VALUES (1),(5);
16+
17+
# t2 must be MyISAM or Aria and contain 1 row
18+
CREATE TABLE t2 ( b INT ) ENGINE=MyISAM;
19+
INSERT INTO t2 VALUES (1);
20+
21+
CREATE TABLE t3 ( c INT );
22+
INSERT INTO t3 VALUES (4),(5);
23+
24+
SET @tmp19714=@@optimizer_switch;
25+
SET optimizer_switch='subquery_cache=off';
26+
27+
explain format=json
28+
SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
29+
30+
SET optimizer_switch=@tmp19714;
31+
32+
drop table t1,t2,t3;
33+
1134
set @optimizer_switch_for_subselect_test=null;
1235
set @join_cache_level_for_subselect_test=NULL;

mysql-test/main/win.result

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3607,6 +3607,33 @@ b row_number() over (partition by sum(a)+1)
36073607
2000 1
36083608
drop table t1;
36093609
#
3610+
# MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF,
3611+
# window functions and views
3612+
#
3613+
create table t1 (id int, n1 int);
3614+
insert into t1 values (1,1),(2,1),(3,2),(4,4);
3615+
explain
3616+
select max(n1) over (partition by 'abc') from t1;
3617+
id select_type table type possible_keys key key_len ref rows Extra
3618+
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary
3619+
select max(n1) over (partition by 'abc') from t1;
3620+
max(n1) over (partition by 'abc')
3621+
4
3622+
4
3623+
4
3624+
4
3625+
explain
3626+
select rank() over (partition by 'abc' order by 'xyz') from t1;
3627+
id select_type table type possible_keys key key_len ref rows Extra
3628+
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary
3629+
select rank() over (partition by 'abc' order by 'xyz') from t1;
3630+
rank() over (partition by 'abc' order by 'xyz')
3631+
1
3632+
1
3633+
1
3634+
1
3635+
drop table t1;
3636+
#
36103637
# End of 10.2 tests
36113638
#
36123639
#

mysql-test/main/win.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,6 +2325,22 @@ select b, row_number() over (partition by sum(a)+1) from t1 group by b;
23252325

23262326
drop table t1;
23272327

2328+
--echo #
2329+
--echo # MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF,
2330+
--echo # window functions and views
2331+
--echo #
2332+
2333+
create table t1 (id int, n1 int);
2334+
insert into t1 values (1,1),(2,1),(3,2),(4,4);
2335+
explain
2336+
select max(n1) over (partition by 'abc') from t1;
2337+
select max(n1) over (partition by 'abc') from t1;
2338+
2339+
explain
2340+
select rank() over (partition by 'abc' order by 'xyz') from t1;
2341+
select rank() over (partition by 'abc' order by 'xyz') from t1;
2342+
drop table t1;
2343+
23282344
--echo #
23292345
--echo # End of 10.2 tests
23302346
--echo #
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# Preparatory cleanup.
3+
#
4+
drop database if exists mysqltest;
5+
create database mysqltest;
6+
use mysqltest;
7+
DROP TABLE IF EXISTS t1;
8+
#
9+
# We need a fixed timestamp to avoid varying results.
10+
#
11+
SET timestamp=1000000000;
12+
#
13+
# We need big packets.
14+
#
15+
# Capture initial value to reset at the end of the test
16+
# Now adjust max_allowed_packet
17+
SET @@global.max_allowed_packet= 10*1024*1024*1024;
18+
Warnings:
19+
Warning 1292 Truncated incorrect max_allowed_packet value: '10737418240'
20+
max_allowed_packet is a global variable.
21+
In order for the preceding change in max_allowed_packets' value
22+
to be seen and used, we must start a new connection.
23+
The change does not take effect with the current one.
24+
For simplicity, we just disconnect / reconnect connection default here.
25+
disconnect default;
26+
connect default, localhost,root,,;
27+
#
28+
# Delete all existing binary logs.
29+
#
30+
RESET MASTER;
31+
#
32+
# Create a test table.
33+
#
34+
use mysqltest;
35+
CREATE TABLE t1 (
36+
c1 LONGTEXT
37+
) DEFAULT CHARSET latin1;
38+
#
39+
# Show how many rows are affected by each statement.
40+
#
41+
#
42+
# Insert some big rows.
43+
#
44+
insert 1024MB data twice
45+
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864));
46+
affected rows: 1
47+
INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864));
48+
affected rows: 1
49+
#
50+
# Flush all log buffers to the log file.
51+
#
52+
FLUSH LOGS;
53+
affected rows: 0
54+
#
55+
# Call mysqlbinlog to display the log file contents.
56+
# NOTE: The output of mysqlbinlog is redirected to
57+
# $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out
58+
# If you want to examine it, disable remove_file
59+
# at the bottom of the test script.
60+
#
61+
#
62+
# Cleanup.
63+
#
64+
# reset variable value to pass testcase checks
65+
SET @@global.max_allowed_packet = 16777216;
66+
affected rows: 0
67+
DROP TABLE t1;
68+
affected rows: 0
69+
drop database if exists mysqltest;
70+
affected rows: 0
71+
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out

0 commit comments

Comments
 (0)