Skip to content

Commit a736a31

Browse files
committed
Merge 10.3 into 10.4
2 parents b44e12f + 4a7dfda commit a736a31

Some content is hidden

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

54 files changed

+754
-121
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ x86/
373373
build/
374374
bld/
375375
[Bb]in/
376+
/cmake-build-debug/
376377
[Oo]bj/
377378

378379
# Roslyn cache directories
@@ -555,7 +556,7 @@ compile_commands.json
555556
.vscode/
556557

557558
# Clion && other JetBrains ides
558-
.idea
559+
/.idea/
559560

560561
.cache/clangd
561562

client/mysql.cc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,11 +1672,14 @@ static struct my_option my_long_options[] =
16721672
&opt_default_auth, &opt_default_auth, 0,
16731673
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
16741674
{"binary-mode", 0,
1675-
"By default, ASCII '\\0' is disallowed and '\\r\\n' is translated to '\\n'. "
1676-
"This switch turns off both features, and also turns off parsing of all client"
1677-
"commands except \\C and DELIMITER, in non-interactive mode (for input "
1678-
"piped to mysql or loaded using the 'source' command). This is necessary "
1679-
"when processing output from mysqlbinlog that may contain blobs.",
1675+
"Binary mode allows certain character sequences to be processed as data "
1676+
"that would otherwise be treated with a special meaning by the parser. "
1677+
"Specifically, this switch turns off parsing of all client commands except "
1678+
"\\C and DELIMITER in non-interactive mode (i.e., when binary mode is "
1679+
"combined with either 1) piped input, 2) the --batch mysql option, or 3) "
1680+
"the 'source' command). Also, in binary mode, occurrences of '\\r\\n' and "
1681+
"ASCII '\\0' are preserved within strings, whereas by default, '\\r\\n' is "
1682+
"translated to '\\n' and '\\0' is disallowed in user input.",
16801683
&opt_binary_mode, &opt_binary_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
16811684
{"connect-expired-password", 0,
16821685
"Notify the server that this client is prepared to handle expired "
@@ -2316,8 +2319,15 @@ static bool add_line(String &buffer, char *line, size_t line_length,
23162319
{
23172320
// Found possbile one character command like \c
23182321

2319-
if (!(inchar = (uchar) *++pos))
2320-
break; // readline adds one '\'
2322+
/*
2323+
The null-terminating character (ASCII '\0') marks the end of user
2324+
input. Then, by default, upon encountering a '\0' while parsing, it
2325+
should stop. However, some data naturally contains binary zeros
2326+
(e.g., zipped files). Real_binary_mode signals the parser to expect
2327+
'\0' within the data and not to end parsing if found.
2328+
*/
2329+
if (!(inchar = (uchar) *++pos) && (!real_binary_mode || !*in_string))
2330+
break; // readline adds one '\'
23212331
if (*in_string || inchar == 'N') // \N is short for NULL
23222332
{ // Don't allow commands in string
23232333
*out++='\\';

include/ft_global.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ void ft_free_stopwords(void);
9090

9191
FT_INFO *ft_init_search(uint,void *, uint, uchar *, size_t,
9292
CHARSET_INFO *, uchar *);
93-
my_bool ft_boolean_check_syntax_string(const uchar *);
93+
my_bool ft_boolean_check_syntax_string(const uchar *, size_t length,
94+
CHARSET_INFO *cs);
9495

9596
/* Internal symbols for fulltext between maria and MyISAM */
9697

include/my_context.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ struct my_context {
5252

5353

5454
#ifdef MY_CONTEXT_USE_UCONTEXT
55+
#if defined(__APPLE__) && !defined(_XOPEN_SOURCE)
56+
#define _XOPEN_SOURCE
57+
#endif
5558
#include <ucontext.h>
5659

5760
struct my_context {

include/my_global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
# if defined(__i386__) || defined(__ppc__)
160160
# define SIZEOF_CHARP 4
161161
# define SIZEOF_LONG 4
162-
# elif defined(__x86_64__) || defined(__ppc64__)
162+
# elif defined(__x86_64__) || defined(__ppc64__) || defined(__aarch64__)
163163
# define SIZEOF_CHARP 8
164164
# define SIZEOF_LONG 8
165165
# else

include/mysql_com.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ enum enum_indicator_type
193193
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3U << FIELD_FLAGS_COLUMN_FORMAT)
194194
#define FIELD_IS_DROPPED (1U << 26) /* Intern: Field is being dropped */
195195

196-
#define VERS_SYS_START_FLAG (1 << 27) /* autogenerated column declared with
196+
#define VERS_ROW_START (1 << 27) /* autogenerated column declared with
197197
`generated always as row start`
198198
(see II.a SQL Standard) */
199-
#define VERS_SYS_END_FLAG (1 << 28) /* autogenerated column declared with
199+
#define VERS_ROW_END (1 << 28) /* autogenerated column declared with
200200
`generated always as row end`
201201
(see II.a SQL Standard).*/
202-
#define VERS_SYSTEM_FIELD (VERS_SYS_START_FLAG | VERS_SYS_END_FLAG)
202+
#define VERS_SYSTEM_FIELD (VERS_ROW_START | VERS_ROW_END)
203203
#define VERS_UPDATE_UNVERSIONED_FLAG (1 << 29) /* column that doesn't support
204204
system versioning when table
205205
itself supports it*/

man/mysql.1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,14 @@ option\&.
206206
.\" binary-mode option: mysql
207207
\fB\-\-binary\-mode\fR
208208
.sp
209-
By default, ASCII '\e0' is disallowed and '\er\en' is translated to '\en'\&. This switch turns off both features, and also turns off parsing of all client commands except \eC and DELIMITER, in non-interactive mode (for input piped to mysql or loaded using the 'source' command)\&. This is necessary when processing output from mysqlbinlog that may contain blobs\&.
209+
Binary mode allows certain character sequences to be processed as data that
210+
would otherwise be treated with a special meaning by the parser\&.
211+
Specifically, this switch turns off parsing of all client commands except \eC
212+
and DELIMITER in non-interactive mode (i\&.e\&., when binary mode is combined
213+
with either 1) piped input, 2) the --batch mysql option, or 3) the 'source'
214+
command)\&. Also, in binary mode, occurrences of '\er\en' and ASCII '\e0' are
215+
preserved within strings, whereas by default, '\er\en' is translated to '\en'
216+
and '\e0' is disallowed in user input\&.
210217
.RE
211218
.sp
212219
.RS 4

mysql-test/main/ctype_utf16_def.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ character_set_server utf16
88
SHOW VARIABLES LIKE 'ft_stopword_file';
99
Variable_name Value
1010
ft_stopword_file (built-in)
11+
#
12+
# MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax
13+
#
14+
SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
15+
SET GLOBAL ft_boolean_syntax=DEFAULT;

mysql-test/main/ctype_utf16_def.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ call mtr.add_suppression("'utf16' can not be used as client character set");
77
SHOW VARIABLES LIKE 'collation_server';
88
SHOW VARIABLES LIKE 'character_set_server';
99
SHOW VARIABLES LIKE 'ft_stopword_file';
10+
11+
--echo #
12+
--echo # MDEV-23269 SIGSEGV in ft_boolean_check_syntax_string on setting ft_boolean_syntax
13+
--echo #
14+
15+
SET GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
16+
SET GLOBAL ft_boolean_syntax=DEFAULT;

mysql-test/main/ctype_utf32_def.opt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--character-set-server=utf32,latin1 --collation-server=utf32_general_ci

0 commit comments

Comments
 (0)