Skip to content

Commit db4a27a

Browse files
committed
Merge 10.3 into 10.4
2 parents d1ef02e + 396da1a commit db4a27a

File tree

103 files changed

+2673
-631
lines changed

Some content is hidden

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

103 files changed

+2673
-631
lines changed

cmake/build_configurations/mysql_release.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ ENDIF()
124124

125125
IF(UNIX)
126126
SET(WITH_EXTRA_CHARSETS all CACHE STRING "")
127+
SET(PLUGIN_AUTH_PAM YES)
127128

128129
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
129130
IF(NOT IGNORE_AIO_CHECK)

cmake/cpack_rpm.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ IF(CMAKE_VERSION VERSION_LESS "3.6.0")
3737
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
3838
ELSE()
3939
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
40-
SET(CPACK_RPM_DEBUGINFO_PACKAGE ON CACHE INTERNAL "")
40+
OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON)
41+
MARK_AS_ADVANCED(CPACK_RPM_DEBUGINFO_PACKAGE)
4142
ENDIF()
4243

4344
SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")

include/my_dbug.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
2-
Copyright (C) 2000, 2017, MariaDB Corporation Ab
2+
Copyright (C) 2000, 2019, MariaDB Corporation.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@ struct _db_stack_frame_ {
3535
};
3636

3737
struct _db_code_state_;
38+
extern MYSQL_PLUGIN_IMPORT my_bool my_assert;
3839
extern my_bool _dbug_on_;
3940
extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
4041
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
@@ -103,7 +104,10 @@ extern int (*dbug_sanity)(void);
103104
#define DBUG_END() _db_end_ ()
104105
#define DBUG_LOCK_FILE _db_lock_file_()
105106
#define DBUG_UNLOCK_FILE _db_unlock_file_()
106-
#define DBUG_ASSERT(A) do { if (!(A)) { _db_flush_(); assert(A); }} while (0)
107+
#define DBUG_ASSERT(A) do { if (!(A)) { _db_flush_(); \
108+
if (my_assert) assert(A); \
109+
else fprintf(stderr, "%s:%d: assert: %s\n", __FILE__, __LINE__, #A); \
110+
}} while (0)
107111
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
108112
#define DBUG_ASSERT_EXISTS
109113
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))

include/my_global.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
3-
Copyright (c) 2009, 2017, MariaDB Corporation
3+
Copyright (c) 2009, 2019, MariaDB Corporation.
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -1037,6 +1037,19 @@ typedef ulong myf; /* Type of MyFlags in my_funcs */
10371037
#define reg16 register
10381038
#endif
10391039

1040+
/*
1041+
MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
1042+
(i.e variables) for usage in storage engine loadable plugins.
1043+
Outside of Windows, it is dummy.
1044+
*/
1045+
#ifndef MYSQL_PLUGIN_IMPORT
1046+
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
1047+
#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
1048+
#else
1049+
#define MYSQL_PLUGIN_IMPORT
1050+
#endif
1051+
#endif
1052+
10401053
#include <my_dbug.h>
10411054

10421055
/* Some helper macros */
@@ -1163,19 +1176,6 @@ typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
11631176
#endif
11641177
#endif /* !defined(__func__) */
11651178

1166-
/*
1167-
MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
1168-
(i.e variables) for usage in storage engine loadable plugins.
1169-
Outside of Windows, it is dummy.
1170-
*/
1171-
#ifndef MYSQL_PLUGIN_IMPORT
1172-
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
1173-
#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
1174-
#else
1175-
#define MYSQL_PLUGIN_IMPORT
1176-
#endif
1177-
#endif
1178-
11791179
/* Defines that are unique to the embedded version of MySQL */
11801180

11811181
#ifdef EMBEDDED_LIBRARY

include/my_sys.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
2-
Copyright (c) 2010, 2017, MariaDB Corporation.
2+
Copyright (c) 2010, 2019, MariaDB Corporation.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -266,6 +266,7 @@ extern ulong my_sync_count;
266266
extern uint mysys_usage_id;
267267
extern int32 my_file_opened;
268268
extern my_bool my_init_done, my_thr_key_mysys_exists;
269+
extern MYSQL_PLUGIN_IMPORT my_bool my_assert;
269270
extern my_bool my_assert_on_error;
270271
extern myf my_global_flags; /* Set to MY_WME for more error messages */
271272
/* Point to current my_message() */

mysql-test/lib/My/Handles.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ if (IS_WINDOWS){
3232
my $list= `handle.exe -? -accepteula 2>&1`;
3333
foreach my $line (split('\n', $list))
3434
{
35-
$handle_exe= "$1.$2"
36-
if ($line =~ /Handle v([0-9]*)\.([0-9]*)/);
35+
$handle_exe= "$2.$3"
36+
if ($line =~ /(Nth|H)andle v([0-9]*)\.([0-9]*)/);
3737
}
3838
if ($handle_exe){
3939
print "Found handle.exe version $handle_exe\n";

mysql-test/main/analyze_stmt_privileges2.result

Lines changed: 71 additions & 71 deletions
Large diffs are not rendered by default.

mysql-test/main/constraints.result

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,61 @@ t CREATE TABLE `t` (
129129
) ENGINE=MyISAM DEFAULT CHARSET=latin1
130130
DROP table test.t;
131131
SET @@SQL_MODE=@OLD_SQL_MODE;
132+
#
133+
# MDEV-16932 - ASAN heap-use-after-free in my_charlen_utf8 /
134+
# my_well_formed_char_length_utf8 on 2nd execution of SP with
135+
# ALTER trying to add bad CHECK
136+
#
137+
CREATE TABLE t1 (a INT);
138+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
139+
CALL sp;
140+
ERROR 42S22: Unknown column 'b' in 'CHECK'
141+
CALL sp;
142+
ERROR 42S22: Unknown column 'b' in 'CHECK'
143+
CALL sp;
144+
ERROR 42S22: Unknown column 'b' in 'CHECK'
145+
show create table t1;
146+
Table Create Table
147+
t1 CREATE TABLE `t1` (
148+
`a` int(11) DEFAULT NULL
149+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
150+
alter table t1 add column b int;
151+
CALL sp;
152+
show create table t1;
153+
Table Create Table
154+
t1 CREATE TABLE `t1` (
155+
`a` int(11) DEFAULT NULL,
156+
`b` int(11) DEFAULT NULL,
157+
CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0)
158+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
159+
CALL sp;
160+
show create table t1;
161+
Table Create Table
162+
t1 CREATE TABLE `t1` (
163+
`a` int(11) DEFAULT NULL,
164+
`b` int(11) DEFAULT NULL,
165+
CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0),
166+
CONSTRAINT `CONSTRAINT_2` CHECK (`b` > 0)
167+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
168+
DROP PROCEDURE sp;
169+
DROP TABLE t1;
170+
CREATE TABLE t1 (a INT);
171+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
172+
CALL sp;
173+
ERROR 42S22: Unknown column 'b' in 'CHECK'
174+
alter table t1 add column b int, add constraint check (b < 10);
175+
CALL sp;
176+
show create table t1;
177+
Table Create Table
178+
t1 CREATE TABLE `t1` (
179+
`a` int(11) DEFAULT NULL,
180+
`b` int(11) DEFAULT NULL,
181+
CONSTRAINT `CONSTRAINT_1` CHECK (`b` < 10),
182+
CONSTRAINT `CONSTRAINT_2` CHECK (`b` > 0)
183+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
184+
DROP PROCEDURE sp;
185+
DROP TABLE t1;
186+
# End of 10.2 tests
132187
create table t1 (a int check (a>10)) select 100 as 'a';
133188
show create table t1;
134189
Table Create Table

mysql-test/main/constraints.test

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,43 @@ SHOW CREATE TABLE t;
116116
DROP table test.t;
117117
SET @@SQL_MODE=@OLD_SQL_MODE;
118118

119+
--echo #
120+
--echo # MDEV-16932 - ASAN heap-use-after-free in my_charlen_utf8 /
121+
--echo # my_well_formed_char_length_utf8 on 2nd execution of SP with
122+
--echo # ALTER trying to add bad CHECK
123+
--echo #
124+
125+
CREATE TABLE t1 (a INT);
126+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
127+
--error ER_BAD_FIELD_ERROR
128+
CALL sp;
129+
--error ER_BAD_FIELD_ERROR
130+
CALL sp;
131+
--error ER_BAD_FIELD_ERROR
132+
CALL sp;
133+
show create table t1;
134+
alter table t1 add column b int;
135+
CALL sp;
136+
show create table t1;
137+
CALL sp;
138+
show create table t1;
139+
# Cleanup
140+
DROP PROCEDURE sp;
141+
DROP TABLE t1;
142+
143+
CREATE TABLE t1 (a INT);
144+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
145+
--error ER_BAD_FIELD_ERROR
146+
CALL sp;
147+
alter table t1 add column b int, add constraint check (b < 10);
148+
CALL sp;
149+
show create table t1;
150+
# Cleanup
151+
DROP PROCEDURE sp;
152+
DROP TABLE t1;
153+
154+
--echo # End of 10.2 tests
155+
119156
#
120157
# Check that we don't lose constraints as part of CREATE ... SELECT
121158
#

mysql-test/main/cte_nonrecursive.result

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,9 +1159,9 @@ with cte as
11591159
union
11601160
(select a from t1 where a < 2);
11611161
a
1162-
7
1163-
5
11641162
4
1163+
5
1164+
7
11651165
1
11661166
prepare stmt from "with cte as
11671167
(select a from t1 where a between 4 and 7 group by a)
@@ -1170,15 +1170,15 @@ union
11701170
(select a from t1 where a < 2)";
11711171
execute stmt;
11721172
a
1173-
7
1174-
5
11751173
4
1174+
5
1175+
7
11761176
1
11771177
execute stmt;
11781178
a
1179-
7
1180-
5
11811179
4
1180+
5
1181+
7
11821182
1
11831183
deallocate prepare stmt;
11841184
with cte as
@@ -1188,9 +1188,9 @@ union
11881188
(select a from cte where exists( select a from t1 where cte.a=t1.a ));
11891189
a
11901190
1
1191-
7
1192-
5
11931191
4
1192+
5
1193+
7
11941194
prepare stmt from "with cte as
11951195
(select a from t1 where a between 4 and 7 group by a)
11961196
(select a from t1 where a < 2)
@@ -1199,15 +1199,15 @@ union
11991199
execute stmt;
12001200
a
12011201
1
1202-
7
1203-
5
12041202
4
1203+
5
1204+
7
12051205
execute stmt;
12061206
a
12071207
1
1208-
7
1209-
5
12101208
4
1209+
5
1210+
7
12111211
deallocate prepare stmt;
12121212
with cte as
12131213
(select a from t1 where a between 4 and 7)

0 commit comments

Comments
 (0)