mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
Merge branch '10.6' into 10.11
This commit is contained in:
@@ -207,7 +207,7 @@ static char TMPDIR[FN_REFLEN];
|
||||
static char global_subst_from[200];
|
||||
static char global_subst_to[200];
|
||||
static char *global_subst= NULL;
|
||||
static char *read_command_buf= NULL;
|
||||
static char *read_command_buf= NULL, *read_command_buf_end;
|
||||
static MEM_ROOT require_file_root;
|
||||
static const my_bool my_true= 1;
|
||||
static const my_bool my_false= 0;
|
||||
@@ -3866,9 +3866,24 @@ end:
|
||||
#endif
|
||||
if (error)
|
||||
{
|
||||
uint status= WEXITSTATUS(error);
|
||||
uint status;
|
||||
int i;
|
||||
|
||||
#ifdef _WIN32
|
||||
status= WEXITSTATUS(error);
|
||||
#else
|
||||
/* WEXITSTATUS() is only valid for a normal exit; a process killed by an
|
||||
uncaught signal must be translated using the shell's 128+signal
|
||||
convention, or the real error is silently lost as status 0. */
|
||||
if (WIFEXITED(error))
|
||||
status= WEXITSTATUS(error);
|
||||
else if (WIFSIGNALED(error))
|
||||
status= 128 + WTERMSIG(error);
|
||||
else
|
||||
status= error;
|
||||
|
||||
#endif
|
||||
|
||||
if (command->abort_on_error)
|
||||
{
|
||||
report_or_die("exec of '%s' failed, error: %d, status: %d, errno: %d\n"
|
||||
@@ -5602,7 +5617,7 @@ static void primary(Expression_value *result, const char **s)
|
||||
enum func_type func_type= get_expr_function_type(start,
|
||||
end - start);
|
||||
if (func_type == FUNC_UNKNOWN)
|
||||
die("Syntax error: Unknown function");
|
||||
die("Syntax error: Unknown function '%.*s'", (int) (end - start), start);
|
||||
|
||||
*s= end + 1; // skip '('
|
||||
handle_expr_function_call(func_type, result, s);
|
||||
@@ -6049,47 +6064,48 @@ static void expr(Expression_value *result, const char **s)
|
||||
|
||||
static struct {
|
||||
const char *name;
|
||||
size_t length;
|
||||
enum func_type type;
|
||||
} function_table[]= {
|
||||
// Numeric functions
|
||||
{"abs", FUNC_ABS},
|
||||
{"bin", FUNC_BIN},
|
||||
{"conv", FUNC_CONV},
|
||||
{"hex", FUNC_HEX},
|
||||
{"oct", FUNC_OCT},
|
||||
{STRING_WITH_LEN("abs"), FUNC_ABS},
|
||||
{STRING_WITH_LEN("bin"), FUNC_BIN},
|
||||
{STRING_WITH_LEN("conv"), FUNC_CONV},
|
||||
{STRING_WITH_LEN("hex"), FUNC_HEX},
|
||||
{STRING_WITH_LEN("oct"), FUNC_OCT},
|
||||
// String functions
|
||||
{"concat", FUNC_CONCAT},
|
||||
{"concat_ws", FUNC_CONCAT_WS},
|
||||
{"greatest", FUNC_GREATEST},
|
||||
{"insert", FUNC_INSERT},
|
||||
{"instr", FUNC_INSTR},
|
||||
{"lcase", FUNC_LOWER},
|
||||
{"least", FUNC_LEAST},
|
||||
{"length", FUNC_LENGTH},
|
||||
{"locate", FUNC_LOCATE},
|
||||
{"lower", FUNC_LOWER},
|
||||
{"lpad", FUNC_LPAD},
|
||||
{"ltrim", FUNC_LTRIM},
|
||||
{"repeat", FUNC_REPEAT},
|
||||
{"replace", FUNC_REPLACE},
|
||||
{"reverse", FUNC_REVERSE},
|
||||
{"rpad", FUNC_RPAD},
|
||||
{"rtrim", FUNC_RTRIM},
|
||||
{"substr", FUNC_SUBSTR},
|
||||
{"substring", FUNC_SUBSTR},
|
||||
{"substring_index", FUNC_SUBSTR_IDX},
|
||||
{"trim", FUNC_TRIM},
|
||||
{"ucase", FUNC_UPPER},
|
||||
{"upper", FUNC_UPPER},
|
||||
{STRING_WITH_LEN("concat"), FUNC_CONCAT},
|
||||
{STRING_WITH_LEN("concat_ws"), FUNC_CONCAT_WS},
|
||||
{STRING_WITH_LEN("greatest"), FUNC_GREATEST},
|
||||
{STRING_WITH_LEN("insert"), FUNC_INSERT},
|
||||
{STRING_WITH_LEN("instr"), FUNC_INSTR},
|
||||
{STRING_WITH_LEN("lcase"), FUNC_LOWER},
|
||||
{STRING_WITH_LEN("least"), FUNC_LEAST},
|
||||
{STRING_WITH_LEN("length"), FUNC_LENGTH},
|
||||
{STRING_WITH_LEN("locate"), FUNC_LOCATE},
|
||||
{STRING_WITH_LEN("lower"), FUNC_LOWER},
|
||||
{STRING_WITH_LEN("lpad"), FUNC_LPAD},
|
||||
{STRING_WITH_LEN("ltrim"), FUNC_LTRIM},
|
||||
{STRING_WITH_LEN("repeat"), FUNC_REPEAT},
|
||||
{STRING_WITH_LEN("replace"), FUNC_REPLACE},
|
||||
{STRING_WITH_LEN("reverse"), FUNC_REVERSE},
|
||||
{STRING_WITH_LEN("rpad"), FUNC_RPAD},
|
||||
{STRING_WITH_LEN("rtrim"), FUNC_RTRIM},
|
||||
{STRING_WITH_LEN("substr"), FUNC_SUBSTR},
|
||||
{STRING_WITH_LEN("substring"), FUNC_SUBSTR},
|
||||
{STRING_WITH_LEN("substring_index"), FUNC_SUBSTR_IDX},
|
||||
{STRING_WITH_LEN("trim"), FUNC_TRIM},
|
||||
{STRING_WITH_LEN("ucase"), FUNC_UPPER},
|
||||
{STRING_WITH_LEN("upper"), FUNC_UPPER},
|
||||
// Regexp functions
|
||||
{"regexp_instr", FUNC_REGEXP_INSTR},
|
||||
{"regexp_replace", FUNC_REGEXP_REPLACE},
|
||||
{"regexp_substr", FUNC_REGEXP_SUBSTR},
|
||||
{STRING_WITH_LEN("regexp_instr"), FUNC_REGEXP_INSTR},
|
||||
{STRING_WITH_LEN("regexp_replace"), FUNC_REGEXP_REPLACE},
|
||||
{STRING_WITH_LEN("regexp_substr"), FUNC_REGEXP_SUBSTR},
|
||||
// Null functions
|
||||
{"coalesce", FUNC_COALESCE},
|
||||
{"ifnull", FUNC_IFNULL},
|
||||
{"nullif", FUNC_NULLIF},
|
||||
{NULL, FUNC_UNKNOWN}
|
||||
{STRING_WITH_LEN("coalesce"), FUNC_COALESCE},
|
||||
{STRING_WITH_LEN("ifnull"), FUNC_IFNULL},
|
||||
{STRING_WITH_LEN("nullif"), FUNC_NULLIF},
|
||||
{NULL, 0, FUNC_UNKNOWN}
|
||||
};
|
||||
|
||||
|
||||
@@ -6329,9 +6345,9 @@ void func_oct(Expression_value args[], int count, Expression_value *result)
|
||||
@param[out] result Expression_value to store result
|
||||
|
||||
@details
|
||||
Converts a number to hexadecimal representation.
|
||||
HEX(N) returns a string representation of the hexadecimal value of N.
|
||||
This is equivalent to CONV(N, 10, 16).
|
||||
HEX(str) returns a hexadecimal representation of the bytes of str.
|
||||
|
||||
@note Dies if argument count != 1
|
||||
*/
|
||||
@@ -6341,7 +6357,15 @@ void func_hex(Expression_value args[], int count, Expression_value *result)
|
||||
if (count != 1)
|
||||
die("hex() expects 1 argument, got %d", count);
|
||||
|
||||
convert_base_helper(args[0].to_string(), 10, 16, result);
|
||||
if (args[0].is_numeric)
|
||||
convert_base_helper(args[0].to_string(), 10, 16, result);
|
||||
else
|
||||
{
|
||||
My_string str= args[0].to_string();
|
||||
My_string hex_str;
|
||||
hex_str.set_hex(str.ptr(), str.length());
|
||||
result->set_string(hex_str.ptr(), hex_str.length());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7605,7 +7629,8 @@ enum func_type get_expr_function_type(const char *name, size_t len)
|
||||
{
|
||||
for (int i= 0; function_table[i].name; ++i)
|
||||
{
|
||||
if (!strncasecmp(function_table[i].name, name, len))
|
||||
if (function_table[i].length == len &&
|
||||
!strncasecmp(function_table[i].name, name, len))
|
||||
return function_table[i].type;
|
||||
}
|
||||
return FUNC_UNKNOWN;
|
||||
@@ -9687,7 +9712,7 @@ int read_line()
|
||||
*p= 0;
|
||||
DBUG_PRINT("exit", ("Found delimiter '%s' at line %d",
|
||||
delimiter, cur_file->lineno));
|
||||
DBUG_RETURN(0);
|
||||
goto ret;
|
||||
}
|
||||
else if ((c == '{' &&
|
||||
(!my_strnncoll_simple(charset_info, (const uchar*) "while", 5,
|
||||
@@ -9700,7 +9725,7 @@ int read_line()
|
||||
*p= 0;
|
||||
DBUG_PRINT("exit", ("Found '{' indicating start of block at line %d",
|
||||
cur_file->lineno));
|
||||
DBUG_RETURN(0);
|
||||
goto ret;
|
||||
}
|
||||
else if (c == '\'' || c == '"' || c == '`')
|
||||
{
|
||||
@@ -9734,7 +9759,7 @@ int read_line()
|
||||
*p= 0;
|
||||
DBUG_PRINT("exit", ("Found newline in comment at line: %d",
|
||||
cur_file->lineno));
|
||||
DBUG_RETURN(0);
|
||||
goto ret;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -9754,7 +9779,7 @@ int read_line()
|
||||
DBUG_PRINT("info", ("Found two new lines in a row"));
|
||||
*p++= c;
|
||||
*p= 0;
|
||||
DBUG_RETURN(0);
|
||||
goto ret;
|
||||
}
|
||||
|
||||
/* Query hasn't started yet */
|
||||
@@ -9771,7 +9796,7 @@ int read_line()
|
||||
*p= 0;
|
||||
DBUG_PRINT("exit", ("Found delimiter '%s' at line: %d",
|
||||
delimiter, cur_file->lineno));
|
||||
DBUG_RETURN(0);
|
||||
goto ret;
|
||||
}
|
||||
else if (c == '}')
|
||||
{
|
||||
@@ -9780,7 +9805,7 @@ int read_line()
|
||||
*p= 0;
|
||||
DBUG_PRINT("exit", ("Found '}' in beginning of a line at line: %d",
|
||||
cur_file->lineno));
|
||||
DBUG_RETURN(0);
|
||||
goto ret;
|
||||
}
|
||||
else if (c == '\'' || c == '"' || c == '`')
|
||||
{
|
||||
@@ -9839,6 +9864,8 @@ int read_line()
|
||||
}
|
||||
}
|
||||
}
|
||||
ret:
|
||||
read_command_buf_end= p;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@@ -9854,14 +9881,13 @@ int read_line()
|
||||
|
||||
*/
|
||||
|
||||
void convert_to_format_v1(char* query)
|
||||
void convert_to_format_v1(char* query, char **end)
|
||||
{
|
||||
int last_c_was_quote= 0;
|
||||
char *p= query, *to= query;
|
||||
char *end= strend(query);
|
||||
char last_c;
|
||||
|
||||
while (p <= end)
|
||||
while (p <= *end)
|
||||
{
|
||||
if (*p == '\n' && !last_c_was_quote)
|
||||
{
|
||||
@@ -9892,6 +9918,7 @@ void convert_to_format_v1(char* query)
|
||||
last_c_was_quote= 0;
|
||||
}
|
||||
}
|
||||
*end= to;
|
||||
}
|
||||
|
||||
|
||||
@@ -10008,9 +10035,9 @@ int read_command(struct st_command** command_ptr)
|
||||
}
|
||||
|
||||
if (opt_result_format_version == 1)
|
||||
convert_to_format_v1(read_command_buf);
|
||||
convert_to_format_v1(read_command_buf, &read_command_buf_end);
|
||||
|
||||
char *p= read_command_buf;
|
||||
char *p= read_command_buf, *end= read_command_buf_end;
|
||||
DBUG_PRINT("info", ("query: '%s'", read_command_buf));
|
||||
if (*p == '#')
|
||||
{
|
||||
@@ -10027,29 +10054,32 @@ int read_command(struct st_command** command_ptr)
|
||||
}
|
||||
|
||||
/* Skip leading spaces */
|
||||
while (*p && my_isspace(charset_info, *p))
|
||||
while (p < end && my_isspace(charset_info, *p))
|
||||
p++;
|
||||
|
||||
if (!(command->query_buf= command->query= my_strdup(PSI_NOT_INSTRUMENTED, p, MYF(MY_WME))))
|
||||
if (!(command->query_buf= command->query=
|
||||
(char*)my_memdup(PSI_NOT_INSTRUMENTED, p, end - p, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
command->query_len= (int)(end - p - 1);
|
||||
command->end= command->query + command->query_len;
|
||||
p= command->query;
|
||||
end= command->end;
|
||||
/*
|
||||
Calculate first word length(the command), terminated
|
||||
by 'space' , '(' or 'delimiter' */
|
||||
p= command->query;
|
||||
while (*p && !my_isspace(charset_info, *p) && *p != '(' && !is_delimiter(p))
|
||||
by 'space' , '(' or 'delimiter'
|
||||
*/
|
||||
while (p < end && !my_isspace(charset_info, *p) && *p != '(' && !is_delimiter(p))
|
||||
p++;
|
||||
command->first_word_len= (uint) (p - command->query);
|
||||
DBUG_PRINT("info", ("first_word: %.*s",
|
||||
command->first_word_len, command->query));
|
||||
|
||||
/* Skip spaces between command and first argument */
|
||||
while (*p && my_isspace(charset_info, *p))
|
||||
while (p < end && my_isspace(charset_info, *p))
|
||||
p++;
|
||||
command->first_argument= p;
|
||||
|
||||
command->end= strend(command->query);
|
||||
command->query_len= (int)(command->end - command->query);
|
||||
parser.read_lines++;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
@@ -12351,7 +12381,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
||||
else
|
||||
{
|
||||
query = command->query;
|
||||
query_len = strlen(query);
|
||||
query_len = command->query_len;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -12741,6 +12771,7 @@ void get_command_type(struct st_command* command)
|
||||
if (type == Q_QUERY)
|
||||
{
|
||||
/* Skip the "query" part */
|
||||
command->query_len-= (int)(command->first_argument - command->query);
|
||||
command->query= command->first_argument;
|
||||
}
|
||||
}
|
||||
@@ -13312,7 +13343,8 @@ int main(int argc, char **argv)
|
||||
if (command->query == command->query_buf)
|
||||
{
|
||||
/* Skip the first part of command, i.e query_xxx */
|
||||
command->query= command->first_argument;
|
||||
command->query_len-= (int)(command->first_argument - command->query);
|
||||
command->query= command->first_argument;
|
||||
command->first_word_len= 0;
|
||||
}
|
||||
/* fall through */
|
||||
@@ -13374,7 +13406,10 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Remove "send" if this is first iteration */
|
||||
if (command->query == command->query_buf)
|
||||
{
|
||||
command->query_len-= (int)(command->first_argument - command->query);
|
||||
command->query= command->first_argument;
|
||||
}
|
||||
|
||||
/*
|
||||
run_query() can execute a query partially, depending on the flags.
|
||||
|
||||
@@ -248,7 +248,7 @@ IF(WITH_WSREP)
|
||||
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
|
||||
"galera-4" "rsync" "grep" "gawk" "iproute"
|
||||
"coreutils" "findutils" "tar")
|
||||
SETA(CPACK_RPM_server_PACKAGE_RECOMMENDS "lsof" "socat" "pv")
|
||||
SETA(CPACK_RPM_server_PACKAGE_RECOMMENDS "lsof" "socat" "pv" "stunnel")
|
||||
SETA(CPACK_RPM_test_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}" "socat")
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
#
|
||||
# - INSTALL_UNIX_ADDRDIR (path to mysql.sock)
|
||||
#
|
||||
# - INSTALL_RUNDIR (runtime state files that mariadbd must not write,
|
||||
# e.g. what systemd reads as EnvironmentFile)
|
||||
#
|
||||
|
||||
IF(NOT INSTALL_LAYOUT)
|
||||
IF(DEB)
|
||||
@@ -163,7 +166,7 @@ SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock"
|
||||
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
|
||||
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
|
||||
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
|
||||
SET(INSTALL_RUNDATADIR_RPM "/run/mariadb")
|
||||
SET(INSTALL_RUNDIR_RPM "/run")
|
||||
SET(INSTALL_PAMDIR_RPM "/${INSTALL_LIBDIR_RPM}/security")
|
||||
SET(INSTALL_PAMDATADIR_RPM "/etc/security")
|
||||
|
||||
@@ -194,8 +197,8 @@ SET(INSTALL_SUPPORTFILESDIR_DEB "share/mysql")
|
||||
#
|
||||
SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql")
|
||||
|
||||
SET(INSTALL_RUNDATADIR_DEB "/run/mysqld")
|
||||
SET(INSTALL_UNIX_ADDRDIR_DEB "${INSTALL_RUNDATADIR_DEB}/mysqld.sock")
|
||||
SET(INSTALL_RUNDIR_DEB "/run")
|
||||
SET(INSTALL_UNIX_ADDRDIR_DEB "${INSTALL_RUNDIR_DEB}/mysqld/mysqld.sock")
|
||||
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
|
||||
SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB "/usr/lib/sysusers.d")
|
||||
SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB "/usr/lib/tmpfiles.d")
|
||||
@@ -259,7 +262,10 @@ IF(NOT MYSQL_UNIX_ADDR)
|
||||
SET(MYSQL_UNIX_ADDR ${INSTALL_UNIX_ADDRDIR})
|
||||
ENDIF()
|
||||
|
||||
IF(NOT INSTALL_RUNDATADIR)
|
||||
IF(NOT INSTALL_RUNDIR)
|
||||
# No /run in a tarball installation - fall back to the socket directory.
|
||||
# Note that mariadbd can write there, so the isolation that /run gives to
|
||||
# packages (see EnvironmentFile= in mariadb.service) is not achieved.
|
||||
get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
|
||||
SET(INSTALL_RUNDATADIR "${MYSQL_UNIX_DIR}" CACHE FILEPATH "Rundata installation directory" ${FORCE})
|
||||
SET(INSTALL_RUNDIR "${MYSQL_UNIX_DIR}" CACHE FILEPATH "Runtime state directory" ${FORCE})
|
||||
ENDIF()
|
||||
|
||||
3
debian/control
vendored
3
debian/control
vendored
@@ -676,7 +676,8 @@ Architecture: any
|
||||
Suggests: mariadb-test,
|
||||
netcat-openbsd
|
||||
Recommends: libhtml-template-perl,
|
||||
pv
|
||||
pv,
|
||||
stunnel
|
||||
Pre-Depends: adduser (>= 3.40),
|
||||
debconf,
|
||||
mariadb-common (>= ${source:Version})
|
||||
|
||||
Submodule libmariadb updated: 93bb926666...35c41cddb3
@@ -321,4 +321,13 @@ drop table t1;
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
#
|
||||
# MDEV-31808 Server crash upon altering table with NEXTVAL for default under exclusive lock
|
||||
#
|
||||
CREATE SEQUENCE s ENGINE=Aria;
|
||||
CREATE TABLE t (a INT DEFAULT(NEXTVAL(s)), b INT);
|
||||
ALTER TABLE t FORCE, ALGORITHM=COPY, LOCK=EXCLUSIVE;
|
||||
DROP TABLE t;
|
||||
DROP SEQUENCE s;
|
||||
# End of 10.6 tests
|
||||
set @@default_storage_engine= @save_default_engine;
|
||||
|
||||
@@ -260,4 +260,18 @@ drop table t1;
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31808 Server crash upon altering table with NEXTVAL for default under exclusive lock
|
||||
--echo #
|
||||
|
||||
CREATE SEQUENCE s ENGINE=Aria;
|
||||
CREATE TABLE t (a INT DEFAULT(NEXTVAL(s)), b INT);
|
||||
ALTER TABLE t FORCE, ALGORITHM=COPY, LOCK=EXCLUSIVE;
|
||||
|
||||
# Cleanup
|
||||
DROP TABLE t;
|
||||
DROP SEQUENCE s;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
set @@default_storage_engine= @save_default_engine;
|
||||
|
||||
@@ -110,6 +110,8 @@ Warning 4076 Incorrect GeoJSON format - empty 'coordinates' array.
|
||||
SELECT ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }") as exp;
|
||||
exp
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
|
||||
SELECT ST_ASTEXT (ST_GEOMFROMGEOJSON ('{ "type": "GEOMETRYCOLLECTION", "coordinates": [102.0, 0.0]}')) as exp;
|
||||
exp
|
||||
NULL
|
||||
@@ -135,7 +137,126 @@ repeat(']}', 2000)
|
||||
exp
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 1 to function 'st_geomfromgeojson' at position 473
|
||||
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 1 to function 'st_geomfromgeojson' at position 688
|
||||
# Boundary condition: foreign-member nesting at depth 32
|
||||
SET @geom := '{"type":"Point","coordinates":[1,2]}';
|
||||
SET @doc := CONCAT(
|
||||
REPEAT('{"x":', 29),
|
||||
@geom,
|
||||
REPEAT('}', 29)
|
||||
);
|
||||
SELECT ST_ASTEXT( ST_GeomFromGeoJSON(@doc) ) AS expr;
|
||||
expr
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
|
||||
# Foreign-member nesting exceeds depth 32
|
||||
SET @geom := '{"type":"Point","coordinates":[1,2]}';
|
||||
SET @doc := CONCAT(
|
||||
REPEAT('{"x":', 30),
|
||||
@geom,
|
||||
REPEAT('}', 30)
|
||||
);
|
||||
SELECT ST_GeomFromGeoJSON(@doc) AS expr;
|
||||
expr
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 1 to function 'st_geomfromgeojson' at position 181
|
||||
# Deep foreign member attached to otherwise valid GeoJSON
|
||||
SET @foreign := CONCAT(
|
||||
REPEAT('{"x":', 28),
|
||||
'{"leaf":1}',
|
||||
REPEAT('}', 28)
|
||||
);
|
||||
SET @doc := CONCAT(
|
||||
'{"type":"Point","coordinates":[10,20],"foreign":',
|
||||
@foreign,
|
||||
'}'
|
||||
);
|
||||
SELECT ST_ASTEXT(ST_GeomFromGeoJSON(@doc)) AS expr;
|
||||
expr
|
||||
POINT(10 20)
|
||||
# Foreign member exceeds depth limit
|
||||
SET @foreign := CONCAT(
|
||||
REPEAT('{"x":', 29),
|
||||
'{"leaf":1}',
|
||||
REPEAT('}', 29)
|
||||
);
|
||||
SET @doc := CONCAT(
|
||||
'{"type":"Point","coordinates":[10,20],"foreign":',
|
||||
@foreign,
|
||||
'}'
|
||||
);
|
||||
SELECT ST_ASTEXT(ST_GeomFromGeoJSON(@doc)) AS expr;
|
||||
expr
|
||||
POINT(10 20)
|
||||
# GeometryCollection containing 33 valid GeoJSON Point objects
|
||||
SET @point := '{"type":"Point","coordinates":[1,2]}';
|
||||
SET @geoms := CONCAT(
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point
|
||||
);
|
||||
SET @doc := CONCAT(
|
||||
'{"type":"GeometryCollection","geometries":[',
|
||||
@geoms,
|
||||
']}'
|
||||
);
|
||||
SELECT ST_AsText(ST_GeomFromGeoJSON(@doc)) AS expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION(POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2),POINT(1 2))
|
||||
#
|
||||
# MDEV-39981: ST_GEOMFROMGEOJSON returns wrong result with reversed key order
|
||||
#
|
||||
# GeometryCollection: type before geometries (baseline)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type":"GeometryCollection","geometries":[]}')) as expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION EMPTY
|
||||
# GeometryCollection: geometries before type (empty)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[],"type":"GeometryCollection"}')) as expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION EMPTY
|
||||
# GeometryCollection: geometries before type (non-empty)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[{"type":"Point","coordinates":[0,1]}],"type":"GeometryCollection"}')) as expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION(POINT(0 1))
|
||||
# GeometryCollection: multiple geometries before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[{"type":"Point","coordinates":[1,2]},{"type":"Point","coordinates":[3,4]}],"type":"GeometryCollection"}')) as expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION(POINT(1 2),POINT(3 4))
|
||||
# Point: coordinates before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"coordinates":[0,1],"type":"Point"}')) as expr;
|
||||
expr
|
||||
POINT(0 1)
|
||||
# LineString: coordinates before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"coordinates":[[0,0],[1,1],[2,2]],"type":"LineString"}')) as expr;
|
||||
expr
|
||||
LINESTRING(0 0,1 1,2 2)
|
||||
# Polygon: coordinates before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"coordinates":[[[0,0],[1,0],[1,1],[0,1],[0,0]]],"type":"Polygon"}')) as expr;
|
||||
expr
|
||||
POLYGON((0 0,1 0,1 1,0 1,0 0))
|
||||
# FeatureCollection: features before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"features":[{"geometry":{"type":"Point","coordinates":[5,6]},"type":"Feature","properties":{}}],"type":"FeatureCollection"}')) as expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION(POINT(5 6))
|
||||
# Feature: geometry before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometry":{"coordinates":[7,8],"type":"Point"},"type":"Feature","properties":{}}')) as expr;
|
||||
expr
|
||||
POINT(7 8)
|
||||
# Unknown keys interspersed (should be ignored)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"foo":"bar","geometries":[],"type":"GeometryCollection","extra":123}')) as expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION EMPTY
|
||||
# Deeply nested geometries before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[{"geometries":[{"type":"Point","coordinates":[9,10]}],"type":"GeometryCollection"}],"type":"GeometryCollection"}')) as expr;
|
||||
expr
|
||||
GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(9 10)))
|
||||
# End of 10.6 tests
|
||||
#
|
||||
# MDEV-34079: ST_AsGeoJSON returns incorrect value for empty geometry
|
||||
|
||||
@@ -70,6 +70,120 @@ SELECT ST_GeomFromGeoJSON(
|
||||
repeat(']}', 2000)
|
||||
)) as exp;
|
||||
|
||||
--echo # Boundary condition: foreign-member nesting at depth 32
|
||||
SET @geom := '{"type":"Point","coordinates":[1,2]}';
|
||||
|
||||
SET @doc := CONCAT(
|
||||
REPEAT('{"x":', 29),
|
||||
@geom,
|
||||
REPEAT('}', 29)
|
||||
);
|
||||
|
||||
SELECT ST_ASTEXT( ST_GeomFromGeoJSON(@doc) ) AS expr;
|
||||
|
||||
|
||||
--echo # Foreign-member nesting exceeds depth 32
|
||||
SET @geom := '{"type":"Point","coordinates":[1,2]}';
|
||||
|
||||
SET @doc := CONCAT(
|
||||
REPEAT('{"x":', 30),
|
||||
@geom,
|
||||
REPEAT('}', 30)
|
||||
);
|
||||
|
||||
SELECT ST_GeomFromGeoJSON(@doc) AS expr;
|
||||
|
||||
|
||||
--echo # Deep foreign member attached to otherwise valid GeoJSON
|
||||
SET @foreign := CONCAT(
|
||||
REPEAT('{"x":', 28),
|
||||
'{"leaf":1}',
|
||||
REPEAT('}', 28)
|
||||
);
|
||||
|
||||
SET @doc := CONCAT(
|
||||
'{"type":"Point","coordinates":[10,20],"foreign":',
|
||||
@foreign,
|
||||
'}'
|
||||
);
|
||||
|
||||
SELECT ST_ASTEXT(ST_GeomFromGeoJSON(@doc)) AS expr;
|
||||
|
||||
|
||||
--echo # Foreign member exceeds depth limit
|
||||
SET @foreign := CONCAT(
|
||||
REPEAT('{"x":', 29),
|
||||
'{"leaf":1}',
|
||||
REPEAT('}', 29)
|
||||
);
|
||||
|
||||
SET @doc := CONCAT(
|
||||
'{"type":"Point","coordinates":[10,20],"foreign":',
|
||||
@foreign,
|
||||
'}'
|
||||
);
|
||||
|
||||
SELECT ST_ASTEXT(ST_GeomFromGeoJSON(@doc)) AS expr;
|
||||
|
||||
--echo # GeometryCollection containing 33 valid GeoJSON Point objects
|
||||
SET @point := '{"type":"Point","coordinates":[1,2]}';
|
||||
|
||||
SET @geoms := CONCAT(
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point, ',', @point, ',', @point, ',',
|
||||
@point, ',', @point, ',', @point
|
||||
);
|
||||
|
||||
SET @doc := CONCAT(
|
||||
'{"type":"GeometryCollection","geometries":[',
|
||||
@geoms,
|
||||
']}'
|
||||
);
|
||||
|
||||
SELECT ST_AsText(ST_GeomFromGeoJSON(@doc)) AS expr;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-39981: ST_GEOMFROMGEOJSON returns wrong result with reversed key order
|
||||
--echo #
|
||||
|
||||
--echo # GeometryCollection: type before geometries (baseline)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type":"GeometryCollection","geometries":[]}')) as expr;
|
||||
|
||||
--echo # GeometryCollection: geometries before type (empty)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[],"type":"GeometryCollection"}')) as expr;
|
||||
|
||||
--echo # GeometryCollection: geometries before type (non-empty)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[{"type":"Point","coordinates":[0,1]}],"type":"GeometryCollection"}')) as expr;
|
||||
|
||||
--echo # GeometryCollection: multiple geometries before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[{"type":"Point","coordinates":[1,2]},{"type":"Point","coordinates":[3,4]}],"type":"GeometryCollection"}')) as expr;
|
||||
|
||||
--echo # Point: coordinates before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"coordinates":[0,1],"type":"Point"}')) as expr;
|
||||
|
||||
--echo # LineString: coordinates before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"coordinates":[[0,0],[1,1],[2,2]],"type":"LineString"}')) as expr;
|
||||
|
||||
--echo # Polygon: coordinates before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"coordinates":[[[0,0],[1,0],[1,1],[0,1],[0,0]]],"type":"Polygon"}')) as expr;
|
||||
|
||||
--echo # FeatureCollection: features before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"features":[{"geometry":{"type":"Point","coordinates":[5,6]},"type":"Feature","properties":{}}],"type":"FeatureCollection"}')) as expr;
|
||||
|
||||
--echo # Feature: geometry before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometry":{"coordinates":[7,8],"type":"Point"},"type":"Feature","properties":{}}')) as expr;
|
||||
|
||||
--echo # Unknown keys interspersed (should be ignored)
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"foo":"bar","geometries":[],"type":"GeometryCollection","extra":123}')) as expr;
|
||||
|
||||
--echo # Deeply nested geometries before type
|
||||
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[{"geometries":[{"type":"Point","coordinates":[9,10]}],"type":"GeometryCollection"}],"type":"GeometryCollection"}')) as expr;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
--echo #
|
||||
|
||||
@@ -494,6 +494,34 @@ CREATE USER for u2@localhost
|
||||
CREATE USER `u2`@`localhost` IDENTIFIED BY PASSWORD '*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD'
|
||||
drop user u1@localhost;
|
||||
drop user u2@localhost;
|
||||
#
|
||||
# MDEV-40541 role vs user@localhost acl_cache key confusion
|
||||
#
|
||||
create database db;
|
||||
create table db.t1(a varchar(40));
|
||||
insert into db.t1 values ('role-cache-collision-row');
|
||||
create role r1;
|
||||
create user r1@localhost identified by 'r1pass';
|
||||
create user u1@'127.0.0.1' identified by 'u1pass';
|
||||
grant select on db.* to r1@localhost;
|
||||
grant r1 to u1@'127.0.0.1';
|
||||
connect r1,localhost,r1,r1pass;
|
||||
select a as precache from db.t1;
|
||||
precache
|
||||
role-cache-collision-row
|
||||
connect u1,127.0.0.1,u1,u1pass;
|
||||
set role r1;
|
||||
show grants;
|
||||
Grants for u1@127.0.0.1
|
||||
GRANT `r1` TO `u1`@`127.0.0.1`
|
||||
GRANT USAGE ON *.* TO `u1`@`127.0.0.1` IDENTIFIED BY PASSWORD '*4C5C0A2C80D7567C7CFBDFC09409901AADC4B390'
|
||||
GRANT USAGE ON *.* TO `r1`
|
||||
select a from db.t1;
|
||||
ERROR 42000: SELECT command denied to user 'u1'@'localhost' for table `db`.`t1`
|
||||
connection default;
|
||||
drop database db;
|
||||
drop role r1;
|
||||
drop user r1@localhost, u1@'127.0.0.1';
|
||||
# End of 10.6 tests
|
||||
#
|
||||
# MDEV-37256: The permission check of LOAD INDEX INTO CACHE and CACHE INDEX is broken
|
||||
|
||||
@@ -455,6 +455,35 @@ show create user u2@localhost;
|
||||
drop user u1@localhost;
|
||||
drop user u2@localhost;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-40541 role vs user@localhost acl_cache key confusion
|
||||
--echo #
|
||||
create database db;
|
||||
create table db.t1(a varchar(40));
|
||||
insert into db.t1 values ('role-cache-collision-row');
|
||||
|
||||
create role r1;
|
||||
create user r1@localhost identified by 'r1pass';
|
||||
create user u1@'127.0.0.1' identified by 'u1pass';
|
||||
|
||||
grant select on db.* to r1@localhost;
|
||||
grant r1 to u1@'127.0.0.1';
|
||||
#flush privileges;
|
||||
|
||||
connect r1,localhost,r1,r1pass;
|
||||
select a as precache from db.t1;
|
||||
|
||||
connect u1,127.0.0.1,u1,u1pass;
|
||||
set role r1;
|
||||
show grants;
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
select a from db.t1;
|
||||
|
||||
connection default;
|
||||
drop database db;
|
||||
drop role r1;
|
||||
drop user r1@localhost, u1@'127.0.0.1';
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
--echo #
|
||||
|
||||
@@ -1356,3 +1356,69 @@ a b
|
||||
1 2
|
||||
drop tables t1, t2, t3;
|
||||
set sql_mode= default;
|
||||
#
|
||||
# MDEV-38722 server crash hp_rec_key_cmp
|
||||
#
|
||||
# original reproducer (used to crash), returns a single row
|
||||
SELECT 1 INTERSECT SELECT 1 UNION ALL SELECT 1 EXCEPT ALL SELECT 1;
|
||||
1
|
||||
1
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES (1),(1),(2),(3);
|
||||
CREATE TABLE t2 (i INT);
|
||||
INSERT INTO t2 VALUES (1),(2),(2);
|
||||
CREATE TABLE t3 (i INT);
|
||||
INSERT INTO t3 VALUES (1),(3);
|
||||
SELECT i FROM t1 INTERSECT SELECT i FROM t3
|
||||
UNION ALL SELECT i FROM t2 EXCEPT ALL SELECT i FROM t3 ORDER BY i;
|
||||
i
|
||||
1
|
||||
2
|
||||
2
|
||||
(((SELECT i FROM t1) INTERSECT (SELECT i FROM t3)) UNION ALL (SELECT i FROM t2))
|
||||
EXCEPT ALL (SELECT i FROM t3) ORDER BY i;
|
||||
i
|
||||
1
|
||||
2
|
||||
2
|
||||
# trailing UNION ALL after the EXCEPT ALL
|
||||
SELECT i FROM t1 INTERSECT SELECT i FROM t2 UNION ALL SELECT i FROM t2
|
||||
EXCEPT ALL SELECT i FROM t3 UNION ALL SELECT i FROM t1 ORDER BY i;
|
||||
i
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
3
|
||||
((((SELECT i FROM t1) INTERSECT (SELECT i FROM t2)) UNION ALL (SELECT i FROM t2))
|
||||
EXCEPT ALL (SELECT i FROM t3)) UNION ALL (SELECT i FROM t1) ORDER BY i;
|
||||
i
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
3
|
||||
# a leading INTERSECT ALL keeps the operation extended while the last
|
||||
# INTERSECT DISTINCT node is the index-release point
|
||||
SELECT i FROM t1 INTERSECT ALL SELECT i FROM t2 INTERSECT SELECT i FROM t3
|
||||
UNION ALL SELECT i FROM t2 ORDER BY i;
|
||||
i
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
(((SELECT i FROM t1) INTERSECT ALL (SELECT i FROM t2)) INTERSECT (SELECT i FROM t3))
|
||||
UNION ALL (SELECT i FROM t2) ORDER BY i;
|
||||
i
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
DROP TABLE t1,t2,t3;
|
||||
# End of 10.6 tests
|
||||
|
||||
@@ -497,3 +497,34 @@ select * from t1 except all select * from t2 intersect all select * from t1 unio
|
||||
select * from t1 except all select * from t2 intersect all select * from t1 union all select * from t2 order by a desc limit 3;
|
||||
drop tables t1, t2, t3;
|
||||
set sql_mode= default;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-38722 server crash hp_rec_key_cmp
|
||||
--echo #
|
||||
--echo # original reproducer (used to crash), returns a single row
|
||||
SELECT 1 INTERSECT SELECT 1 UNION ALL SELECT 1 EXCEPT ALL SELECT 1;
|
||||
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES (1),(1),(2),(3);
|
||||
CREATE TABLE t2 (i INT);
|
||||
INSERT INTO t2 VALUES (1),(2),(2);
|
||||
CREATE TABLE t3 (i INT);
|
||||
INSERT INTO t3 VALUES (1),(3);
|
||||
SELECT i FROM t1 INTERSECT SELECT i FROM t3
|
||||
UNION ALL SELECT i FROM t2 EXCEPT ALL SELECT i FROM t3 ORDER BY i;
|
||||
(((SELECT i FROM t1) INTERSECT (SELECT i FROM t3)) UNION ALL (SELECT i FROM t2))
|
||||
EXCEPT ALL (SELECT i FROM t3) ORDER BY i;
|
||||
--echo # trailing UNION ALL after the EXCEPT ALL
|
||||
SELECT i FROM t1 INTERSECT SELECT i FROM t2 UNION ALL SELECT i FROM t2
|
||||
EXCEPT ALL SELECT i FROM t3 UNION ALL SELECT i FROM t1 ORDER BY i;
|
||||
((((SELECT i FROM t1) INTERSECT (SELECT i FROM t2)) UNION ALL (SELECT i FROM t2))
|
||||
EXCEPT ALL (SELECT i FROM t3)) UNION ALL (SELECT i FROM t1) ORDER BY i;
|
||||
--echo # a leading INTERSECT ALL keeps the operation extended while the last
|
||||
--echo # INTERSECT DISTINCT node is the index-release point
|
||||
SELECT i FROM t1 INTERSECT ALL SELECT i FROM t2 INTERSECT SELECT i FROM t3
|
||||
UNION ALL SELECT i FROM t2 ORDER BY i;
|
||||
(((SELECT i FROM t1) INTERSECT ALL (SELECT i FROM t2)) INTERSECT (SELECT i FROM t3))
|
||||
UNION ALL (SELECT i FROM t2) ORDER BY i;
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
@@ -103,4 +103,16 @@ drop table t3|
|
||||
# MDEV-40409 ST_GeomFromText stack overrun on deeply nested GeometryCollection
|
||||
#
|
||||
SELECT ST_GeomFromText(CONCAT(REPEAT('GEOMETRYCOLLECTION(',5000),'POINT(1 1)',REPEAT(')',5000)));
|
||||
#
|
||||
# MDEV-40540 ST_GeomFromWKB stack overrun on deeply nested GeometryCollection
|
||||
#
|
||||
set @a=concat(0x0107000000, repeat(0x010000000107000000, 120000), 0x00000000);
|
||||
SELECT ST_GeomFromWKB(@a);
|
||||
#
|
||||
# MDEV-39750 ExtractValue does not control recursion depth.
|
||||
#
|
||||
SELECT ExtractValue('<a/>', REPEAT('(', 100000));
|
||||
ERROR HY000: Thread stack overrun: 'used bytes' used of a 'available' byte stack, and 'X' bytes needed. Consider increasing the thread_stack system variable.
|
||||
SELECT ExtractValue('<a/>', REPEAT('/n', 100000));
|
||||
ERROR HY000: Thread stack overrun: 'used bytes' used of a 'available' byte stack, and 'X' bytes needed. Consider increasing the thread_stack system variable.
|
||||
# End of 10.6 tests
|
||||
|
||||
@@ -147,4 +147,24 @@ delimiter ;|
|
||||
SELECT ST_GeomFromText(CONCAT(REPEAT('GEOMETRYCOLLECTION(',5000),'POINT(1 1)',REPEAT(')',5000)));
|
||||
--enable_result_log
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-40540 ST_GeomFromWKB stack overrun on deeply nested GeometryCollection
|
||||
--echo #
|
||||
set @a=concat(0x0107000000, repeat(0x010000000107000000, 120000), 0x00000000);
|
||||
--disable_result_log
|
||||
--error ER_STACK_OVERRUN_NEED_MORE
|
||||
SELECT ST_GeomFromWKB(@a);
|
||||
--enable_result_log
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-39750 ExtractValue does not control recursion depth.
|
||||
--echo #
|
||||
--replace_regex /overrun: [0-9]* bytes used of a [0-9]* byte stack, and [0-9]* bytes needed/overrun: 'used bytes' used of a 'available' byte stack, and 'X' bytes needed/
|
||||
--error ER_STACK_OVERRUN_NEED_MORE
|
||||
SELECT ExtractValue('<a/>', REPEAT('(', 100000));
|
||||
|
||||
--replace_regex /overrun: [0-9]* bytes used of a [0-9]* byte stack, and [0-9]* bytes needed/overrun: 'used bytes' used of a 'available' byte stack, and 'X' bytes needed/
|
||||
--error ER_STACK_OVERRUN_NEED_MORE
|
||||
SELECT ExtractValue('<a/>', REPEAT('/n', 100000));
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
8
mysql-test/main/mdev-37000.result
Normal file
8
mysql-test/main/mdev-37000.result
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# MDEV-37000 Deleting a row from Aria table results to 'Index is corrupt'
|
||||
#
|
||||
CREATE OR REPLACE TABLE t (a INT, b CHAR(8) NOT NULL, KEY(b)) ENGINE=Aria DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t VALUES (1,'20070101'), (2,'20070101');
|
||||
DELETE FROM t LIMIT 2;
|
||||
DROP TABLE t;
|
||||
# End of 10.6 tests
|
||||
9
mysql-test/main/mdev-37000.test
Normal file
9
mysql-test/main/mdev-37000.test
Normal file
@@ -0,0 +1,9 @@
|
||||
--echo #
|
||||
--echo # MDEV-37000 Deleting a row from Aria table results to 'Index is corrupt'
|
||||
--echo #
|
||||
CREATE OR REPLACE TABLE t (a INT, b CHAR(8) NOT NULL, KEY(b)) ENGINE=Aria DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t VALUES (1,'20070101'), (2,'20070101');
|
||||
DELETE FROM t LIMIT 2;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
@@ -245,6 +245,14 @@ DECLARE a mysql_json;
|
||||
END;
|
||||
$$
|
||||
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
# MDEV-40678 mysql_json plugin OOB reads
|
||||
#
|
||||
alter table t1 force;
|
||||
ERROR HY000: Error parsing MySQL JSON format, please dump this table from MySQL and then restore it to be able to use it in MariaDB.
|
||||
flush tables;
|
||||
alter table t1 force;
|
||||
ERROR HY000: Error parsing MySQL JSON format, please dump this table from MySQL and then restore it to be able to use it in MariaDB.
|
||||
drop table t1;
|
||||
# End of 10.6 tests
|
||||
|
||||
@@ -17,7 +17,7 @@ call mtr.add_suppression("Table rebuild required");
|
||||
call mtr.add_suppression("is marked as crashed");
|
||||
call mtr.add_suppression("Checking");
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
@@ -161,6 +161,40 @@ END;
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-40678 mysql_json plugin OOB reads
|
||||
--echo #
|
||||
|
||||
--copy_file std_data/mysql_json/mysql_json_test.frm $MYSQLD_DATADIR/test/t1.frm
|
||||
--copy_file std_data/mysql_json/mysql_json_test.MYI $MYSQLD_DATADIR/test/t1.MYI
|
||||
--copy_file std_data/mysql_json/mysql_json_test.MYD $MYSQLD_DATADIR/test/t1.MYD
|
||||
|
||||
perl;
|
||||
my $f="$ENV{MYSQLD_DATADIR}/test/t1.MYD";
|
||||
open F, '+<', $f or die "open($f): $!";
|
||||
sysseek F, 0x3c5, 0 or die "sysseek: $!";
|
||||
syswrite F, '(' or die "syswrite: $!";
|
||||
EOF
|
||||
|
||||
--error ER_UNKNOWN_ERROR
|
||||
alter table t1 force;
|
||||
flush tables;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.MYD
|
||||
--copy_file std_data/mysql_json/mysql_json_test.MYD $MYSQLD_DATADIR/test/t1.MYD
|
||||
|
||||
perl;
|
||||
my $f="$ENV{MYSQLD_DATADIR}/test/t1.MYD";
|
||||
open F, '+<', $f or die "open($f): $!";
|
||||
sysseek F, 0x3bc, 0 or die "sysseek: $!";
|
||||
syswrite F, '(' or die "syswrite: $!";
|
||||
EOF
|
||||
|
||||
--error ER_UNKNOWN_ERROR
|
||||
alter table t1 force;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
@@ -16,7 +16,17 @@
|
||||
--net-buffer-length=#
|
||||
Buffer length for TCP/IP and socket communication
|
||||
--net-read-timeout=#
|
||||
@@ -1374,6 +1376,10 @@
|
||||
@@ -1216,8 +1218,7 @@
|
||||
(Defaults to on; use --skip-secure-auth to disable.)
|
||||
--secure-file-priv=name
|
||||
Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
|
||||
- files within specified directory. Empty value means no
|
||||
- limits except /proc
|
||||
+ files within specified directory.
|
||||
--secure-timestamp=name
|
||||
Restricts direct setting of a session timestamp. Possible
|
||||
levels are: YES - timestamp cannot deviate from the
|
||||
@@ -1375,6 +1376,10 @@
|
||||
Alias for log_slow_query_file. Log slow queries to given
|
||||
log file. Defaults logging to 'hostname'-slow.log. Must
|
||||
be enabled to activate other slow log options
|
||||
@@ -27,7 +37,7 @@
|
||||
--socket=name Socket file to use for connection
|
||||
--sort-buffer-size=#
|
||||
Each thread that needs to do a sort allocates a buffer of
|
||||
@@ -1394,6 +1400,7 @@
|
||||
@@ -1395,6 +1400,7 @@
|
||||
aborted. Prevents the common mistake of accidentally
|
||||
deleting or updating every row in a table.
|
||||
--stack-trace Print a symbolic stack trace on failure
|
||||
@@ -35,7 +45,7 @@
|
||||
--standard-compliant-cte
|
||||
Allow only CTEs compliant to SQL standard
|
||||
(Defaults to on; use --skip-standard-compliant-cte to disable.)
|
||||
@@ -1472,6 +1479,12 @@
|
||||
@@ -1473,6 +1479,12 @@
|
||||
--thread-pool-max-threads=#
|
||||
Maximum allowed number of worker threads in the thread
|
||||
pool
|
||||
@@ -48,7 +58,7 @@
|
||||
--thread-pool-oversubscribe=#
|
||||
How many additional active worker threads in a group are
|
||||
allowed.
|
||||
@@ -1510,8 +1523,8 @@
|
||||
@@ -1511,8 +1523,8 @@
|
||||
automatically convert it to an on-disk MyISAM or Aria
|
||||
table.
|
||||
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
|
||||
@@ -59,7 +69,7 @@
|
||||
--transaction-alloc-block-size=#
|
||||
Allocation block size for transactions to be stored in
|
||||
binary log
|
||||
@@ -1731,6 +1744,7 @@
|
||||
@@ -1732,6 +1744,7 @@
|
||||
myisam-stats-method NULLS_UNEQUAL
|
||||
myisam-use-mmap FALSE
|
||||
mysql56-temporal-format TRUE
|
||||
@@ -67,7 +77,7 @@
|
||||
net-buffer-length 16384
|
||||
net-read-timeout 30
|
||||
net-retry-count 10
|
||||
@@ -1891,6 +1905,7 @@
|
||||
@@ -1892,6 +1905,7 @@
|
||||
slave-type-conversions
|
||||
slow-launch-time 2
|
||||
slow-query-log FALSE
|
||||
@@ -75,7 +85,7 @@
|
||||
sort-buffer-size 2097152
|
||||
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
sql-safe-updates FALSE
|
||||
@@ -1917,6 +1932,8 @@
|
||||
@@ -1918,6 +1932,8 @@
|
||||
thread-pool-exact-stats FALSE
|
||||
thread-pool-idle-timeout 60
|
||||
thread-pool-max-threads 65536
|
||||
|
||||
@@ -1216,7 +1216,8 @@ The following specify which files/extra groups are read (specified before remain
|
||||
(Defaults to on; use --skip-secure-auth to disable.)
|
||||
--secure-file-priv=name
|
||||
Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
|
||||
files within specified directory
|
||||
files within specified directory. Empty value means no
|
||||
limits except /proc
|
||||
--secure-timestamp=name
|
||||
Restricts direct setting of a session timestamp. Possible
|
||||
levels are: YES - timestamp cannot deviate from the
|
||||
|
||||
@@ -1023,6 +1023,12 @@ the false block has written nothing
|
||||
mysqltest: At line 1: End of file encountered before 'eval' delimiter was found
|
||||
# Only 'eval' is allowed as the third argument
|
||||
mysqltest: At line 1: Invalid argument 'junk' to 'write_file', only 'eval' is allowed
|
||||
#
|
||||
# \0 in a query
|
||||
#
|
||||
select hex("1 | ||||