Skip to content

Commit 4ae105a

Browse files
committed
Merge 10.4 into 10.5
2 parents f98d2ef + 87a5d16 commit 4ae105a

File tree

66 files changed

+1029
-224
lines changed

Some content is hidden

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

66 files changed

+1029
-224
lines changed

client/mysqltest.cc

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ static my_bool non_blocking_api_enabled= 0;
9292

9393
#define CLOSED_CONNECTION "-closed_connection-"
9494

95+
#define dynstr_append DO_NO_USE
96+
9597
#ifndef HAVE_SETENV
9698
static int setenv(const char *name, const char *value, int overwrite);
9799
#endif
@@ -1865,7 +1867,7 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
18651867
if (strncmp(arg, "--", 2) == 0)
18661868
dynstr_append_os_quoted(&ds_cmdline, arg, NullS);
18671869
else
1868-
dynstr_append(&ds_cmdline, arg);
1870+
dynstr_append_mem(&ds_cmdline, arg, strlen(arg));
18691871
dynstr_append_mem(&ds_cmdline, STRING_WITH_LEN(" "));
18701872
}
18711873

@@ -2022,11 +2024,11 @@ void show_diff(DYNAMIC_STRING* ds,
20222024
dynstr_append_mem(&ds_tmp, message, sizeof(message));
20232025

20242026
dynstr_append_mem(&ds_tmp, STRING_WITH_LEN(" --- "));
2025-
dynstr_append(&ds_tmp, filename1);
2027+
dynstr_append_mem(&ds_tmp, filename1, strlen(filename1));
20262028
dynstr_append_mem(&ds_tmp, STRING_WITH_LEN(" >>>\n"));
20272029
cat_file(&ds_tmp, filename1);
20282030
dynstr_append_mem(&ds_tmp, STRING_WITH_LEN("<<<\n --- "));
2029-
dynstr_append(&ds_tmp, filename1);
2031+
dynstr_append_mem(&ds_tmp, filename1, strlen(filename1));
20302032
dynstr_append_mem(&ds_tmp, STRING_WITH_LEN(" >>>\n"));
20312033
cat_file(&ds_tmp, filename2);
20322034
dynstr_append_mem(&ds_tmp, STRING_WITH_LEN("<<<<\n"));
@@ -3277,13 +3279,15 @@ static int replace(DYNAMIC_STRING *ds_str,
32773279
{
32783280
DYNAMIC_STRING ds_tmp;
32793281
const char *start= strstr(ds_str->str, search_str);
3282+
size_t prefixlen= start - ds_str->str;
32803283
if (!start)
32813284
return 1;
32823285
init_dynamic_string(&ds_tmp, "",
32833286
ds_str->length + replace_len, 256);
3284-
dynstr_append_mem(&ds_tmp, ds_str->str, start - ds_str->str);
3287+
dynstr_append_mem(&ds_tmp, ds_str->str, prefixlen);
32853288
dynstr_append_mem(&ds_tmp, replace_str, replace_len);
3286-
dynstr_append(&ds_tmp, start + search_len);
3289+
dynstr_append_mem(&ds_tmp, start + search_len,
3290+
ds_str->length - prefixlen - search_len);
32873291
dynstr_set(ds_str, ds_tmp.str);
32883292
dynstr_free(&ds_tmp);
32893293
return 0;
@@ -3738,7 +3742,7 @@ void do_remove_files_wildcard(struct st_command *command)
37383742
wild_compare(file->name, ds_wild.str, 0))
37393743
continue;
37403744
ds_file_to_remove.length= directory_length;
3741-
dynstr_append(&ds_file_to_remove, file->name);
3745+
dynstr_append_mem(&ds_file_to_remove, file->name, strlen(file->name));
37423746
DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
37433747
if ((error= (my_delete(ds_file_to_remove.str, MYF(MY_WME)) != 0)))
37443748
sys_errno= my_errno;
@@ -7604,7 +7608,7 @@ void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
76047608
}
76057609
else
76067610
{
7607-
dynstr_append(ds, field->name);
7611+
dynstr_append_mem(ds, field->name, strlen(field->name));
76087612
dynstr_append_mem(ds, "\t", 1);
76097613
replace_dynstr_append_mem(ds, val, len);
76107614
dynstr_append_mem(ds, "\n", 1);
@@ -7776,12 +7780,12 @@ void append_info(DYNAMIC_STRING *ds, ulonglong affected_rows,
77767780
const char *info)
77777781
{
77787782
char buf[40], buff2[21];
7779-
sprintf(buf,"affected rows: %s\n", llstr(affected_rows, buff2));
7780-
dynstr_append(ds, buf);
7783+
size_t len= sprintf(buf,"affected rows: %s\n", llstr(affected_rows, buff2));
7784+
dynstr_append_mem(ds, buf, len);
77817785
if (info)
77827786
{
77837787
dynstr_append_mem(ds, STRING_WITH_LEN("info: "));
7784-
dynstr_append(ds, info);
7788+
dynstr_append_mem(ds, info, strlen(info));
77857789
dynstr_append_mem(ds, STRING_WITH_LEN("\n"));
77867790
}
77877791
}
@@ -7831,7 +7835,8 @@ static void append_session_track_info(DYNAMIC_STRING *ds, MYSQL *mysql)
78317835
dynstr_append_mem(ds, STRING_WITH_LEN("-- "));
78327836
if (type <= SESSION_TRACK_END)
78337837
{
7834-
dynstr_append(ds, trking_info_desc[type]);
7838+
dynstr_append_mem(ds, trking_info_desc[type],
7839+
strlen(trking_info_desc[type]));
78357840
}
78367841
else
78377842
{
@@ -9661,7 +9666,7 @@ void mark_progress(struct st_command* command __attribute__((unused)),
96619666
dynstr_append_mem(&ds_progress, "\t", 1);
96629667

96639668
/* Filename */
9664-
dynstr_append(&ds_progress, cur_file->file_name);
9669+
dynstr_append_mem(&ds_progress, cur_file->file_name, strlen(cur_file->file_name));
96659670
dynstr_append_mem(&ds_progress, ":", 1);
96669671

96679672
/* Line in file */
@@ -11944,7 +11949,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input,
1194411949
for (i= 0; i < lines.elements ; i++)
1194511950
{
1194611951
const char **line= dynamic_element(&lines, i, const char**);
11947-
dynstr_append(ds, *line);
11952+
dynstr_append_mem(ds, *line, strlen(*line));
1194811953
dynstr_append_mem(ds, STRING_WITH_LEN("\n"));
1194911954
}
1195011955

extra/mariabackup/xtrabackup.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,8 +1620,11 @@ struct my_option xb_server_options[] =
16201620
"Path to InnoDB log files.", &srv_log_group_home_dir,
16211621
&srv_log_group_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
16221622
{"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT,
1623-
"Percentage of dirty pages allowed in bufferpool.", (G_PTR*) &srv_max_buf_pool_modified_pct,
1624-
(G_PTR*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0},
1623+
"Percentage of dirty pages allowed in bufferpool.",
1624+
(G_PTR*) &srv_max_buf_pool_modified_pct,
1625+
(G_PTR*) &srv_max_buf_pool_modified_pct, 0, GET_DOUBLE, REQUIRED_ARG,
1626+
(longlong)getopt_double2ulonglong(90), (longlong)getopt_double2ulonglong(0),
1627+
getopt_double2ulonglong(100), 0, 0, 0},
16251628
{"innodb_use_native_aio", OPT_INNODB_USE_NATIVE_AIO,
16261629
"Use native AIO if supported on this platform.",
16271630
(G_PTR*) &srv_use_native_aio,

extra/my_print_defaults.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ int main(int argc, char **argv)
205205
if ((error= load_defaults(config_file, (const char **) load_default_groups,
206206
&count, &arguments)))
207207
{
208+
my_free(load_default_groups);
208209
my_end(0);
209210
if (error == 4)
210211
return 0;

mysql-test/main/derived_split_innodb.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,4 +833,19 @@ SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v);
833833
a b
834834
DROP VIEW v;
835835
DROP TABLE t1, t2, t3;
836+
#
837+
# MDEV-31279 Crash when lateral derived is guaranteed to return no rows
838+
#
839+
CREATE TABLE t1 (a CHAR(1)) ENGINE=MyISAM;
840+
INSERT INTO t1 VALUES ('1'),('2');
841+
CREATE TABLE t2 (b INT, KEY(b)) ENGINE=MyISAM;
842+
ALTER TABLE t2 DISABLE KEYS;
843+
INSERT INTO t2 VALUES (1),(2),(3);
844+
ALTER TABLE t2 ENABLE KEYS;
845+
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
846+
INSERT INTO t3 (c) SELECT seq FROM seq_1_to_101;
847+
SELECT * FROM t1 WHERE t1.a IN (SELECT b FROM
848+
(SELECT t2.b FROM t2 WHERE NOT EXISTS (SELECT 1 FROM t3) GROUP BY b) sq);
849+
a
850+
DROP TABLE t1, t2, t3;
836851
# End of 10.4 tests

mysql-test/main/derived_split_innodb.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,4 +485,22 @@ SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v);
485485
DROP VIEW v;
486486
DROP TABLE t1, t2, t3;
487487

488+
--echo #
489+
--echo # MDEV-31279 Crash when lateral derived is guaranteed to return no rows
490+
--echo #
491+
492+
CREATE TABLE t1 (a CHAR(1)) ENGINE=MyISAM;
493+
INSERT INTO t1 VALUES ('1'),('2');
494+
CREATE TABLE t2 (b INT, KEY(b)) ENGINE=MyISAM;
495+
ALTER TABLE t2 DISABLE KEYS;
496+
INSERT INTO t2 VALUES (1),(2),(3);
497+
ALTER TABLE t2 ENABLE KEYS;
498+
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
499+
INSERT INTO t3 (c) SELECT seq FROM seq_1_to_101;
500+
501+
SELECT * FROM t1 WHERE t1.a IN (SELECT b FROM
502+
(SELECT t2.b FROM t2 WHERE NOT EXISTS (SELECT 1 FROM t3) GROUP BY b) sq);
503+
504+
DROP TABLE t1, t2, t3;
505+
488506
--echo # End of 10.4 tests

mysql-test/main/mysql_upgrade.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,14 @@ test
10581058
Phase 7/7: Running 'FLUSH PRIVILEGES'
10591059
OK
10601060
set global sql_safe_updates=@orig_sql_safe_updates;
1061+
#
1062+
# MDEV-32043 Remove plugins previously external that are now built in (unix_socket)
1063+
#
1064+
INSERT INTO mysql.plugin SELECT 'unix_socket', 'auth_socket.so'
1065+
FROM dual WHERE convert(@@version_compile_os using latin1) not in ('Win32', 'Win64', 'Windows');
1066+
# mariadb-upgrade --force --silent 2>&1
1067+
SELECT * FROM mysql.plugin WHERE name='unix_socket';
1068+
name dl
10611069
# End of 10.4 tests
10621070
#
10631071
# Check that mysql_upgrade can be run on mysqldump

mysql-test/main/mysql_upgrade.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,17 @@ set global sql_safe_updates=ON;
495495
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
496496
set global sql_safe_updates=@orig_sql_safe_updates;
497497

498+
--echo #
499+
--echo # MDEV-32043 Remove plugins previously external that are now built in (unix_socket)
500+
--echo #
501+
502+
INSERT INTO mysql.plugin SELECT 'unix_socket', 'auth_socket.so'
503+
FROM dual WHERE convert(@@version_compile_os using latin1) not in ('Win32', 'Win64', 'Windows');
504+
--echo # mariadb-upgrade --force --silent 2>&1
505+
--exec $MYSQL_UPGRADE --force --silent 2>&1
506+
SELECT * FROM mysql.plugin WHERE name='unix_socket';
507+
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
508+
498509
--echo # End of 10.4 tests
499510

500511
#

mysql-test/main/ps.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5801,5 +5801,15 @@ END;
58015801
$
58025802
ERROR 42000: EXECUTE..USING does not support subqueries or stored functions
58035803
#
5804+
# MDEV-32965: Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_sp_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed
5805+
#
5806+
CREATE TABLE t (f VARCHAR(8)) CHARACTER SET utf8;
5807+
INSERT INTO t VALUES ('foo'),('bar');
5808+
EXECUTE IMMEDIATE 'SELECT GROUP_CONCAT(@x) FROM t GROUP BY @x := f';
5809+
GROUP_CONCAT(@x)
5810+
0
5811+
0
5812+
DROP TABLE t;
5813+
#
58045814
# End of 10.4 tests
58055815
#

mysql-test/main/ps.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5231,6 +5231,18 @@ $
52315231

52325232
delimiter ;$
52335233

5234+
--echo #
5235+
--echo # MDEV-32965: Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_sp_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed
5236+
--echo #
5237+
CREATE TABLE t (f VARCHAR(8)) CHARACTER SET utf8;
5238+
5239+
INSERT INTO t VALUES ('foo'),('bar');
5240+
EXECUTE IMMEDIATE 'SELECT GROUP_CONCAT(@x) FROM t GROUP BY @x := f';
5241+
5242+
# Cleanup
5243+
5244+
DROP TABLE t;
5245+
52345246
--echo #
52355247
--echo # End of 10.4 tests
52365248
--echo #

mysql-test/std_data/mysql80/t2.cfg

637 Bytes
Binary file not shown.

mysql-test/std_data/mysql80/t2.ibd

112 KB
Binary file not shown.
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
SELECT variable_value into @old_encrypted FROM information_schema.global_status
1+
SELECT CAST(variable_value AS INT) INTO @old_encrypted
2+
FROM information_schema.global_status
23
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
3-
SELECT variable_value into @old_decrypted FROM information_schema.global_status
4+
SELECT CAST(variable_value AS INT) INTO @old_decrypted
5+
FROM information_schema.global_status
46
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted';
57
CREATE TEMPORARY TABLE t1(f1 CHAR(200), f2 CHAR(200)) ENGINE=InnoDB;
68
INSERT INTO t1 (f1,f2) SELECT '', '' FROM seq_1_to_8192;
@@ -12,11 +14,13 @@ COUNT(*)
1214
SELECT COUNT(*) FROM t2;
1315
COUNT(*)
1416
8192
15-
SELECT variable_value > @old_encrypted FROM information_schema.global_status
17+
SELECT CAST(variable_value AS INT) > @old_encrypted
18+
FROM information_schema.global_status
1619
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
17-
variable_value > @old_encrypted
20+
CAST(variable_value AS INT) > @old_encrypted
1821
1
19-
SELECT variable_value > @old_decrypted FROM information_schema.global_status
22+
SELECT CAST(variable_value AS INT) > @old_decrypted
23+
FROM information_schema.global_status
2024
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted';
21-
variable_value > @old_decrypted
25+
CAST(variable_value AS INT) > @old_decrypted
2226
1

0 commit comments

Comments
 (0)