1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '11.2' into 11.3

This commit is contained in:
Oleksandr Byelkin
2024-02-04 16:42:31 +01:00
376 changed files with 8594 additions and 2466 deletions

View File

@ -1712,3 +1712,32 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***************************************************************************
%%The following software may be included in this product:
socketpair.c
Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
The name of the author must not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

View File

@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=11
MYSQL_VERSION_MINOR=3
MYSQL_VERSION_PATCH=2
SERVER_MATURITY=gamma
SERVER_MATURITY=stable

View File

@ -16,7 +16,7 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${PCRE_INCLUDES}
${PCRE_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/mysys_ssl
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}

View File

@ -261,6 +261,9 @@ static int connect_flag=CLIENT_INTERACTIVE;
static my_bool opt_binary_mode= FALSE;
static my_bool opt_connect_expired_password= FALSE;
static int interrupted_query= 0;
#ifdef USE_LIBEDIT_INTERFACE
static int sigint_received= 0;
#endif
static char *current_host,*current_db,*current_user=0,*opt_password=0,
*current_prompt=0, *delimiter_str= 0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME,
@ -1166,6 +1169,8 @@ extern "C" sig_handler handle_sigint(int sig);
static sig_handler window_resize(int sig);
#endif
static void end_in_sig_handler(int sig);
static bool kill_query(const char *reason);
const char DELIMITER_NAME[]= "delimiter";
const uint DELIMITER_NAME_LEN= sizeof(DELIMITER_NAME) - 1;
@ -1528,30 +1533,35 @@ static bool do_connect(MYSQL *mysql, const char *host, const char *user,
}
void end_in_sig_handler(int sig)
{
#ifdef _WIN32
/*
This function handles sigint calls
If query is in process, kill query
If 'source' is executed, abort source command
no query in process, terminate like previous behavior
When SIGINT is raised on Windows, the OS creates a new thread to handle the
interrupt. Once that thread completes, the main thread continues running
only to find that it's resources have already been free'd when the sigint
handler called mysql_end().
*/
mysql_thread_end();
#else
mysql_end(sig);
#endif
}
sig_handler handle_sigint(int sig)
/*
Kill a running query. Returns true if we were unable to connect to the server.
*/
bool kill_query(const char *reason)
{
char kill_buffer[40];
MYSQL *kill_mysql= NULL;
/* terminate if no query being executed, or we already tried interrupting */
if (!executing_query || (interrupted_query == 2))
{
tee_fprintf(stdout, "Ctrl-C -- exit!\n");
goto err;
}
kill_mysql= mysql_init(kill_mysql);
if (!do_connect(kill_mysql,current_host, current_user, opt_password, "", 0))
{
tee_fprintf(stdout, "Ctrl-C -- sorry, cannot connect to server to kill query, giving up ...\n");
goto err;
tee_fprintf(stdout, "%s -- sorry, cannot connect to server to kill query, giving up ...\n", reason);
return true;
}
/* First time try to kill the query, second time the connection */
@ -1566,27 +1576,62 @@ sig_handler handle_sigint(int sig)
(interrupted_query == 1) ? "QUERY " : "",
mysql_thread_id(&mysql));
if (verbose)
tee_fprintf(stdout, "Ctrl-C -- sending \"%s\" to server ...\n",
tee_fprintf(stdout, "%s -- sending \"%s\" to server ...\n", reason,
kill_buffer);
mysql_real_query(kill_mysql, kill_buffer, (uint) strlen(kill_buffer));
mysql_close(kill_mysql);
tee_fprintf(stdout, "Ctrl-C -- query killed. Continuing normally.\n");
if (interrupted_query == 1)
tee_fprintf(stdout, "%s -- query killed.\n", reason);
else
tee_fprintf(stdout, "%s -- connection killed.\n", reason);
if (in_com_source)
aborted= 1; // Abort source command
return;
return false;
}
err:
#ifdef _WIN32
/*
When SIGINT is raised on Windows, the OS creates a new thread to handle the
interrupt. Once that thread completes, the main thread continues running
only to find that it's resources have already been free'd when the sigint
handler called mysql_end().
This function handles sigint calls
If query is in process, kill query
If 'source' is executed, abort source command
no query in process, regenerate prompt.
*/
mysql_thread_end();
sig_handler handle_sigint(int sig)
{
/*
On Unix only, if no query is being executed just clear the prompt,
don't exit. On Windows we exit.
*/
if (!executing_query)
{
#ifndef _WIN32
tee_fprintf(stdout, "^C\n");
#ifdef USE_LIBEDIT_INTERFACE
/* Libedit will regenerate it outside of the signal handler. */
sigint_received= 1;
#else
mysql_end(sig);
rl_on_new_line(); // Regenerate the prompt on a newline
rl_replace_line("", 0); // Clear the previous text
rl_redisplay();
#endif
#else // WIN32
tee_fprintf(stdout, "Ctrl-C -- exit!\n");
end_in_sig_handler(sig);
#endif
return;
}
/*
When executing a query, this newline makes the prompt look like so:
^C
Ctrl-C -- query killed.
*/
tee_fprintf(stdout, "\n");
if (kill_query("Ctrl-C"))
{
aborted= 1;
end_in_sig_handler(sig);
}
}
@ -2157,6 +2202,15 @@ static int get_options(int argc, char **argv)
return(0);
}
#if !defined(_WIN32) && defined(USE_LIBEDIT_INTERFACE)
static inline void reset_prompt(char *in_string, bool *ml_comment) {
glob_buffer.length(0);
*ml_comment = false;
*in_string = 0;
}
#endif
static int read_and_execute(bool interactive)
{
char *line= NULL;
@ -2248,7 +2302,30 @@ static int read_and_execute(bool interactive)
if (line)
free(line);
line= readline(prompt);
#endif /* defined(_WIN32) */
#ifdef USE_LIBEDIT_INTERFACE
/*
libedit handles interrupts different than libreadline.
libreadline has its own signal handlers, thus a sigint during readline
doesn't force readline to return null string.
However libedit returns null if the interrupt signal is raised.
We can also get an empty string when ctrl+d is pressed (EoF).
We need this sigint_received flag, to differentiate between the two
cases. This flag is only set during our handle_sigint function when
LIBEDIT_INTERFACE is used.
*/
if (!line && sigint_received)
{
// User asked to clear the input.
sigint_received= 0;
reset_prompt(&in_string, &ml_comment);
continue;
}
// For safety, we always mark this as cleared.
sigint_received= 0;
#endif
#endif /* defined(__WIN__) */
/*
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS

View File

@ -4699,15 +4699,11 @@ void do_perl(struct st_command *command)
/* Check for error code that indicates perl could not be started */
int exstat= WEXITSTATUS(error);
#ifdef _WIN32
if (exstat == 1)
/* Text must begin 'perl not found' as mtr looks for it */
abort_not_supported_test("perl not found in path or did not start");
#else
#ifndef _WIN32
if (exstat == 127)
abort_not_supported_test("perl not found in path");
#endif
else
#endif
handle_command_error(command, exstat, my_errno);
}
dynstr_free(&ds_delimiter);

View File

@ -1,4 +1,4 @@
INCLUDE (CheckCXXSourceCompiles)
INCLUDE (CheckCXXSourceRuns)
INCLUDE (ExternalProject)
SET(WITH_LIBFMT "auto" CACHE STRING
@ -27,17 +27,15 @@ ENDMACRO()
MACRO (CHECK_LIBFMT)
IF(WITH_LIBFMT STREQUAL "system" OR WITH_LIBFMT STREQUAL "auto")
SET(CMAKE_REQUIRED_INCLUDES ${LIBFMT_INCLUDE_DIR})
CHECK_CXX_SOURCE_COMPILES(
CHECK_CXX_SOURCE_RUNS(
"#define FMT_STATIC_THOUSANDS_SEPARATOR ','
#define FMT_HEADER_ONLY 1
#include <fmt/format-inl.h>
#include <iostream>
int main() {
int answer= 42;
int answer= 4321;
fmt::format_args::format_arg arg=
fmt::detail::make_arg<fmt::format_context>(answer);
std::cout << fmt::vformat(\"The answer is {}.\",
fmt::format_args(&arg, 1));
return fmt::vformat(\"{:L}\", fmt::format_args(&arg, 1)).compare(\"4,321\");
}" HAVE_SYSTEM_LIBFMT)
SET(CMAKE_REQUIRED_INCLUDES)
ENDIF()

View File

@ -34,5 +34,8 @@ ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -maix64 -pthread -mcmodel=large")
ENDIF()
# fcntl(fd, F_SETFL, O_DIRECT) is not supported; O_DIRECT is an open(2) flag
SET(HAVE_FCNTL_DIRECT 0 CACHE INTERNAL "")
# make it WARN by default, not AUTO (that implies -Werror)
SET(MYSQL_MAINTAINER_MODE "WARN" CACHE STRING "Enable MariaDB maintainer-specific warnings. One of: NO (warnings are disabled) WARN (warnings are enabled) ERR (warnings are errors) AUTO (warnings are errors in Debug only)")

View File

@ -17,6 +17,10 @@ INCLUDE(CheckSymbolExists)
INCLUDE(CheckCSourceRuns)
INCLUDE(CheckCSourceCompiles)
# fcntl(fd, F_SETFL, O_DIRECT) is not supported,
# and directio(3C) would only work on UFS or NFS, not ZFS.
SET(HAVE_FCNTL_DIRECT 0 CACHE INTERNAL "")
# Enable 64 bit file offsets
SET(_FILE_OFFSET_BITS 64)

View File

@ -44,6 +44,7 @@ SET(HAVE_EXECINFO_H CACHE INTERNAL "")
SET(HAVE_FCHMOD CACHE INTERNAL "")
SET(HAVE_FCNTL CACHE INTERNAL "")
SET(HAVE_FCNTL_H 1 CACHE INTERNAL "")
SET(HAVE_FCNTL_DIRECT 0 CACHE INTERNAL "")
SET(HAVE_FCNTL_NONBLOCK CACHE INTERNAL "")
SET(HAVE_FDATASYNC CACHE INTERNAL "")
SET(HAVE_DECL_FDATASYNC CACHE INTERNAL "")
@ -242,7 +243,6 @@ SET(HAVE_TERMCAP_H CACHE INTERNAL "")
SET(HAVE_TERMIOS_H CACHE INTERNAL "")
SET(HAVE_TERMIO_H CACHE INTERNAL "")
SET(HAVE_TERM_H CACHE INTERNAL "")
SET(HAVE_THR_SETCONCURRENCY CACHE INTERNAL "")
SET(HAVE_THR_YIELD CACHE INTERNAL "")
SET(HAVE_TIME 1 CACHE INTERNAL "")
SET(HAVE_TIMES CACHE INTERNAL "")

View File

@ -102,11 +102,7 @@ IF(NOT VERSION)
SET(DEFAULT_MACHINE "${CMAKE_OSX_ARCHITECTURES}")
ENDIF()
ELSE()
IF(64BIT)
SET(DEFAULT_MACHINE "x86_64")
ELSE()
SET(DEFAULT_MACHINE "i386")
ENDIF()
SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
ENDIF()
IF(DEFAULT_MACHINE MATCHES "i386")

View File

@ -1,4 +1,3 @@
INCLUDE (CheckCSourceRuns)
INCLUDE (ExternalProject)
SET(WITH_PCRE "auto" CACHE STRING
@ -6,7 +5,8 @@ SET(WITH_PCRE "auto" CACHE STRING
MACRO(BUNDLE_PCRE2)
SET(dir "${CMAKE_BINARY_DIR}/extra/pcre2")
SET(PCRE_INCLUDES ${dir}/src/pcre2-build ${dir}/src/pcre2/src)
SET(PCRE_INCLUDE_DIRS ${dir}/src/pcre2-build ${dir}/src/pcre2/src)
MESSAGE(STATUS "Will download and bundle pcre2")
SET(byproducts)
FOREACH(lib pcre2-posix pcre2-8)
ADD_LIBRARY(${lib} STATIC IMPORTED GLOBAL)
@ -76,19 +76,24 @@ SET_TARGET_PROPERTIES(pcre2 PROPERTIES EXCLUDE_FROM_ALL TRUE)
ENDMACRO()
MACRO (CHECK_PCRE)
IF (NOT TARGET pcre2 AND NOT PCRE_FOUND)
IF(WITH_PCRE STREQUAL "system" OR WITH_PCRE STREQUAL "auto")
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "" HAVE_PCRE2)
FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PCRE libpcre2-8)
# in case pkg-config or libpcre2-8.pc is not installed:
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "${PCRE_LIBRARY_DIRS}" HAVE_PCRE2_MATCH_8)
ENDIF()
IF(NOT HAVE_PCRE2 OR WITH_PCRE STREQUAL "bundled")
IF(NOT HAVE_PCRE2_MATCH_8 OR WITH_PCRE STREQUAL "bundled")
IF (WITH_PCRE STREQUAL "system")
MESSAGE(FATAL_ERROR "system pcre2-8 library is not found or unusable")
ENDIF()
BUNDLE_PCRE2()
ELSE()
CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "" NEEDS_PCRE2_DEBIAN_HACK)
CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "${PCRE_LIBRARY_DIRS}" NEEDS_PCRE2_DEBIAN_HACK)
IF(NEEDS_PCRE2_DEBIAN_HACK)
SET(PCRE2_DEBIAN_HACK "-Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree")
ENDIF()
ENDIF()
ENDIF()
ENDMACRO()

View File

@ -44,7 +44,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
${PCRE_INCLUDES}
${PCRE_INCLUDE_DIRS}
${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR})

View File

@ -114,6 +114,9 @@ MACRO (MYSQL_FIND_SYSTEM_READLINE)
{
rl_completion_func_t *func1= (rl_completion_func_t*)0;
rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
rl_on_new_line();
rl_replace_line(\"\", 0);
rl_redisplay();
}"
NEW_READLINE_INTERFACE)

View File

@ -30,6 +30,7 @@
#cmakedefine HAVE_DLFCN_H 1
#cmakedefine HAVE_EXECINFO_H 1
#cmakedefine HAVE_FCNTL_H 1
#cmakedefine HAVE_FCNTL_DIRECT 1
#cmakedefine HAVE_FENV_H 1
#cmakedefine HAVE_FLOAT_H 1
#cmakedefine HAVE_FNMATCH_H 1
@ -72,6 +73,7 @@
#cmakedefine HAVE_SYS_IOCTL_H 1
#cmakedefine HAVE_SYS_MALLOC_H 1
#cmakedefine HAVE_SYS_MMAN_H 1
#cmakedefine HAVE_SYS_MNTENT_H 1
#cmakedefine HAVE_SYS_NDIR_H 1
#cmakedefine HAVE_SYS_PTE_H 1
#cmakedefine HAVE_SYS_PTEM_H 1
@ -232,7 +234,6 @@
#cmakedefine HAVE_STRTOUL 1
#cmakedefine HAVE_STRTOULL 1
#cmakedefine HAVE_TELL 1
#cmakedefine HAVE_THR_SETCONCURRENCY 1
#cmakedefine HAVE_THR_YIELD 1
#cmakedefine HAVE_TIME 1
#cmakedefine HAVE_TIMES 1

View File

@ -418,7 +418,6 @@ CHECK_FUNCTION_EXISTS (strtoul HAVE_STRTOUL)
CHECK_FUNCTION_EXISTS (strtoull HAVE_STRTOULL)
CHECK_FUNCTION_EXISTS (strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS (tell HAVE_TELL)
CHECK_FUNCTION_EXISTS (thr_setconcurrency HAVE_THR_SETCONCURRENCY)
CHECK_FUNCTION_EXISTS (thr_yield HAVE_THR_YIELD)
CHECK_FUNCTION_EXISTS (vasprintf HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS (vsnprintf HAVE_VSNPRINTF)
@ -707,6 +706,7 @@ CHECK_SYMBOL_EXISTS(O_NONBLOCK "unistd.h;fcntl.h" HAVE_FCNTL_NONBLOCK)
IF(NOT HAVE_FCNTL_NONBLOCK)
SET(NO_FCNTL_NONBLOCK 1)
ENDIF()
CHECK_SYMBOL_EXISTS(O_DIRECT "fcntl.h" HAVE_FCNTL_DIRECT)
#
# Test for how the C compiler does inline, if at all

View File

@ -129,13 +129,6 @@ in
add_lsb_base_depends
;&
"lunar"|"mantic")
# mariadb-plugin-rocksdb s390x not supported by us (yet)
# ubuntu doesn't support mips64el yet, so keep this just
# in case something changes.
if [[ ! "$architecture" =~ amd64|arm64|ppc64el|s390x ]]
then
remove_rocksdb_tools
fi
if [[ ! "$architecture" =~ amd64|arm64|ppc64el ]]
then
disable_pmem
@ -144,6 +137,15 @@ in
then
replace_uring_with_aio
fi
;&
"noble")
# mariadb-plugin-rocksdb s390x not supported by us (yet)
# ubuntu doesn't support mips64el yet, so keep this just
# in case something changes.
if [[ ! "$architecture" =~ amd64|arm64|ppc64el|s390x ]]
then
remove_rocksdb_tools
fi
;;
*)
echo "Error: Unknown release '$LSBNAME'" >&2

3
debian/control vendored
View File

@ -31,8 +31,7 @@ Build-Depends: bison,
liblz4-dev,
liblzma-dev,
liblzo2-dev,
libncurses5-dev (>= 5.0-6~),
libncurses5-dev:native (>= 5.0-6~),
libncurses-dev,
libnuma-dev [linux-any],
libpam0g-dev,
libpcre2-dev,

View File

@ -36,7 +36,7 @@ INCLUDE_DIRECTORIES(
)
IF(NOT HAVE_SYSTEM_REGEX)
INCLUDE_DIRECTORIES(${PCRE_INCLUDES})
INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIRS})
ADD_DEFINITIONS(${PCRE2_DEBIAN_HACK})
ENDIF()

View File

@ -2187,7 +2187,7 @@ static bool innodb_init_param()
/* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) {
if (xtrabackup_use_memory > UINT_MAX32) {
if (xtrabackup_use_memory > (longlong) UINT_MAX32) {
msg("mariabackup: use-memory can't be over 4GB"
" on 32-bit systems");
}

View File

@ -28,6 +28,11 @@
#define NO_OLD_TIMEVAL_NAME
#define HAVE_SECURE_RENEGOTIATION
#define HAVE_EXTENDED_MASTER
/*
Following is workaround about a WolfSSL 5.6.6 bug.
The bug is about undefined sessionCtxSz during compilation.
*/
#define WOLFSSL_SESSION_ID_CTX
/* TLSv1.3 definitions (all needed to build) */
#define WOLFSSL_TLS13

View File

@ -147,9 +147,6 @@ int pthread_cancel(pthread_t thread);
#ifndef _REENTRANT
#define _REENTRANT
#endif
#ifdef HAVE_THR_SETCONCURRENCY
#include <thread.h> /* Probably solaris */
#endif
#ifdef HAVE_SCHED_H
#include <sched.h>
#endif
@ -618,9 +615,6 @@ extern int my_rw_trywrlock(my_rw_lock_t *);
#define GETHOSTBYADDR_BUFF_SIZE 2048
#ifndef HAVE_THR_SETCONCURRENCY
#define thr_setconcurrency(A) pthread_dummy(0)
#endif
#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#endif

View File

@ -531,7 +531,13 @@ struct st_mysql_plugin
const char *author; /* plugin author (for I_S.PLUGINS) */
const char *descr; /* general descriptive text (for I_S.PLUGINS) */
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
int (*init)(void *); /* the function to invoke when plugin is loaded */
/*
The function to invoke when plugin is loaded. Plugin
initialisation done here should defer any ALTER TABLE queries to
after the ddl recovery is done, in the signal_ddl_recovery_done()
callback called by ha_signal_ddl_recovery_done().
*/
int (*init)(void *);
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
unsigned int version; /* plugin version (for I_S.PLUGINS) */
struct st_mysql_show_var *status_vars;
@ -555,7 +561,13 @@ struct st_maria_plugin
const char *author; /* plugin author (for SHOW PLUGINS) */
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
int (*init)(void *); /* the function to invoke when plugin is loaded */
/*
The function to invoke when plugin is loaded. Plugin
initialisation done here should defer any ALTER TABLE queries to
after the ddl recovery is done, in the signal_ddl_recovery_done()
callback called by ha_signal_ddl_recovery_done().
*/
int (*init)(void *);
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
unsigned int version; /* plugin version (for SHOW PLUGINS) */
struct st_mysql_show_var *status_vars;

View File

@ -456,7 +456,7 @@ typedef struct st_net {
char net_skip_rest_factor;
my_bool thread_specific_malloc;
unsigned char compress;
my_bool unused3; /* Please remove with the next incompatible ABI change. */
my_bool pkt_nr_can_be_reset;
/*
Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet

View File

@ -23,7 +23,7 @@ ${CMAKE_SOURCE_DIR}/libmysqld
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/tpool
${CMAKE_BINARY_DIR}/sql
${PCRE_INCLUDES}
${PCRE_INCLUDE_DIRS}
${LIBFMT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}

View File

@ -15,7 +15,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include
${PCRE_INCLUDES}
${PCRE_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/sql
${MY_READLINE_INCLUDE_DIR}
)

View File

@ -634,8 +634,6 @@ int init_embedded_server(int argc, char **argv, char **groups)
udf_init();
#endif
(void) thr_setconcurrency(concurrency); // 10 by default
if (flush_time && flush_time != ~(ulong) 0L)
start_handle_manager();

View File

@ -3212,7 +3212,8 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value, size_t
{
longlong data= my_strtoll10(value, &endptr, &err);
*param->error= (IS_TRUNCATED(data, param->is_unsigned,
INT_MIN32, INT_MAX32, UINT_MAX32) || err > 0);
(longlong) INT_MIN32, (longlong) INT_MAX32,
(longlong) UINT_MAX32) || err > 0);
longstore(buffer, (int32) data);
break;
}
@ -3329,7 +3330,8 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
break;
case MYSQL_TYPE_LONG:
*param->error= IS_TRUNCATED(value, param->is_unsigned,
INT_MIN32, INT_MAX32, UINT_MAX32);
(longlong) INT_MIN32, (longlong) INT_MAX32,
(longlong) UINT_MAX32);
longstore(buffer, (int32) value);
break;
case MYSQL_TYPE_LONGLONG:

View File

@ -1,9 +1,9 @@
--source include/have_compress.inc
# Test that the system is using the default/standard bzip library.
# Test that the system is using the default/standard zlib library.
# If not, we have to skip the test as the compression lengths displayed
# in the test will not match the results from used compression library.
if (`select length(COMPRESS(space(5000))) != 33`) {
skip Test skipped as standard bzip is needed;
skip Test skipped as standard zlib is needed;
}

View File

@ -0,0 +1,30 @@
# Purpose:
# Print first LINES_TO_READ from a file.
# The environment variables SEARCH_FILE and LINES_TO_READ must be set
# before sourcing this routine.
# Use:
# When the test is slow ( example because of ASAN build) then it
# may not flush the lines when 'cat' command is called and the
# test could fail with missing lines. Hence this can be used to
# to print first N lines.
#
perl;
use strict;
my $search_file = $ENV{SEARCH_FILE} or die "SEARCH_FILE not set";
my $lines_to_read = $ENV{LINES_TO_READ} or die "LINES_TO_READ not set";
open(FILE, '<', $search_file) or die "Can't open file $search_file: $!";
my $line_count = 0;
while ($line_count < $lines_to_read and my $line = <FILE>)
{
print $line;
$line_count++;
}
close(FILE);
EOF

View File

@ -51,12 +51,15 @@
# Created: 2011-11-11 mleich
#
--error 0,1
perl;
use strict;
die "SEARCH_FILE not set" unless $ENV{SEARCH_FILE};
my @search_files= glob($ENV{SEARCH_FILE});
my $search_pattern= $ENV{SEARCH_PATTERN} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{SEARCH_RANGE};
my $silent= $ENV{SEARCH_SILENT};
my $search_result= 0;
my $content;
foreach my $search_file (@search_files) {
open(FILE, '<', $search_file) || die("Can't open file $search_file: $!");
@ -89,16 +92,39 @@ perl;
{
@matches=($content =~ /$search_pattern/gm);
}
my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
my $res;
if (@matches)
{
$res="FOUND " . scalar(@matches);
$search_result= 1;
}
else
{
$res= "NOT FOUND";
}
$ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1};
if ($ENV{SEARCH_OUTPUT} eq "matches") {
foreach (@matches) {
if (!$silent || $search_result)
{
if ($ENV{SEARCH_OUTPUT} eq "matches")
{
foreach (@matches)
{
print $_ . "\n";
}
} else {
}
else
{
print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n";
}
}
die "$ENV{SEARCH_ABORT}\n"
if $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/;
exit($search_result != 1);
EOF
let $SEARCH_RESULT= 1; # Found pattern
if ($errno)
{
let $SEARCH_RESULT= 0; # Did not find pattern
}

View File

@ -0,0 +1,56 @@
# ==== Purpose ====
#
# Waits until pattern comes into log file or until a timeout is reached.
# This is a timeout wrapper for search_pattern_in_file.inc
#
#
# ==== Usage ====
#
# [--let $timeout= NUMBER in seconds]
# For other parameters, check search_pattern_in_file.inc
--let $wait_save_keep_include_silent=$keep_include_silent
--let $include_filename= wait_for_pattern_in_file.inc
--source include/begin_include_file.inc
--let $keep_include_silent= 1
let $_timeout= $timeout;
if (!$_timeout)
{
let $_timeout= 10;
if ($VALGRIND_TEST)
{
let $_timeout= 30;
}
}
let $_timeout_counter=`SELECT $_timeout * 10`;
let SEARCH_SILENT=1;
let $_continue= 1;
while ($_continue)
{
source include/search_pattern_in_file.inc;
if ($SEARCH_RESULT)
{
# Found match
let $_continue= 0;
}
if (!$SEARCH_RESULT)
{
dec $_timeout_counter;
if ($_timeout_counter == 1)
{
let $SEARCH_SILENT= 0;
}
if (!$_timeout_counter)
{
let $_continue= 0;
}
}
}
let SEARCH_SILENT=0;
--source include/end_include_file.inc
--let $keep_include_silent=$wait_save_keep_include_silent

View File

@ -892,6 +892,12 @@ sub collect_one_test_case {
}
my @no_combs = grep { $test_combs{$_} == 1 } keys %test_combs;
if (@no_combs) {
if ($::opt_skip_not_found) {
push @{$tinfo->{combinations}}, @no_combs;
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "combination not found";
return $tinfo;
}
mtr_error("Could not run $name with '".(
join(',', sort @no_combs))."' combination(s)");
}

View File

@ -768,14 +768,11 @@ INSERT INTO t1 VALUES (-1.0);
SELECT * FROM t1;
DROP TABLE t1;
#enable after MDEV-32645 is fixed
--disable_view_protocol
SELECT CAST(-1e0 AS UNSIGNED);
CREATE TABLE t1 (a BIGINT UNSIGNED);
INSERT INTO t1 VALUES (-1e0);
SELECT * FROM t1;
DROP TABLE t1;
--enable_view_protocol
SELECT CAST(-1e308 AS UNSIGNED);
CREATE TABLE t1 (a BIGINT UNSIGNED);

View File

@ -1,6 +1,6 @@
--source include/have_innodb.inc
--source include/have_csv.inc
--source include/have_normal_bzip.inc
--source include/have_normal_zlib.inc
let $MYSQLD_DATADIR= `select @@datadir`;

View File

@ -1,6 +1,6 @@
--source include/have_innodb.inc
--source include/have_normal_zlib.inc
--source include/master-slave.inc
--source include/have_normal_bzip.inc
--let $engine_type= myisam
--let $engine_type2= innodb

View File

@ -18,3 +18,23 @@ connect(localhost,root,,test,MASTER_MYPORT,MYSQL_TMP_DIR/mysqld.1.sock);
connect con2,localhost,root;
ERROR HY000: Received malformed packet
set global debug_dbug=@old_dbug;
#
# Start of 11.2 tests
#
#
# MDEV-33182 Server assertion fails when trying to test the connection with DBeaver
#
SET global debug_dbug='+d,thd_init_client_charset_utf8mb3_bin';
connect con1,localhost,root;
connection con1;
SHOW VARIABLES LIKE 'collation%';
Variable_name Value
collation_connection utf8mb3_bin
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci
disconnect con1;
connection default;
SET global debug_dbug=@old_debug;
#
# End of 11.2 tests
#

View File

@ -37,3 +37,24 @@ set global debug_dbug='+d,poison_srv_handshake_scramble_len';
--error 2027
connect con2,localhost,root;
set global debug_dbug=@old_dbug;
--echo #
--echo # Start of 11.2 tests
--echo #
--echo #
--echo # MDEV-33182 Server assertion fails when trying to test the connection with DBeaver
--echo #
SET global debug_dbug='+d,thd_init_client_charset_utf8mb3_bin';
connect con1,localhost,root;
connection con1;
SHOW VARIABLES LIKE 'collation%';
disconnect con1;
connection default;
SET global debug_dbug=@old_debug;
--echo #
--echo # End of 11.2 tests
--echo #

View File

@ -2636,4 +2636,49 @@ a
1
1
DROP TABLE t1;
#
# MDEV-31657: CTE with the same name as base table used twice
# in another CTE
#
create table t (a int);
insert into t values (3), (7), (1);
with
t as (select * from t),
cte as (select t1.a as t1a, t2.a as t2a from t as t1, t as t2 where t1.a=t2.a)
select * from cte;
t1a t2a
3 3
7 7
1 1
create table s (a int);
insert into s values (1), (4), (7);
with
t as (select * from t),
s as (select a-1 as a from s),
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
union
select t.a+1, s.a+1 from t, s where t.a=s.a+1)
select * from cte;
ta sa
3 3
2 1
8 7
with
t as (select * from t),
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
union
select t.a+1, s.a+1 from t, s where t.a=s.a),
s as (select a+10 as a from s)
select * from cte;
ta sa
1 1
7 7
2 2
8 8
drop table t,s;
with
t as (select * from t),
cte as (select t1.a as t1a, t2.a as t2a from t as t1, t as t2 where t1.a=t2.a)
select * from cte;
ERROR 42S02: Table 'test.t' doesn't exist
# End of 10.4 tests

View File

@ -1979,4 +1979,50 @@ SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-31657: CTE with the same name as base table used twice
--echo # in another CTE
--echo #
create table t (a int);
insert into t values (3), (7), (1);
let $q1=
with
t as (select * from t),
cte as (select t1.a as t1a, t2.a as t2a from t as t1, t as t2 where t1.a=t2.a)
select * from cte;
eval $q1;
create table s (a int);
insert into s values (1), (4), (7);
let $q2=
with
t as (select * from t),
s as (select a-1 as a from s),
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
union
select t.a+1, s.a+1 from t, s where t.a=s.a+1)
select * from cte;
eval $q2;
let $q3=
with
t as (select * from t),
cte as (select t.a as ta, s.a as sa from t, s where t.a=s.a
union
select t.a+1, s.a+1 from t, s where t.a=s.a),
s as (select a+10 as a from s)
select * from cte;
eval $q3;
drop table t,s;
--ERROR ER_NO_SUCH_TABLE
eval $q1;
--echo # End of 10.4 tests

View File

@ -459,3 +459,43 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1249 Select 4 was reduced during optimization
#
# End of 10.4 tests
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
EXPLAIN SELECT * FROM t1, t2 WHERE t2.b IN (SELECT 5 UNION SELECT 6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
EXPLAIN DELETE t2 FROM t1, t2 WHERE t2.b IN (SELECT 5 UNION SELECT 6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
prepare stmt from "EXPLAIN DELETE t2 FROM t1, t2 WHERE t2.b IN (SELECT 5 UNION SELECT 6)";
execute stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
execute stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
DROP TABLE t1, t2;
#
# End of 10.5 tests
#

View File

@ -373,3 +373,26 @@ drop table t1;
explain
VALUES ( (VALUES (2))) UNION VALUES ( (SELECT 3));
--enable_ps_protocol
--echo #
--echo # End of 10.4 tests
--echo #
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
EXPLAIN SELECT * FROM t1, t2 WHERE t2.b IN (SELECT 5 UNION SELECT 6);
EXPLAIN DELETE t2 FROM t1, t2 WHERE t2.b IN (SELECT 5 UNION SELECT 6);
prepare stmt from "EXPLAIN DELETE t2 FROM t1, t2 WHERE t2.b IN (SELECT 5 UNION SELECT 6)";
execute stmt;
execute stmt;
# Cleanup
DROP TABLE t1, t2;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -1,5 +1,5 @@
-- source include/have_compress.inc
-- source include/have_normal_bzip.inc
-- source include/have_normal_zlib.inc
#
# Test for compress and uncompress functions:
#

View File

@ -1460,6 +1460,39 @@ f
foo
SET @@COLLATION_CONNECTION= @old_collation_connection;
#
# MDEV-32587 JSON_VALID fail to validate integer zero in scientific notation
#
select JSON_VALID(' {"number": 1E-4}');
JSON_VALID(' {"number": 1E-4}')
1
select JSON_VALID(' {"number": 0E-4}');
JSON_VALID(' {"number": 0E-4}')
1
select JSON_VALID(' {"number": 0.0}');
JSON_VALID(' {"number": 0.0}')
1
select JSON_VALID(' {"number": 0.1E-4}');
JSON_VALID(' {"number": 0.1E-4}')
1
select JSON_VALID(' {"number": 0e-4}');
JSON_VALID(' {"number": 0e-4}')
1
select JSON_VALID(' {"number": -0E-4}');
JSON_VALID(' {"number": -0E-4}')
1
select JSON_VALUE(' {"number": 0E-4}', '$.number');
JSON_VALUE(' {"number": 0E-4}', '$.number')
0E-4
select JSON_VALID(' {"number": 00E-4}');
JSON_VALID(' {"number": 00E-4}')
0
select JSON_VALID(' {"number": 01E-4}');
JSON_VALID(' {"number": 01E-4}')
0
select JSON_VALID(' {"number": 0E-4.0}');
JSON_VALID(' {"number": 0E-4.0}')
0
#
# End of 10.4 tests
#
#

View File

@ -949,6 +949,22 @@ SELECT JSON_VALUE('["foo"]', '$**[0]') AS f;
SET @@COLLATION_CONNECTION= @old_collation_connection;
--echo #
--echo # MDEV-32587 JSON_VALID fail to validate integer zero in scientific notation
--echo #
# Passing
select JSON_VALID(' {"number": 1E-4}');
select JSON_VALID(' {"number": 0E-4}');
select JSON_VALID(' {"number": 0.0}');
select JSON_VALID(' {"number": 0.1E-4}');
select JSON_VALID(' {"number": 0e-4}');
select JSON_VALID(' {"number": -0E-4}');
select JSON_VALUE(' {"number": 0E-4}', '$.number');
# Failing
select JSON_VALID(' {"number": 00E-4}');
select JSON_VALID(' {"number": 01E-4}');
select JSON_VALID(' {"number": 0E-4.0}');
--echo #
--echo # End of 10.4 tests
--echo #

View File

@ -5286,6 +5286,33 @@ ERROR 42000: Incorrect parameter count in the call to native function 'DECODE'
# End of 10.4 tests
#
#
# Start of 10.5 tests
#
#
# MDEV-28651 quote(NULL) returns incorrect result in view ('NU' instead of 'NULL')
#
CREATE VIEW v1 AS SELECT quote(NULL);
SELECT * FROM v1;
quote(NULL)
NULL
DESCRIBE v1;
Field Type Null Key Default Extra
quote(NULL) varbinary(4) YES NULL
CREATE TABLE t1 AS SELECT * FROM v1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`quote(NULL)` varbinary(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT * FROM t1;
quote(NULL)
NULL
DROP TABLE t1;
DROP VIEW v1;
#
# End of 10.5 tests
#
#
# MDEV-25704 Function random_bytes
#
create table t1 as select random_bytes(100);

View File

@ -2333,6 +2333,28 @@ SELECT DECODE(NULL, NULL, NULL);
--echo # End of 10.4 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-28651 quote(NULL) returns incorrect result in view ('NU' instead of 'NULL')
--echo #
CREATE VIEW v1 AS SELECT quote(NULL);
SELECT * FROM v1;
DESCRIBE v1;
CREATE TABLE t1 AS SELECT * FROM v1;
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
DROP VIEW v1;
--echo #
--echo # End of 10.5 tests
--echo #
--echo #
--echo # MDEV-25704 Function random_bytes
--echo #

View File

@ -5328,5 +5328,112 @@ SELECT BIT_XOR(a) FROM t1;
ERROR HY000: Illegal parameter data type geometry for operation 'bit_xor('
DROP TABLE t1;
#
# MDEV-27666 User variable not parsed as geometry variable in geometry function.
#
set @g= point(1, 1);
select ST_AsWKT(GeometryCollection(Point(44, 6), @g));
ST_AsWKT(GeometryCollection(Point(44, 6), @g))
GEOMETRYCOLLECTION(POINT(44 6),POINT(1 1))
set @g= "just a string";
select ST_AsWKT(GeometryCollection(Point(44, 6), @g));
ERROR HY000: Illegal parameter data type longblob for operation 'geometrycollection'
SET @g= LineString(Point(0,0), Point(0,1));
SELECT AsText(PointN(@g, 1));
AsText(PointN(@g, 1))
POINT(0 0)
SELECT AsText(PointN(@g, 2));
AsText(PointN(@g, 2))
POINT(0 1)
SET @g= Point(1, 1);
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` point DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
POINT(1 1)
DROP TABLE t1;
SET @g= MultiPoint(Point(1, 1), Point(-1,-1));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` multipoint DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
MULTIPOINT(1 1,-1 -1)
DROP TABLE t1;
SET @g= LineString(Point(1, 1), Point(2,2));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` linestring DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
LINESTRING(1 1,2 2)
DROP TABLE t1;
SET @g= MultiLineString(LineString(Point(1, 1), Point(2,2)),
LineString(Point(-1, -1), Point(-2,-2)));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` multilinestring DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
MULTILINESTRING((1 1,2 2),(-1 -1,-2 -2))
DROP TABLE t1;
SET @g= Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` polygon DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
POLYGON((0 0,30 0,30 30,0 0))
DROP TABLE t1;
SET @g= MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3),
Point(3, 0), Point(0, 3))));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` multipolygon DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
DROP TABLE t1;
SET @g= GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` geometrycollection DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
DROP TABLE t1;
SET @g= GeometryFromText('POINT(1 1)');
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` geometry DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT AsText(g) FROM t1;
AsText(g)
POINT(1 1)
DROP TABLE t1;
#
# End of 10.5 tests
#

View File

@ -1,5 +1,5 @@
-- source include/have_geometry.inc
-- source include/not_embedded.inc
#
# Spatial objects
@ -3374,6 +3374,69 @@ SELECT BIT_OR(a) FROM t1;
SELECT BIT_XOR(a) FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-27666 User variable not parsed as geometry variable in geometry function.
--echo #
set @g= point(1, 1);
select ST_AsWKT(GeometryCollection(Point(44, 6), @g));
set @g= "just a string";
--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
select ST_AsWKT(GeometryCollection(Point(44, 6), @g));
SET @g= LineString(Point(0,0), Point(0,1));
SELECT AsText(PointN(@g, 1));
SELECT AsText(PointN(@g, 2));
SET @g= Point(1, 1);
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
SET @g= MultiPoint(Point(1, 1), Point(-1,-1));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
SET @g= LineString(Point(1, 1), Point(2,2));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
SET @g= MultiLineString(LineString(Point(1, 1), Point(2,2)),
LineString(Point(-1, -1), Point(-2,-2)));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
SET @g= Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
SET @g= MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3),
Point(3, 0), Point(0, 3))));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
SET @g= GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)));
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
SET @g= GeometryFromText('POINT(1 1)');
CREATE TABLE t1 AS SELECT @g AS g;
SHOW CREATE TABLE t1;
SELECT AsText(g) FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.5 tests

View File

@ -1,14 +1,9 @@
SET SQL_MODE="";
SET @old_general_log_state = @@global.general_log;
SET @old_log_output= @@global.log_output;
SET @old_slow_query_log= @@global.slow_query_log;
SET @old_general_log= @@global.general_log;
SET @old_long_query_time= @@session.long_query_time;
use mysql;
SET @saved_long_query_time = @@long_query_time;
SET @saved_log_output = @@log_output;
SET @saved_general_log = @@GLOBAL.general_log;
SET @saved_slow_query_log = @@GLOBAL.slow_query_log;
truncate table general_log;
select * from general_log;
event_time user_host thread_id server_id command_type argument
@ -120,6 +115,9 @@ show open tables;
Database Table In_use Name_locked
SET GLOBAL GENERAL_LOG=ON;
SET GLOBAL SLOW_QUERY_LOG=ON;
#
# Bug#23924 general_log truncates queries with character set introducers.
#
truncate table mysql.general_log;
set names binary;
select _koi8r'<27><><EFBFBD><EFBFBD>' as test;
@ -131,6 +129,9 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query set names binary
TIMESTAMP USER_HOST THREAD_ID 1 Query select _koi8r'\xD4\xC5\xD3\xD4' as test
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.general_log
set names utf8;
#
# Bug #16905 Log tables: unicode statements are logged incorrectly
#
truncate table mysql.general_log;
set names utf8;
create table bug16905 (s char(15) character set utf8 default 'пусто');
@ -142,6 +143,9 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query create table bug16905 (s char(15) characte
TIMESTAMP USER_HOST THREAD_ID 1 Query insert into bug16905 values ('новое')
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.general_log
drop table bug16905;
#
# Bug #17600: Invalid data logged into mysql.slow_log
#
truncate table mysql.slow_log;
set session long_query_time=1;
select sleep(2);
@ -150,7 +154,11 @@ sleep(2)
select * from mysql.slow_log;
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 mysql 0 0 1 select sleep(2) THREAD_ID 0
set @@session.long_query_time = @saved_long_query_time;
set @@session.long_query_time = @old_long_query_time;
#
# Bug #18559 log tables cannot change engine, and gets deadlocked when
# dropping w/ log on
#
alter table mysql.general_log engine=myisam;
ERROR HY000: You cannot 'ALTER' a log table if logging is enabled
alter table mysql.slow_log engine=myisam;
@ -232,7 +240,7 @@ TIMESTAMP USER_HOST THREAD_ID 1 Query truncate table mysql.slow_log
TIMESTAMP USER_HOST THREAD_ID 1 Query set session long_query_time=1
TIMESTAMP USER_HOST THREAD_ID 1 Query select sleep(2)
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.slow_log
TIMESTAMP USER_HOST THREAD_ID 1 Query set @@session.long_query_time = @saved_long_query_time
TIMESTAMP USER_HOST THREAD_ID 1 Query set @@session.long_query_time = @old_long_query_time
TIMESTAMP USER_HOST THREAD_ID 1 Query alter table mysql.general_log engine=myisam
TIMESTAMP USER_HOST THREAD_ID 1 Query alter table mysql.slow_log engine=myisam
TIMESTAMP USER_HOST THREAD_ID 1 Query drop table mysql.general_log
@ -300,17 +308,20 @@ ON UPDATE CURRENT_TIMESTAMP,
set global general_log='ON';
set global slow_query_log='ON';
use test;
#
# Bug #20139 Infinite loop after "FLUSH" and "LOCK tabX, general_log"
#
flush tables with read lock;
unlock tables;
use mysql;
lock tables general_log read local, help_category read local;
ERROR HY000: You can't use locks with log tables
unlock tables;
#
# Bug #17544 Cannot do atomic log rotate and
# Bug #21785 Server crashes after rename of the log table
#
SET SESSION long_query_time = 1000;
drop table if exists mysql.renamed_general_log;
drop table if exists mysql.renamed_slow_log;
drop table if exists mysql.general_log_new;
drop table if exists mysql.slow_log_new;
use mysql;
RENAME TABLE general_log TO renamed_general_log;
ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log'
@ -356,13 +367,16 @@ set global slow_query_log='ON';
ERROR 42S02: Table 'mysql.slow_log' doesn't exist
RENAME TABLE general_log2 TO general_log;
RENAME TABLE slow_log2 TO slow_log;
SET SESSION long_query_time = @saved_long_query_time;
SET SESSION long_query_time = @old_long_query_time;
set global general_log='ON';
set global slow_query_log='ON';
flush logs;
flush logs;
drop table renamed_general_log, renamed_slow_log;
use test;
#
# Bug #21966 Strange warnings on repair of the log tables
#
use mysql;
repair table general_log;
Table Op Msg_type Msg_text
@ -380,6 +394,10 @@ slow_log
slow_log_new
drop table slow_log_new, general_log_new;
use test;
#
# Bug#69953 / MDEV-4851
# Log tables should be modifable on LOG_OUTPUT != TABLE
#
SET GLOBAL LOG_OUTPUT = 'FILE';
SET GLOBAL slow_query_log = 1;
SET GLOBAL general_log = 1;
@ -388,6 +406,10 @@ ALTER TABLE mysql.general_log ADD COLUMN comment_text TEXT NOT NULL;
SET GLOBAL LOG_OUTPUT = 'NONE';
ALTER TABLE mysql.slow_log DROP COLUMN comment_text;
ALTER TABLE mysql.general_log DROP COLUMN comment_text;
#
# Bug#27857 (Log tables supplies the wrong value for generating
# AUTO_INCREMENT numbers)
#
SET GLOBAL LOG_OUTPUT = 'TABLE';
SET GLOBAL general_log = 0;
FLUSH LOGS;
@ -451,16 +473,15 @@ START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own sl
START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) THREAD_ID 0 3
START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) THREAD_ID 0 4
SET GLOBAL slow_query_log = 0;
SET SESSION long_query_time =@saved_long_query_time;
SET SESSION long_query_time =@old_long_query_time;
FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq;
ALTER TABLE mysql.slow_log ENGINE = CSV;
SET GLOBAL general_log = @old_general_log;
SET GLOBAL slow_query_log = @old_slow_query_log;
drop procedure if exists proc25422_truncate_slow;
drop procedure if exists proc25422_truncate_general;
drop procedure if exists proc25422_alter_slow;
drop procedure if exists proc25422_alter_general;
#
# Bug#25422 (Hang with log tables)
#
use test//
create procedure proc25422_truncate_slow (loops int)
begin
@ -485,26 +506,26 @@ end//
create procedure proc25422_alter_slow (loops int)
begin
declare v1 int default 0;
declare old_log_state int default @@global.slow_query_log;
declare ER_BAD_LOG_STATEMENT condition for 1575;
declare continue handler for ER_BAD_LOG_STATEMENT begin end;
while v1 < loops do
set @old_log_state = @@global.slow_query_log;
set global slow_query_log = 'OFF';
alter table mysql.slow_log engine = CSV;
set global slow_query_log = @old_log_state;
set global slow_query_log = old_log_state;
set v1 = v1 + 1;
end while;
end//
create procedure proc25422_alter_general (loops int)
begin
declare v1 int default 0;
declare old_log_state int default @@global.general_log;
declare ER_BAD_LOG_STATEMENT condition for 1575;
declare continue handler for ER_BAD_LOG_STATEMENT begin end;
while v1 < loops do
set @old_log_state = @@global.general_log;
set global general_log = 'OFF';
alter table mysql.general_log engine = CSV;
set global general_log = @old_log_state;
set global general_log = old_log_state;
set v1 = v1 + 1;
end while;
end//
@ -563,17 +584,19 @@ drop procedure proc25422_truncate_slow;
drop procedure proc25422_truncate_general;
drop procedure proc25422_alter_slow;
drop procedure proc25422_alter_general;
#
# Bug#23044 (Warnings on flush of a log table)
#
FLUSH TABLE mysql.general_log;
show warnings;
Level Code Message
FLUSH TABLE mysql.slow_log;
show warnings;
Level Code Message
DROP TABLE IF EXISTS `db_17876.slow_log_data`;
DROP TABLE IF EXISTS `db_17876.general_log_data`;
DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`;
#
# Bug#17876 (Truncating mysql.slow_log in a SP after using cursor locks the
# thread)
#
CREATE DATABASE db_17876;
CREATE TABLE `db_17876.slow_log_data` (
`start_time` timestamp(6) default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
@ -686,6 +709,9 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`;
SET GLOBAL general_log = @old_general_log;
SET GLOBAL slow_query_log = @old_slow_query_log;
#
# Bug#21557 entries in the general query log truncated at 1000 characters.
#
select CONNECTION_ID() into @thread_id;
truncate table mysql.general_log;
set global general_log = on;
@ -902,9 +928,9 @@ select '000 001 002 003 004 005 006 007 008 009010 011 012 013 014 015 016 017 0
set global general_log = off
deallocate prepare long_query;
set global general_log = @old_general_log;
DROP TABLE IF EXISTS log_count;
DROP TABLE IF EXISTS slow_log_copy;
DROP TABLE IF EXISTS general_log_copy;
#
# Bug#34306: Can't make copy of log tables when server binary log is enabled
#
CREATE TABLE log_count (count BIGINT(21));
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
@ -926,9 +952,12 @@ CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
DROP TABLE general_log_copy;
SET GLOBAL general_log = @saved_general_log;
SET GLOBAL slow_query_log = @saved_slow_query_log;
SET GLOBAL general_log = @old_general_log;
SET GLOBAL slow_query_log = @old_slow_query_log;
DROP TABLE log_count;
#
# Bug #31700: thd->examined_row_count not incremented for 'const' type queries
#
SET SESSION long_query_time = 0;
SET GLOBAL slow_query_log = ON;
FLUSH LOGS;
@ -954,9 +983,10 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1
TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
#
# Bug #47924 main.log_tables times out sporadically
#
use mysql;
drop table if exists renamed_general_log;
drop table if exists renamed_slow_log;
RENAME TABLE general_log TO renamed_general_log;
ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log'
RENAME TABLE slow_log TO renamed_slow_log;
@ -964,7 +994,34 @@ ERROR HY000: Cannot rename 'slow_log'. When logging enabled, rename to/from log
use test;
flush tables with read lock;
unlock tables;
SET @@session.long_query_time= @old_long_query_time;
#
# MDEV-33267 User with minimal permissions can intentionally corrupt mysql.slow_log table
#
truncate mysql.slow_log;
set global log_output= 'TABLE';
create user u@localhost;
set slow_query_log=on, long_query_time=0.1;
select 'before evil-doing', sleep(0.2);
before evil-doing sleep(0.2)
before evil-doing 0
connect con1,localhost,u,,;
set @@timestamp= 2147483647;
set slow_query_log=on, long_query_time=0.1;
select 'evil-doing', sleep(1.1);
evil-doing sleep(1.1)
evil-doing 0
disconnect con1;
connection default;
select 'after evil-doing', sleep(0.2);
after evil-doing sleep(0.2)
after evil-doing 0
select distinct sql_text from mysql.slow_log where sql_text like '%evil%';
sql_text
select 'before evil-doing', sleep(0.2)
select 'evil-doing', sleep(1.1)
select 'after evil-doing', sleep(0.2)
set global log_output=default;
drop user u@localhost;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
SET @@global.general_log= @old_general_log;

View File

@ -1,13 +1,9 @@
# this test needs multithreaded mysqltest
-- source include/not_embedded.inc
#
# Basic log tables test
#
# check that CSV engine was compiled in
--source include/have_csv.inc
SET SQL_MODE="";
SET @old_general_log_state = @@global.general_log;
SET @old_log_output= @@global.log_output;
SET @old_slow_query_log= @@global.slow_query_log;
SET @old_general_log= @@global.general_log;
@ -16,16 +12,9 @@ SET @old_long_query_time= @@session.long_query_time;
--disable_ps_protocol
use mysql;
# Capture initial settings of system variables
# so that we can revert to old state after manipulation for testing
# NOTE: PLEASE USE THESE VALUES TO 'RESET' SYSTEM VARIABLES
# Capturing old values within the tests results in loss of values
# due to people not paying attention to previous tests' changes, captures
# or improper cleanup
SET @saved_long_query_time = @@long_query_time;
SET @saved_log_output = @@log_output;
SET @saved_general_log = @@GLOBAL.general_log;
SET @saved_slow_query_log = @@GLOBAL.slow_query_log;
#
# Basic log tables test
#
#
# Check that log tables work and we can do basic selects. This also
@ -147,9 +136,9 @@ show open tables;
SET GLOBAL GENERAL_LOG=ON;
SET GLOBAL SLOW_QUERY_LOG=ON;
#
# Bug#23924 general_log truncates queries with character set introducers.
#
--echo #
--echo # Bug#23924 general_log truncates queries with character set introducers.
--echo #
truncate table mysql.general_log;
set names binary;
select _koi8r'<27><><EFBFBD><EFBFBD>' as test;
@ -157,9 +146,9 @@ select _koi8r'
select * from mysql.general_log;
set names utf8;
#
# Bug #16905 Log tables: unicode statements are logged incorrectly
#
--echo #
--echo # Bug #16905 Log tables: unicode statements are logged incorrectly
--echo #
truncate table mysql.general_log;
set names utf8;
@ -169,21 +158,21 @@ insert into bug16905 values ('новое');
select * from mysql.general_log;
drop table bug16905;
#
# Bug #17600: Invalid data logged into mysql.slow_log
#
--echo #
--echo # Bug #17600: Invalid data logged into mysql.slow_log
--echo #
truncate table mysql.slow_log;
set session long_query_time=1;
select sleep(2);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME 12 THREAD_ID
select * from mysql.slow_log;
set @@session.long_query_time = @saved_long_query_time;
set @@session.long_query_time = @old_long_query_time;
#
# Bug #18559 log tables cannot change engine, and gets deadlocked when
# dropping w/ log on
#
--echo #
--echo # Bug #18559 log tables cannot change engine, and gets deadlocked when
--echo # dropping w/ log on
--echo #
# check that appropriate error messages are given when one attempts to alter
# or drop a log tables, while corresponding logs are enabled
@ -322,9 +311,9 @@ set global general_log='ON';
set global slow_query_log='ON';
use test;
#
# Bug #20139 Infinite loop after "FLUSH" and "LOCK tabX, general_log"
#
--echo #
--echo # Bug #20139 Infinite loop after "FLUSH" and "LOCK tabX, general_log"
--echo #
flush tables with read lock;
unlock tables;
@ -333,18 +322,12 @@ use mysql;
lock tables general_log read local, help_category read local;
unlock tables;
#
# Bug #17544 Cannot do atomic log rotate and
# Bug #21785 Server crashes after rename of the log table
#
--echo #
--echo # Bug #17544 Cannot do atomic log rotate and
--echo # Bug #21785 Server crashes after rename of the log table
--echo #
SET SESSION long_query_time = 1000;
--disable_warnings
drop table if exists mysql.renamed_general_log;
drop table if exists mysql.renamed_slow_log;
drop table if exists mysql.general_log_new;
drop table if exists mysql.slow_log_new;
--enable_warnings
use mysql;
# Should result in error
@ -399,7 +382,7 @@ set global slow_query_log='ON';
RENAME TABLE general_log2 TO general_log;
RENAME TABLE slow_log2 TO slow_log;
SET SESSION long_query_time = @saved_long_query_time;
SET SESSION long_query_time = @old_long_query_time;
# this should work
set global general_log='ON';
@ -427,13 +410,6 @@ use test;
# TODO: improve filtering of expected errors in master.err in
# mysql-test-run.pl (based on the test name ?), and uncomment this test.
# --disable_warnings
# drop table if exists mysql.bad_general_log;
# drop table if exists mysql.bad_slow_log;
# drop table if exists mysql.general_log_hide;
# drop table if exists mysql.slow_log_hide;
# --enable_warnings
#
# create table mysql.bad_general_log (a int) engine= CSV;
# create table mysql.bad_slow_log (a int) engine= CSV;
#
@ -459,9 +435,9 @@ use test;
# drop table mysql.bad_general_log;
# drop table mysql.bad_slow_log;
#
# Bug #21966 Strange warnings on repair of the log tables
#
--echo #
--echo # Bug #21966 Strange warnings on repair of the log tables
--echo #
use mysql;
# check that no warning occurs on repair of the log tables
@ -474,11 +450,10 @@ show tables like "%log%";
drop table slow_log_new, general_log_new;
use test;
#
# Bug#69953 / MDEV-4851
# Log tables should be modifable on LOG_OUTPUT != TABLE
#
#
--echo #
--echo # Bug#69953 / MDEV-4851
--echo # Log tables should be modifable on LOG_OUTPUT != TABLE
--echo #
SET GLOBAL LOG_OUTPUT = 'FILE';
SET GLOBAL slow_query_log = 1;
@ -492,10 +467,10 @@ ALTER TABLE mysql.slow_log DROP COLUMN comment_text;
ALTER TABLE mysql.general_log DROP COLUMN comment_text;
#
# Bug#27857 (Log tables supplies the wrong value for generating
# AUTO_INCREMENT numbers)
#
--echo #
--echo # Bug#27857 (Log tables supplies the wrong value for generating
--echo # AUTO_INCREMENT numbers)
--echo #
SET GLOBAL LOG_OUTPUT = 'TABLE';
@ -554,7 +529,7 @@ SELECT "My own slow query", sleep(2);
SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3;
SET GLOBAL slow_query_log = 0;
SET SESSION long_query_time =@saved_long_query_time;
SET SESSION long_query_time =@old_long_query_time;
FLUSH LOGS;
ALTER TABLE mysql.slow_log DROP COLUMN seq;
@ -563,16 +538,9 @@ ALTER TABLE mysql.slow_log ENGINE = CSV;
SET GLOBAL general_log = @old_general_log;
SET GLOBAL slow_query_log = @old_slow_query_log;
#
# Bug#25422 (Hang with log tables)
#
--disable_warnings
drop procedure if exists proc25422_truncate_slow;
drop procedure if exists proc25422_truncate_general;
drop procedure if exists proc25422_alter_slow;
drop procedure if exists proc25422_alter_general;
--enable_warnings
--echo #
--echo # Bug#25422 (Hang with log tables)
--echo #
delimiter //;
@ -602,14 +570,14 @@ end//
create procedure proc25422_alter_slow (loops int)
begin
declare v1 int default 0;
declare old_log_state int default @@global.slow_query_log;
declare ER_BAD_LOG_STATEMENT condition for 1575;
declare continue handler for ER_BAD_LOG_STATEMENT begin end;
while v1 < loops do
set @old_log_state = @@global.slow_query_log;
set global slow_query_log = 'OFF';
alter table mysql.slow_log engine = CSV;
set global slow_query_log = @old_log_state;
set global slow_query_log = old_log_state;
set v1 = v1 + 1;
end while;
end//
@ -617,14 +585,14 @@ end//
create procedure proc25422_alter_general (loops int)
begin
declare v1 int default 0;
declare old_log_state int default @@global.general_log;
declare ER_BAD_LOG_STATEMENT condition for 1575;
declare continue handler for ER_BAD_LOG_STATEMENT begin end;
while v1 < loops do
set @old_log_state = @@global.general_log;
set global general_log = 'OFF';
alter table mysql.general_log engine = CSV;
set global general_log = @old_log_state;
set global general_log = old_log_state;
set v1 = v1 + 1;
end while;
end//
@ -713,9 +681,9 @@ drop procedure proc25422_alter_general;
--enable_ps_protocol
#
# Bug#23044 (Warnings on flush of a log table)
#
--echo #
--echo # Bug#23044 (Warnings on flush of a log table)
--echo #
FLUSH TABLE mysql.general_log;
show warnings;
@ -723,18 +691,10 @@ show warnings;
FLUSH TABLE mysql.slow_log;
show warnings;
#
# Bug#17876 (Truncating mysql.slow_log in a SP after using cursor locks the
# thread)
#
--disable_warnings
DROP TABLE IF EXISTS `db_17876.slow_log_data`;
DROP TABLE IF EXISTS `db_17876.general_log_data`;
DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`;
DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`;
--enable_warnings
--echo #
--echo # Bug#17876 (Truncating mysql.slow_log in a SP after using cursor locks the
--echo # thread)
--echo #
CREATE DATABASE db_17876;
@ -872,9 +832,9 @@ DROP DATABASE IF EXISTS `db_17876`;
SET GLOBAL general_log = @old_general_log;
SET GLOBAL slow_query_log = @old_slow_query_log;
#
# Bug#21557 entries in the general query log truncated at 1000 characters.
#
--echo #
--echo # Bug#21557 entries in the general query log truncated at 1000 characters.
--echo #
select CONNECTION_ID() into @thread_id;
--disable_ps_protocol
@ -993,15 +953,9 @@ AND (command_type = 'Query' OR command_type= 'Execute');
deallocate prepare long_query;
set global general_log = @old_general_log;
#
# Bug#34306: Can't make copy of log tables when server binary log is enabled
#
--disable_warnings
DROP TABLE IF EXISTS log_count;
DROP TABLE IF EXISTS slow_log_copy;
DROP TABLE IF EXISTS general_log_copy;
--enable_warnings
--echo #
--echo # Bug#34306: Can't make copy of log tables when server binary log is enabled
--echo #
CREATE TABLE log_count (count BIGINT(21));
@ -1031,14 +985,14 @@ INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
DROP TABLE general_log_copy;
SET GLOBAL general_log = @saved_general_log;
SET GLOBAL slow_query_log = @saved_slow_query_log;
SET GLOBAL general_log = @old_general_log;
SET GLOBAL slow_query_log = @old_slow_query_log;
DROP TABLE log_count;
#
# Bug #31700: thd->examined_row_count not incremented for 'const' type queries
#
--echo #
--echo # Bug #31700: thd->examined_row_count not incremented for 'const' type queries
--echo #
SET SESSION long_query_time = 0;
SET GLOBAL slow_query_log = ON;
@ -1065,16 +1019,12 @@ DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
#
# Bug #47924 main.log_tables times out sporadically
#
--echo #
--echo # Bug #47924 main.log_tables times out sporadically
--echo #
use mysql;
# Should result in error
--disable_warnings
drop table if exists renamed_general_log;
drop table if exists renamed_slow_log;
--enable_warnings
--error ER_CANT_RENAME_LOG_TABLE
RENAME TABLE general_log TO renamed_general_log;
--error ER_CANT_RENAME_LOG_TABLE
@ -1084,7 +1034,24 @@ use test;
flush tables with read lock;
unlock tables;
SET @@session.long_query_time= @old_long_query_time;
--echo #
--echo # MDEV-33267 User with minimal permissions can intentionally corrupt mysql.slow_log table
--echo #
truncate mysql.slow_log;
set global log_output= 'TABLE';
create user u@localhost;
set slow_query_log=on, long_query_time=0.1;
select 'before evil-doing', sleep(0.2);
--connect (con1,localhost,u,,)
set @@timestamp= 2147483647;
set slow_query_log=on, long_query_time=0.1;
select 'evil-doing', sleep(1.1);
--disconnect con1
--connection default
select 'after evil-doing', sleep(0.2);
select distinct sql_text from mysql.slow_log where sql_text like '%evil%';
set global log_output=default;
drop user u@localhost;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;

View File

@ -653,5 +653,29 @@ f1 f2 f3 f4 f5 f6 f7
4 00004 0001009089999 netstes psit e
drop table t1;
#
# MDEV-29954 Unique hash key on column prefix is computed incorrectly
#
create table t1 (c char(10),unique key a using hash (c(1)));
insert into t1 values (0);
check table t1 extended;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
#
# MDEV-32837 long unique does not work like unique key when using replace
#
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
REPLACE INTO t1 VALUES (3,1,1);
SELECT * FROM t1 ORDER BY a;
a b c
2 2 2
3 1 1
REPLACE INTO t1 VALUES (3,2,2);
SELECT * FROM t1;
a b c
3 2 2
DROP TABLE t1;
#
# End of 10.5 tests
#

View File

@ -634,6 +634,27 @@ replace t1 (f2, f3, f4, f5, f6, f7) values ('00004', '0001009089999', '', 'netst
select * from t1;
drop table t1;
--echo #
--echo # MDEV-29954 Unique hash key on column prefix is computed incorrectly
--echo #
create table t1 (c char(10),unique key a using hash (c(1)));
insert into t1 values (0);
check table t1 extended;
drop table t1;
--echo #
--echo # MDEV-32837 long unique does not work like unique key when using replace
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
REPLACE INTO t1 VALUES (3,1,1);
SELECT * FROM t1 ORDER BY a;
REPLACE INTO t1 VALUES (3,2,2);
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -0,0 +1,95 @@
#
# Start of 10.5 tests
#
#
# MDEV-32837 long unique does not work like unique key when using replace
#
#
# Normal unique key + long unique key
#
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,1,1);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
Variable_name Value
Handler_delete 1
Handler_read_key 2
Handler_read_rnd 1
Handler_write 1
SELECT * FROM t1 ORDER BY a;
a b c
2 2 2
3 1 1
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,2,2);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
Variable_name Value
Handler_delete 1
Handler_read_key 3
Handler_read_rnd 2
Handler_update 1
Handler_write 1
SELECT * FROM t1;
a b c
3 2 2
DROP TABLE t1;
#
# Two long unique keys
#
CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE KEY a (a) USING HASH,UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,1,1);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
Variable_name Value
Handler_read_key 3
Handler_read_rnd 1
Handler_update 1
SELECT * FROM t1 ORDER BY a;
a b c
2 2 2
3 1 1
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,2,2);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
Variable_name Value
Handler_delete 1
Handler_read_key 4
Handler_read_rnd 2
Handler_update 1
SELECT * FROM t1;
a b c
3 2 2
DROP TABLE t1;
#
# One long unique key
#
CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,1,1);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
Variable_name Value
Handler_read_key 1
Handler_read_rnd 1
Handler_update 1
SELECT * FROM t1 ORDER BY a;
a b c
2 2 2
3 1 1
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,2,2);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
Variable_name Value
Handler_read_key 1
Handler_read_rnd 1
Handler_update 1
SELECT * FROM t1;
a b c
3 1 1
3 2 2
DROP TABLE t1;
#
# End of 10.5 tests
#

View File

@ -0,0 +1,68 @@
if (`SELECT $SP_PROTOCOL > 0`)
{
--skip Test requires: sp-protocol disabled
}
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-32837 long unique does not work like unique key when using replace
--echo #
# This test produces different Handler commands in the SHOW STATUS output
# with --sp-protocol. So it's here, in this *.test file with --sp-protocol disabled.
--echo #
--echo # Normal unique key + long unique key
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT, UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,1,1);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
SELECT * FROM t1 ORDER BY a;
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,2,2);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # Two long unique keys
--echo #
CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE KEY a (a) USING HASH,UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,1,1);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
SELECT * FROM t1 ORDER BY a;
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,2,2);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # One long unique key
--echo #
CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE KEY `test` (b,c) USING HASH) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,1),(2,2,2);
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,1,1);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
SELECT * FROM t1 ORDER BY a;
FLUSH STATUS;
REPLACE INTO t1 VALUES (3,2,2);
SHOW STATUS WHERE Variable_name LIKE 'handler%' AND Value>0;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -0,0 +1,24 @@
#
# regression introduced by MDEV-14448
#
delimiter $
select 1;
$
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is X
Server version: Y
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> delimiter $
MariaDB [(none)]> select 1;
-> $
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set
MariaDB [(none)]>

View File

@ -0,0 +1,29 @@
--echo #
--echo # regression introduced by MDEV-14448
--echo #
source include/not_embedded.inc;
source include/not_windows.inc;
error 0,1;
exec $MYSQL -V|grep -q readline;
if ($sys_errno == 1)
{
# strangely enough
skip does not work with libedit;
}
write_file $MYSQL_TMP_DIR/mysql_in;
delimiter $
select 1;
$
EOF
let TERM=dumb;
replace_regex /id is \d+/id is X/ /Server version: .*/Server version: Y/ / \(\d+\.\d+ sec\)//;
error 0,127;
exec socat EXEC:"$MYSQL",pty STDIO < $MYSQL_TMP_DIR/mysql_in;
if ($sys_errno == 127)
{
remove_file $MYSQL_TMP_DIR/mysql_in;
skip no socat;
}
remove_file $MYSQL_TMP_DIR/mysql_in;

View File

@ -30,6 +30,12 @@ show create table mysql_json_test;
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test` FORCE" or dump/reload to fix it!
select * from mysql_json_test;
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test` FORCE" or dump/reload to fix it!
CREATE TABLE t2 AS SELECT * FROM mysql_json_test;
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test` FORCE" or dump/reload to fix it!
CREATE TABLE t2 (a mysql_json /*new column*/) AS SELECT * FROM mysql_json_test;
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
CREATE TABLE t2 (actual mysql_json /*existing column*/) AS SELECT * FROM mysql_json_test;
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
LOCK TABLES mysql_json_test WRITE;
ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.mysql_json_test` FORCE" or dump/reload to fix it!
alter table mysql_json_test force;
@ -169,3 +175,67 @@ Total_Number_of_Tests Succesful_Tests String_is_valid_JSON
drop table tempty;
drop table mysql_json_test;
drop table mysql_json_test_big;
#
# MDEV-32790: Output result in show create table
# for mysql_json type should be longtext
#
create table t1(j json);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`j` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`j`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
create table t1(j mysql_json);
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
create table `testjson` (
`t` json /* JSON from MySQL 5.7*/ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CH...' at line 2
create table `testjson` (
`t` json /* JSON from MySQL 5.7*/ COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
show create table testjson;
Table Create Table
testjson CREATE TABLE `testjson` (
`t` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`t`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table testjson;
create table `testjson` (
`t` longtext /* JSON from MySQL 5.7 */ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
show create table testjson;
Table Create Table
testjson CREATE TABLE `testjson` (
`t` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table testjson;
#
# MDEV-32235: mysql_json cannot be used on newly created table
#
CREATE TABLE t(j mysql_json);
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
CREATE TABLE IF NOT EXISTS t(j mysql_json);
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
CREATE OR REPLACE TABLE t(j mysql_json);
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
CREATE TEMPORARY TABLE t(j mysql_json);
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
CREATE TABLE t1 (a TEXT);
ALTER TABLE t1 MODIFY a mysql_json;
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
DROP TABLE t1;
CREATE FUNCTION f1() RETURNS mysql_json RETURN NULL;
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
CREATE FUNCTION f1(a mysql_json) RETURNS INT RETURN 0;
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
CREATE PROCEDURE p1()
BEGIN
DECLARE a mysql_json;
END;
$$
ERROR HY000: 'MYSQL_JSON' is not allowed in this context
#
# End of 10.5 tests
#

View File

@ -51,6 +51,13 @@ show create table mysql_json_test;
--error ER_TABLE_NEEDS_REBUILD
select * from mysql_json_test;
--error ER_TABLE_NEEDS_REBUILD
CREATE TABLE t2 AS SELECT * FROM mysql_json_test;
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE TABLE t2 (a mysql_json /*new column*/) AS SELECT * FROM mysql_json_test;
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE TABLE t2 (actual mysql_json /*existing column*/) AS SELECT * FROM mysql_json_test;
--error ER_TABLE_NEEDS_REBUILD
LOCK TABLES mysql_json_test WRITE;
@ -88,3 +95,69 @@ from mysql_json_test_big;
drop table tempty;
drop table mysql_json_test;
drop table mysql_json_test_big;
--echo #
--echo # MDEV-32790: Output result in show create table
--echo # for mysql_json type should be longtext
--echo #
create table t1(j json);
show create table t1;
drop table t1;
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
create table t1(j mysql_json);
# `json` type should not have character set and collation other than utf8mb4_bin
--error ER_PARSE_ERROR
create table `testjson` (
`t` json /* JSON from MySQL 5.7*/ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
# By removing character set from `json` field query should work and
# expand to `longtext` with characterset
create table `testjson` (
`t` json /* JSON from MySQL 5.7*/ COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
show create table testjson;
drop table testjson;
# `longtext` that is alias can have character set
create table `testjson` (
`t` longtext /* JSON from MySQL 5.7 */ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
show create table testjson;
drop table testjson;
--echo #
--echo # MDEV-32235: mysql_json cannot be used on newly created table
--echo #
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE TABLE t(j mysql_json);
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE TABLE IF NOT EXISTS t(j mysql_json);
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE OR REPLACE TABLE t(j mysql_json);
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE TEMPORARY TABLE t(j mysql_json);
CREATE TABLE t1 (a TEXT);
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
ALTER TABLE t1 MODIFY a mysql_json;
DROP TABLE t1;
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE FUNCTION f1() RETURNS mysql_json RETURN NULL;
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE FUNCTION f1(a mysql_json) RETURNS INT RETURN 0;
DELIMITER $$;
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
CREATE PROCEDURE p1()
BEGIN
DECLARE a mysql_json;
END;
$$
DELIMITER ;$$
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -4,7 +4,7 @@
--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc
--source include/have_normal_bzip.inc
--source include/have_normal_zlib.inc
#
#

View File

@ -4,7 +4,7 @@
--source include/have_log_bin.inc
--source include/have_binlog_format_statement.inc
--source include/have_normal_bzip.inc
--source include/have_normal_zlib.inc
#
#
# mysqlbinlog: compressed query event

View File

@ -735,6 +735,8 @@ The following specify which files/extra groups are read (specified before remain
max_connections*5 or max_connections + table_cache*2
(whichever is larger) number of file descriptors
(Automatically configured unless set explicitly)
--optimizer-adjust-secondary-key-costs=#
Unused, will be removed.
--optimizer-disk-read-cost=#
Cost of reading a block of IO_SIZE (4096) from a disk (in
usec).
@ -1208,7 +1210,7 @@ The following specify which files/extra groups are read (specified before remain
The tracing level for semi-sync replication.
--rpl-semi-sync-master-wait-no-slave
Wait until timeout when no semi-synchronous replication
slave available (enabled by default).
slave is available.
(Defaults to on; use --skip-rpl-semi-sync-master-wait-no-slave to disable.)
--rpl-semi-sync-master-wait-point=name
Should transaction wait for semi-sync ack after having
@ -1763,6 +1765,7 @@ old FALSE
old-mode UTF8_IS_UTF8MB3
old-passwords FALSE
old-style-user-limits FALSE
optimizer-adjust-secondary-key-costs 0
optimizer-disk-read-cost 10.24
optimizer-disk-read-ratio 0.02
optimizer-extra-pruning-depth 8

View File

@ -12499,6 +12499,18 @@ json_detailed(json_extract(trace, '$**.in_to_subquery_conversion'))
set in_predicate_conversion_threshold=@tmp;
drop table t0;
#
# MDEV-29298: INSERT ... SELECT Does not produce an optimizer trace
#
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1), (2,2), (3,3), (4,4), (5,5);
set optimizer_trace=1;
insert into t2 select * from t1 where a<= b and a>4;
select QUERY, LENGTH(trace)>1 from information_schema.optimizer_trace;
QUERY LENGTH(trace)>1
insert into t2 select * from t1 where a<= b and a>4 1
drop table t1, t2;
#
# End of 10.5 tests
#
#

View File

@ -846,6 +846,20 @@ set in_predicate_conversion_threshold=@tmp;
drop table t0;
--enable_view_protocol
--echo #
--echo # MDEV-29298: INSERT ... SELECT Does not produce an optimizer trace
--echo #
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1), (2,2), (3,3), (4,4), (5,5);
set optimizer_trace=1;
insert into t2 select * from t1 where a<= b and a>4;
select QUERY, LENGTH(trace)>1 from information_schema.optimizer_trace;
drop table t1, t2;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -1502,7 +1502,7 @@ BEGIN NOT ATOMIC DECLARE history INT; SET history=10; SELECT history; END
SELECT history FROM t1
SELECT history 'alias' FROM t1
SELECT history()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.history does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT history.history()
Error 1630 FUNCTION history.history does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT history DATE FROM t1
@ -1525,7 +1525,7 @@ BEGIN NOT ATOMIC DECLARE next INT; SET next=10; SELECT next; END
SELECT next FROM t1
SELECT next 'alias' FROM t1
SELECT next()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.next does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT next.next()
Error 1630 FUNCTION next.next does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT next DATE FROM t1
@ -1572,7 +1572,7 @@ BEGIN NOT ATOMIC DECLARE previous INT; SET previous=10; SELECT previous; END
SELECT previous FROM t1
SELECT previous 'alias' FROM t1
SELECT previous()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.previous does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT previous.previous()
Error 1630 FUNCTION previous.previous does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT previous DATE FROM t1
@ -1596,7 +1596,7 @@ BEGIN NOT ATOMIC DECLARE system INT; SET system=10; SELECT system; END
SELECT system FROM t1
SELECT system 'alias' FROM t1
SELECT system()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.system does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system.system()
Error 1630 FUNCTION system.system does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system DATE FROM t1
@ -1619,7 +1619,7 @@ BEGIN NOT ATOMIC DECLARE system_time INT; SET system_time=10; SELECT system_time
SELECT system_time FROM t1
SELECT system_time 'alias' FROM t1
SELECT system_time()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.system_time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system_time.system_time()
Error 1630 FUNCTION system_time.system_time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system_time DATE FROM t1
@ -1690,7 +1690,7 @@ BEGIN NOT ATOMIC DECLARE transaction INT; SET transaction=10; SELECT transaction
SELECT transaction FROM t1
SELECT transaction 'alias' FROM t1
SELECT transaction()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.transaction does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT transaction.transaction()
Error 1630 FUNCTION transaction.transaction does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT transaction DATE FROM t1
@ -1736,7 +1736,7 @@ BEGIN NOT ATOMIC DECLARE versioning INT; SET versioning=10; SELECT versioning; E
SELECT versioning FROM t1
SELECT versioning 'alias' FROM t1
SELECT versioning()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.versioning does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT versioning.versioning()
Error 1630 FUNCTION versioning.versioning does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT versioning DATE FROM t1
@ -1759,7 +1759,7 @@ BEGIN NOT ATOMIC DECLARE without INT; SET without=10; SELECT without; END
SELECT without FROM t1
SELECT without 'alias' FROM t1
SELECT without()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.without does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT without.without()
Error 1630 FUNCTION without.without does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT without DATE FROM t1

View File

@ -0,0 +1,160 @@
create table t1 (
pk int primary key auto_increment,
nm varchar(32),
fl1 tinyint default 0,
fl2 tinyint default 0,
index idx1(nm, fl1),
index idx2(fl2)
) engine=myisam;
create table name (
pk int primary key auto_increment,
nm bigint
) engine=myisam;
create table flag2 (
pk int primary key auto_increment,
fl2 tinyint
) engine=myisam;
insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
insert into t1(nm,fl2)
select nm, fl2 from name, flag2 where name.pk = flag2.pk;
analyze table t1 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Table is already up to date
set optimizer_trace="enabled=on";
set optimizer_switch='rowid_filter=on';
set statement optimizer_adjust_secondary_key_costs=0 for
explain select * from t1 where nm like '500%' AND fl2 = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
Warnings:
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
[
[
{
"access_type": "ref",
"index": "idx2",
"used_range_estimates": true,
"filter":
{
"rowid_filter_index": "idx1",
"index_only_cost": 0.045598762,
"filter_startup_cost": 0.000899465,
"find_key_and_filter_lookup_cost": 0.03086808,
"filter_selectivity": 0.001,
"original_rows": 492,
"new_rows": 0.492,
"original_access_cost": 0.59235049,
"with_filter_access_cost": 0.077013594,
"original_found_rows_cost": 0.546751728,
"with_filter_found_rows_cost": 5.467517e-4,
"org_cost": 0.60809449,
"filter_cost": 0.077928803,
"filter_used": true
},
"rows": 0.492,
"cost": 0.077928803,
"chosen": true
},
{
"filter":
{
"rowid_filter_index": "idx2",
"index_only_cost": 0.000881127,
"filter_startup_cost": 0.066293508,
"find_key_and_filter_lookup_cost": 8.646449e-5,
"filter_selectivity": 0.492,
"original_rows": 1,
"new_rows": 0.492,
"original_access_cost": 0.001992411,
"with_filter_access_cost": 0.001514343,
"original_found_rows_cost": 0.001111284,
"with_filter_found_rows_cost": 5.467517e-4,
"org_cost": 0.002024411,
"filter_cost": 0.067823595,
"filter_used": false
},
"access_type": "range",
"range_index": "idx1",
"rows": 1,
"rows_after_filter": 1,
"rows_out": 0.492,
"cost": 0.002574553,
"chosen": true
}
]
]
The following trace should have a different rowid_filter_key cost
set statement optimizer_adjust_secondary_key_costs=2 for
explain select * from t1 where nm like '500%' AND fl2 = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
Warnings:
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
[
[
{
"access_type": "ref",
"index": "idx2",
"used_range_estimates": true,
"filter":
{
"rowid_filter_index": "idx1",
"index_only_cost": 0.045598762,
"filter_startup_cost": 0.000899465,
"find_key_and_filter_lookup_cost": 0.03086808,
"filter_selectivity": 0.001,
"original_rows": 492,
"new_rows": 0.492,
"original_access_cost": 0.59235049,
"with_filter_access_cost": 0.077013594,
"original_found_rows_cost": 0.546751728,
"with_filter_found_rows_cost": 5.467517e-4,
"org_cost": 0.60809449,
"filter_cost": 0.077928803,
"filter_used": true
},
"rows": 0.492,
"cost": 0.077928803,
"chosen": true
},
{
"filter":
{
"rowid_filter_index": "idx2",
"index_only_cost": 0.000881127,
"filter_startup_cost": 0.066293508,
"find_key_and_filter_lookup_cost": 8.646449e-5,
"filter_selectivity": 0.492,
"original_rows": 1,
"new_rows": 0.492,
"original_access_cost": 0.001992411,
"with_filter_access_cost": 0.001514343,
"original_found_rows_cost": 0.001111284,
"with_filter_found_rows_cost": 5.467517e-4,
"org_cost": 0.002024411,
"filter_cost": 0.067823595,
"filter_used": false
},
"access_type": "range",
"range_index": "idx1",
"rows": 1,
"rows_after_filter": 1,
"rows_out": 0.492,
"cost": 0.002574553,
"chosen": true
}
]
]
drop table t1, name, flag2;

View File

@ -0,0 +1,53 @@
--source include/have_sequence.inc
--source include/not_embedded.inc
#
# Show the costs for rowid filter
#
create table t1 (
pk int primary key auto_increment,
nm varchar(32),
fl1 tinyint default 0,
fl2 tinyint default 0,
index idx1(nm, fl1),
index idx2(fl2)
) engine=myisam;
create table name (
pk int primary key auto_increment,
nm bigint
) engine=myisam;
create table flag2 (
pk int primary key auto_increment,
fl2 tinyint
) engine=myisam;
insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
insert into t1(nm,fl2)
select nm, fl2 from name, flag2 where name.pk = flag2.pk;
analyze table t1 persistent for all;
--disable_ps_protocol
set optimizer_trace="enabled=on";
set optimizer_switch='rowid_filter=on';
set statement optimizer_adjust_secondary_key_costs=0 for
explain select * from t1 where nm like '500%' AND fl2 = 0;
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
--echo
--echo The following trace should have a different rowid_filter_key cost
--echo
set statement optimizer_adjust_secondary_key_costs=2 for
explain select * from t1 where nm like '500%' AND fl2 = 0;
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
--enable_ps_protocol
drop table t1, name, flag2;

View File

@ -8948,6 +8948,21 @@ DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
DROP VIEW v1;
#
# MDEV-33270: Call of SP invoking another SP with a parameter
# requiring type conversion
#
SET NAMES latin1;
CREATE PROCEDURE p1 (a text) BEGIN SELECT a; END |
CREATE PROCEDURE p2 () CALL p1(concat('x',_utf8'x')) |
CALL p2();
a
xx
CALL p2();
a
xx
DROP PROCEDURE p1;
DROP PROCEDURE p2;
# End of 10.4 tests
#
#
@ -9001,6 +9016,79 @@ BEGIN NOT ATOMIC DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1); SELECT r.a
r.a
1
SET SESSION log_slow_verbosity= @tmp;
#
# MDEV-31616 Problems with a stored function EMPTY() on upgrade to 10.6.
#
CREATE OR REPLACE FUNCTION empty(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
Warnings:
Note 1585 This function 'empty' has the same name as a native function
SELECT empty('1');
empty('1')
0
Warnings:
Note 1585 This function 'empty' has the same name as a native function
DROP FUNCTION empty;
CREATE OR REPLACE FUNCTION json_table(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
Warnings:
Note 1585 This function 'json_table' has the same name as a native function
SELECT json_table('1');
json_table('1')
0
Warnings:
Note 1585 This function 'json_table' has the same name as a native function
DROP FUNCTION json_table;
CREATE OR REPLACE FUNCTION nested(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
Warnings:
Note 1585 This function 'nested' has the same name as a native function
SELECT nested('1');
nested('1')
0
Warnings:
Note 1585 This function 'nested' has the same name as a native function
DROP FUNCTION nested;
CREATE OR REPLACE FUNCTION ordinality(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
Warnings:
Note 1585 This function 'ordinality' has the same name as a native function
SELECT ordinality('1');
ordinality('1')
0
Warnings:
Note 1585 This function 'ordinality' has the same name as a native function
DROP FUNCTION ordinality;
CREATE OR REPLACE FUNCTION path(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
Warnings:
Note 1585 This function 'path' has the same name as a native function
SELECT path('1');
path('1')
0
Warnings:
Note 1585 This function 'path' has the same name as a native function
DROP FUNCTION path;
CREATE OR REPLACE FUNCTION fast(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
Warnings:
Note 1585 This function 'fast' has the same name as a native function
SELECT fast('1');
fast('1')
0
Warnings:
Note 1585 This function 'fast' has the same name as a native function
DROP FUNCTION fast;
CREATE OR REPLACE FUNCTION relay(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
Warnings:
Note 1585 This function 'relay' has the same name as a native function
SELECT relay('1');
relay('1')
0
Warnings:
Note 1585 This function 'relay' has the same name as a native function
DROP FUNCTION relay;
CREATE OR REPLACE FUNCTION database() RETURNS int RETURN 333;
Warnings:
Note 1585 This function 'database' has the same name as a native function
SELECT database();
database()
test
DROP FUNCTION database;
DROP TABLE t1;
#
# MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)

View File

@ -10565,6 +10565,26 @@ DROP FUNCTION f2;
DROP FUNCTION f3;
DROP VIEW v1;
--echo #
--echo # MDEV-33270: Call of SP invoking another SP with a parameter
--echo # requiring type conversion
--echo #
SET NAMES latin1;
--delimiter |
CREATE PROCEDURE p1 (a text) BEGIN SELECT a; END |
CREATE PROCEDURE p2 () CALL p1(concat('x',_utf8'x')) |
--delimiter ;
CALL p2();
CALL p2();
DROP PROCEDURE p1;
DROP PROCEDURE p2;
--echo # End of 10.4 tests
--echo #
@ -10617,6 +10637,44 @@ BEGIN NOT ATOMIC DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1); SELECT r.a
--delimiter ;
SET SESSION log_slow_verbosity= @tmp;
--echo #
--echo # MDEV-31616 Problems with a stored function EMPTY() on upgrade to 10.6.
--echo #
CREATE OR REPLACE FUNCTION empty(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
SELECT empty('1');
DROP FUNCTION empty;
CREATE OR REPLACE FUNCTION json_table(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
SELECT json_table('1');
DROP FUNCTION json_table;
CREATE OR REPLACE FUNCTION nested(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
SELECT nested('1');
DROP FUNCTION nested;
CREATE OR REPLACE FUNCTION ordinality(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
SELECT ordinality('1');
DROP FUNCTION ordinality;
CREATE OR REPLACE FUNCTION path(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
SELECT path('1');
DROP FUNCTION path;
CREATE OR REPLACE FUNCTION fast(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
SELECT fast('1');
DROP FUNCTION fast;
CREATE OR REPLACE FUNCTION relay(a VARCHAR(128)) RETURNS int RETURN LENGTH(a)=0;
SELECT relay('1');
DROP FUNCTION relay;
CREATE OR REPLACE FUNCTION database() RETURNS int RETURN 333;
SELECT database();
DROP FUNCTION database;
# Cleanup
DROP TABLE t1;

View File

@ -897,7 +897,7 @@ ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
ERROR 22003: Out of range value for column 'col2' at row 1
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
ERROR 22003: DOUBLE value is out of range in '"test"."t1"."col1" * 5000'
Got one of the listed errors
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;

View File

@ -824,7 +824,7 @@ INSERT INTO t1 (col2) VALUES (-1.1E-3);
INSERT INTO t1 (col1) VALUES ('+1.8E+309');
--error 1264
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
--error ER_DATA_OUT_OF_RANGE
--error ER_DATA_OUT_OF_RANGE, ER_WARN_DATA_OUT_OF_RANGE
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
--error 1365
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;

View File

@ -0,0 +1,27 @@
#
# MDEV-32090 Index does not handle null-safe equals operator correctly in join
#
CREATE TEMPORARY TABLE t1 (
`id` int(10) unsigned NOT NULL,
`number` int(10) unsigned DEFAULT 0,
`name` varchar(47) DEFAULT NULL,
`street` mediumint(8) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `streetNumber` (`street`,`number`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
INSERT INTO t1 (id, number, name, street) VALUES (100733476, 14, NULL, 1115569);
SELECT
b1.id
FROM
t1 b1
INNER JOIN t1 b2 ON (
b1.street = b2.street
AND b1.number <=> b2.number
AND b1.name <=> b2.name
);
id
100733476
DROP TABLE t1;
#
# End of 10.11 tests
#

View File

@ -0,0 +1,32 @@
--source include/have_innodb.inc
--echo #
--echo # MDEV-32090 Index does not handle null-safe equals operator correctly in join
--echo #
CREATE TEMPORARY TABLE t1 (
`id` int(10) unsigned NOT NULL,
`number` int(10) unsigned DEFAULT 0,
`name` varchar(47) DEFAULT NULL,
`street` mediumint(8) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `streetNumber` (`street`,`number`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
INSERT INTO t1 (id, number, name, street) VALUES (100733476, 14, NULL, 1115569);
SELECT
b1.id
FROM
t1 b1
INNER JOIN t1 b2 ON (
b1.street = b2.street
AND b1.number <=> b2.number
AND b1.name <=> b2.name
);
DROP TABLE t1;
--echo #
--echo # End of 10.11 tests
--echo #

View File

@ -1,7 +0,0 @@
CREATE TABLE t1 ( c1 longtext , c2 longtext );
INSERT INTO t1 VALUES('[1,2,3]', '[2, 3, 4]'), ('[1,2,3]', '[2, 3, 4]');
SELECT JSON_ARRAY_INTERSECT(c1, c2) FROM t1;
DROP TABLE t1;

View File

@ -601,6 +601,25 @@ DROP TEMPORARY TABLE t1;
#
# End of 10.2 tests
#
#
# MDEV-31523: Using two temporary tables in OPTIMIZE TABLE lead to crash
#
CREATE TEMPORARY TABLE t1 (c INT) ENGINE=MyISAM;
CREATE TEMPORARY TABLE t2 (c INT) ENGINE=MyISAM;
optimize TABLE t1,t2;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
test.t2 optimize status Table is already up to date
SHOW TABLES;
Tables_in_test
t2
t1
tmp
# in 11.2 and above here should be listed above used temporary tables
DROP TEMPORARY TABLE t1, t2;
#
# End of 10.4 tests
#
create function f1() returns int
begin
drop temporary table t1, t2;

View File

@ -657,6 +657,22 @@ DROP TEMPORARY TABLE t1;
--echo # End of 10.2 tests
--echo #
--echo #
--echo # MDEV-31523: Using two temporary tables in OPTIMIZE TABLE lead to crash
--echo #
CREATE TEMPORARY TABLE t1 (c INT) ENGINE=MyISAM;
CREATE TEMPORARY TABLE t2 (c INT) ENGINE=MyISAM;
optimize TABLE t1,t2;
SHOW TABLES;
--echo # in 11.2 and above here should be listed above used temporary tables
DROP TEMPORARY TABLE t1, t2;
--echo #
--echo # End of 10.4 tests
--echo #
#
# DROP TEMPORARY TABLE fails in the middle
#

View File

@ -1171,6 +1171,43 @@ d 50
fdbl 123.456.789,12345678000000000000000000000000000000
fdec 123.456.789,12345678900000000000000000000000000000
#
# MDEV-32645 CAST(AS UNSIGNED) fails with --view-protocol
#
SELECT
CAST(-1e0 AS UNSIGNED),
CAST(--2e0 AS UNSIGNED),
CAST(---3e0 AS UNSIGNED),
CAST(----4e0 AS UNSIGNED);
CAST(-1e0 AS UNSIGNED) CAST(--2e0 AS UNSIGNED) CAST(---3e0 AS UNSIGNED) CAST(----4e0 AS UNSIGNED)
0 2 0 4
Warnings:
Note 1916 Got overflow when converting '-1' to UNSIGNED BIGINT. Value truncated
Note 1916 Got overflow when converting '-3' to UNSIGNED BIGINT. Value truncated
EXPLAIN EXTENDED SELECT
CAST(-1e0 AS UNSIGNED),
CAST(--2e0 AS UNSIGNED),
CAST(---3e0 AS UNSIGNED),
CAST(----4e0 AS UNSIGNED);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select cast(-1e0 as unsigned) AS `CAST(-1e0 AS UNSIGNED)`,cast(2e0 as unsigned) AS `CAST(--2e0 AS UNSIGNED)`,cast(-3e0 as unsigned) AS `CAST(---3e0 AS UNSIGNED)`,cast(4e0 as unsigned) AS `CAST(----4e0 AS UNSIGNED)`
CREATE VIEW v1 AS SELECT
CAST(-1e0 AS UNSIGNED),
CAST(--2e0 AS UNSIGNED),
CAST(---3e0 AS UNSIGNED),
CAST(----4e0 AS UNSIGNED);
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(-1e0 as unsigned) AS `CAST(-1e0 AS UNSIGNED)`,cast(2e0 as unsigned) AS `CAST(--2e0 AS UNSIGNED)`,cast(-3e0 as unsigned) AS `CAST(---3e0 AS UNSIGNED)`,cast(4e0 as unsigned) AS `CAST(----4e0 AS UNSIGNED)` latin1 latin1_swedish_ci
SELECT * FROM v1;
CAST(-1e0 AS UNSIGNED) CAST(--2e0 AS UNSIGNED) CAST(---3e0 AS UNSIGNED) CAST(----4e0 AS UNSIGNED)
0 2 0 4
Warnings:
Note 1916 Got overflow when converting '-1' to UNSIGNED BIGINT. Value truncated
Note 1916 Got overflow when converting '-3' to UNSIGNED BIGINT. Value truncated
DROP VIEW v1;
#
# End of 10.4 tests
#
#

View File

@ -716,6 +716,32 @@ $$
DELIMITER ;$$
--horizontal_results
--echo #
--echo # MDEV-32645 CAST(AS UNSIGNED) fails with --view-protocol
--echo #
SELECT
CAST(-1e0 AS UNSIGNED),
CAST(--2e0 AS UNSIGNED),
CAST(---3e0 AS UNSIGNED),
CAST(----4e0 AS UNSIGNED);
EXPLAIN EXTENDED SELECT
CAST(-1e0 AS UNSIGNED),
CAST(--2e0 AS UNSIGNED),
CAST(---3e0 AS UNSIGNED),
CAST(----4e0 AS UNSIGNED);
CREATE VIEW v1 AS SELECT
CAST(-1e0 AS UNSIGNED),
CAST(--2e0 AS UNSIGNED),
CAST(---3e0 AS UNSIGNED),
CAST(----4e0 AS UNSIGNED);
SHOW CREATE VIEW v1;
SELECT * FROM v1;
DROP VIEW v1;
--echo #
--echo # End of 10.4 tests
--echo #

View File

@ -7037,3 +7037,49 @@ DROP TABLE t1, t2;
#
# End of 10.6 tests
#
#
# MDEV-29587: Allowing insert into a view with columns that
# are not part the table
#
# view with 2 the same fields
CREATE TABLE table1 (x INT);
CREATE VIEW view1 AS SELECT x, x as x1 FROM table1;
INSERT INTO view1(x) VALUES (1);
INSERT INTO view1(x1) VALUES (1);
INSERT INTO view1(x1,x) VALUES (1,1);
ERROR HY000: The target table view1 of the INSERT is not insertable-into
DROP VIEW view1;
DROP TABLE table1;
# view with a field and expression over the field
CREATE TABLE table1 (x INT);
CREATE VIEW view1 AS SELECT x, x + 1 as x1 FROM table1;
INSERT INTO view1(x) VALUES (1);
INSERT INTO view1(x1) VALUES (1);
ERROR HY000: The target table view1 of the INSERT is not insertable-into
INSERT INTO view1(x1,x) VALUES (1,1);
ERROR HY000: The target table view1 of the INSERT is not insertable-into
DROP VIEW view1;
DROP TABLE table1;
# view with a field and collation expression over the field
CREATE TABLE table1 (x char(20));
CREATE VIEW view1 AS SELECT x, x collate latin1_german1_ci as x1 FROM table1;
INSERT INTO view1(x) VALUES ("ua");
# we can insert in the field with collation
INSERT INTO view1(x1) VALUES ("ua");
INSERT INTO view1(x1,x) VALUES ("ua","ua");
ERROR HY000: The target table view1 of the INSERT is not insertable-into
DROP VIEW view1;
DROP TABLE table1;
# view with a field and expression over other field
CREATE TABLE table1 (x INT, y INT);
CREATE VIEW view1 AS SELECT x, y + 1 as x1 FROM table1;
INSERT INTO view1(x) VALUES (1);
INSERT INTO view1(x1) VALUES (1);
ERROR HY000: The target table view1 of the INSERT is not insertable-into
INSERT INTO view1(x1,x) VALUES (1,1);
ERROR HY000: The target table view1 of the INSERT is not insertable-into
DROP VIEW view1;
DROP TABLE table1;
#
# End of 10.11 test
#

View File

@ -6801,3 +6801,56 @@ DROP TABLE t1, t2;
--echo #
--echo # End of 10.6 tests
--echo #
--echo #
--echo # MDEV-29587: Allowing insert into a view with columns that
--echo # are not part the table
--echo #
--echo # view with 2 the same fields
CREATE TABLE table1 (x INT);
CREATE VIEW view1 AS SELECT x, x as x1 FROM table1;
INSERT INTO view1(x) VALUES (1);
INSERT INTO view1(x1) VALUES (1);
--error ER_NON_INSERTABLE_TABLE
INSERT INTO view1(x1,x) VALUES (1,1);
DROP VIEW view1;
DROP TABLE table1;
--echo # view with a field and expression over the field
CREATE TABLE table1 (x INT);
CREATE VIEW view1 AS SELECT x, x + 1 as x1 FROM table1;
INSERT INTO view1(x) VALUES (1);
--error ER_NON_INSERTABLE_TABLE
INSERT INTO view1(x1) VALUES (1);
--error ER_NON_INSERTABLE_TABLE
INSERT INTO view1(x1,x) VALUES (1,1);
DROP VIEW view1;
DROP TABLE table1;
--echo # view with a field and collation expression over the field
CREATE TABLE table1 (x char(20));
CREATE VIEW view1 AS SELECT x, x collate latin1_german1_ci as x1 FROM table1;
INSERT INTO view1(x) VALUES ("ua");
--echo # we can insert in the field with collation
INSERT INTO view1(x1) VALUES ("ua");
--error ER_NON_INSERTABLE_TABLE
INSERT INTO view1(x1,x) VALUES ("ua","ua");
DROP VIEW view1;
DROP TABLE table1;
--echo # view with a field and expression over other field
CREATE TABLE table1 (x INT, y INT);
CREATE VIEW view1 AS SELECT x, y + 1 as x1 FROM table1;
INSERT INTO view1(x) VALUES (1);
--error ER_NON_INSERTABLE_TABLE
INSERT INTO view1(x1) VALUES (1);
--error ER_NON_INSERTABLE_TABLE
INSERT INTO view1(x1,x) VALUES (1,1);
DROP VIEW view1;
DROP TABLE table1;
--echo #
--echo # End of 10.11 test
--echo #

View File

@ -3111,6 +3111,7 @@ sub mysql_install_db {
mtr_add_arg($args, "--core-file");
mtr_add_arg($args, "--console");
mtr_add_arg($args, "--character-set-server=latin1");
mtr_add_arg($args, "--disable-performance-schema");
if ( $opt_debug )
{
@ -4464,6 +4465,7 @@ sub extract_warning_lines ($$) {
qr/InnoDB: Warning: a long semaphore wait:/,
qr/InnoDB: Dumping buffer pool.*/,
qr/InnoDB: Buffer pool.*/,
qr/InnoDB: Could not free any blocks in the buffer pool!/,
qr/InnoDB: Warning: Writer thread is waiting this semaphore:/,
qr/InnoDB: innodb_open_files .* should not be greater than/,
qr/Slave: Unknown table 't1' .* 1051/,
@ -4516,7 +4518,7 @@ sub extract_warning_lines ($$) {
qr|InnoDB: io_setup\(\) failed with EAGAIN|,
qr|io_uring_queue_init\(\) failed with|,
qr|InnoDB: liburing disabled|,
qr/InnoDB: Failed to set (O_DIRECT|DIRECTIO_ON) on file/,
qr/InnoDB: Failed to set O_DIRECT on file/,
qr|setrlimit could not change the size of core files to 'infinity';|,
qr|feedback plugin: failed to retrieve the MAC address|,
qr|Plugin 'FEEDBACK' init function returned error|,

View File

@ -0,0 +1,12 @@
SET @g0= POINT(1,1);
SET @g1= Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)));
CREATE TABLE t1 AS SELECT @g0 AS g0, @g1 AS g1;
DROP TABLE t1;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # User var # # @`g0`=/*point*/_binary X'000000000101000000000000000000F03F000000000000F03F' COLLATE binary
master-bin.000001 # User var # # @`g1`=/*polygon*/_binary X'0000000001030000000100000004000000000000000000000000000000000000000000000000003E4000000000000000000000000000003E400000000000003E4000000000000000000000000000000000' COLLATE binary
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 AS SELECT @g0 AS g0, @g1 AS g1
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */

View File

@ -0,0 +1,15 @@
--source include/not_embedded.inc
--source include/have_binlog_format_statement.inc
--source include/have_geometry.inc
--disable_query_log
reset master; # get rid of previous tests binlog
--enable_query_log
SET @g0= POINT(1,1);
SET @g1= Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)));
CREATE TABLE t1 AS SELECT @g0 AS g0, @g1 AS g1;
DROP TABLE t1;
--let $binlog_file = LAST
source include/show_binlog_events.inc;

View File

@ -7,7 +7,6 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
call mtr.add_suppression("mysqld: Got an error reading communication packets");
connection slave;
set sql_log_bin=0;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
set sql_log_bin=1;
@ -28,7 +27,7 @@ set global rpl_semi_sync_slave_enabled= 0;
# Main test of semi-sync replication start here
#
connection master;
set global rpl_semi_sync_master_timeout= 60000;
set global rpl_semi_sync_master_timeout= 2000;
[ default state of semi-sync on master should be OFF ]
show variables like 'rpl_semi_sync_master_enabled';
Variable_name Value
@ -163,11 +162,15 @@ connection slave;
# Test semi-sync master will switch OFF after one transaction
# timeout waiting for slave reply.
#
connection master;
show status like "Rpl_semi_sync_master_status";
Variable_name Value
Rpl_semi_sync_master_status ON
connection slave;
include/stop_slave.inc
connection master;
include/kill_binlog_dump_threads.inc
set global rpl_semi_sync_master_timeout= 5000;
set global rpl_semi_sync_master_timeout= 2000;
[ master status should be ON ]
show status like 'Rpl_semi_sync_master_no_tx';
Variable_name Value
@ -317,6 +320,8 @@ include/kill_binlog_dump_threads.inc
connection slave;
include/start_slave.inc
connection master;
connection slave;
connection master;
create table t1 (a int) engine = ENGINE_TYPE;
insert into t1 values (1);
insert into t1 values (2), (3);
@ -359,6 +364,8 @@ show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status ON
connection master;
connection slave;
connection master;
[ master semi-sync should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value

View File

@ -1772,6 +1772,85 @@ Level Code Message
Note 1003 select trim(both ' ' from 'a') AS "oracle_schema.TRIM(BOTH ' ' FROM 'a')"
Warnings:
Note 1003 select trim(both ' ' from 'a') AS "oracle_schema.TRIM(BOTH ' ' FROM 'a')"
CALL p3('REGEXP_REPLACE(''test'',''t'','''')');
----------
sql_mode='' qualifier=''
query
EXPLAIN EXTENDED SELECT REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select regexp_replace('test','t','') AS `REGEXP_REPLACE('test','t','')`
----------
sql_mode='' qualifier='unknown_schema.'
query
EXPLAIN EXTENDED SELECT unknown_schema.REGEXP_REPLACE('test','t','')
errmsg
ERROR: FUNCTION unknown_schema.REGEXP_REPLACE does not exist
----------
sql_mode='' qualifier='mariadb_schema.'
query
EXPLAIN EXTENDED SELECT mariadb_schema.REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select regexp_replace('test','t','') AS `mariadb_schema.REGEXP_REPLACE('test','t','')`
----------
sql_mode='' qualifier='maxdb_schema.'
query
EXPLAIN EXTENDED SELECT maxdb_schema.REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select regexp_replace('test','t','') AS `maxdb_schema.REGEXP_REPLACE('test','t','')`
----------
sql_mode='' qualifier='oracle_schema.'
query
EXPLAIN EXTENDED SELECT oracle_schema.REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select oracle_schema.regexp_replace('test','t','') AS `oracle_schema.REGEXP_REPLACE('test','t','')`
----------
sql_mode='ORACLE' qualifier=''
query
EXPLAIN EXTENDED SELECT REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select regexp_replace('test','t','') AS "REGEXP_REPLACE('test','t','')"
----------
sql_mode='ORACLE' qualifier='unknown_schema.'
query
EXPLAIN EXTENDED SELECT unknown_schema.REGEXP_REPLACE('test','t','')
errmsg
ERROR: FUNCTION unknown_schema.REGEXP_REPLACE does not exist
----------
sql_mode='ORACLE' qualifier='mariadb_schema.'
query
EXPLAIN EXTENDED SELECT mariadb_schema.REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select mariadb_schema.regexp_replace('test','t','') AS "mariadb_schema.REGEXP_REPLACE('test','t','')"
----------
sql_mode='ORACLE' qualifier='maxdb_schema.'
query
EXPLAIN EXTENDED SELECT maxdb_schema.REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select mariadb_schema.regexp_replace('test','t','') AS "maxdb_schema.REGEXP_REPLACE('test','t','')"
----------
sql_mode='ORACLE' qualifier='oracle_schema.'
query
EXPLAIN EXTENDED SELECT oracle_schema.REGEXP_REPLACE('test','t','')
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select regexp_replace('test','t','') AS "oracle_schema.REGEXP_REPLACE('test','t','')"
Warnings:
Note 1003 select regexp_replace('test','t','') AS "oracle_schema.REGEXP_REPLACE('test','t','')"
CALL p3('CONCAT_OPERATOR_ORACLE(''a'')');
----------
sql_mode='' qualifier=''

View File

@ -0,0 +1,34 @@
SET sql_mode=ORACLE;
#
# MDEV-29095 REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode
#
CREATE TABLE t1 (replacement VARCHAR(10));
INSERT INTO t1 VALUES (NULL), ('');
SELECT replacement, REGEXP_REPLACE('abba','a',replacement) FROM t1 ORDER BY replacement;
replacement REGEXP_REPLACE('abba','a',replacement)
NULL bb
bb
DROP TABLE t1;
SELECT REGEXP_REPLACE('abba','a',null);
REGEXP_REPLACE('abba','a',null)
bb
EXPLAIN EXTENDED SELECT REPLACE('abba','a',null) ;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select replace('abba','a',NULL) AS "REPLACE('abba','a',null)"
CREATE VIEW v1 AS SELECT REPLACE('abba','a',null) ;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE VIEW "v1" AS select replace('abba','a',NULL) AS "REPLACE('abba','a',null)" latin1 latin1_swedish_ci
SELECT * FROM v1;
REPLACE('abba','a',null)
bb
SET sql_mode=DEFAULT;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select oracle_schema.replace('abba','a',NULL) AS `REPLACE('abba','a',null)` latin1 latin1_swedish_ci
SELECT * FROM v1;
REPLACE('abba','a',null)
bb
DROP VIEW v1;

View File

@ -84,7 +84,7 @@ DECLARE history INT; BEGIN history:=10; SELECT history; END
SELECT history FROM t1
SELECT history 'alias' FROM t1
SELECT history()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.history does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT history.history()
Error 1630 FUNCTION history.history does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT history DATE FROM t1
@ -106,7 +106,7 @@ DECLARE next INT; BEGIN next:=10; SELECT next; END
SELECT next FROM t1
SELECT next 'alias' FROM t1
SELECT next()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.next does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT next.next()
Error 1630 FUNCTION next.next does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT next DATE FROM t1
@ -151,7 +151,7 @@ DECLARE previous INT; BEGIN previous:=10; SELECT previous; END
SELECT previous FROM t1
SELECT previous 'alias' FROM t1
SELECT previous()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.previous does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT previous.previous()
Error 1630 FUNCTION previous.previous does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT previous DATE FROM t1
@ -174,7 +174,7 @@ DECLARE system INT; BEGIN system:=10; SELECT system; END
SELECT system FROM t1
SELECT system 'alias' FROM t1
SELECT system()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.system does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system.system()
Error 1630 FUNCTION system.system does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system DATE FROM t1
@ -196,7 +196,7 @@ DECLARE system_time INT; BEGIN system_time:=10; SELECT system_time; END
SELECT system_time FROM t1
SELECT system_time 'alias' FROM t1
SELECT system_time()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.system_time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system_time.system_time()
Error 1630 FUNCTION system_time.system_time does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT system_time DATE FROM t1
@ -264,7 +264,7 @@ DECLARE transaction INT; BEGIN transaction:=10; SELECT transaction; END
SELECT transaction FROM t1
SELECT transaction 'alias' FROM t1
SELECT transaction()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.transaction does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT transaction.transaction()
Error 1630 FUNCTION transaction.transaction does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT transaction DATE FROM t1
@ -308,7 +308,7 @@ DECLARE versioning INT; BEGIN versioning:=10; SELECT versioning; END
SELECT versioning FROM t1
SELECT versioning 'alias' FROM t1
SELECT versioning()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.versioning does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT versioning.versioning()
Error 1630 FUNCTION versioning.versioning does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT versioning DATE FROM t1
@ -330,7 +330,7 @@ DECLARE without INT; BEGIN without:=10; SELECT without; END
SELECT without FROM t1
SELECT without 'alias' FROM t1
SELECT without()
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '()' at line 1
Error 1630 FUNCTION test.without does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT without.without()
Error 1630 FUNCTION without.without does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
SELECT without DATE FROM t1

View File

@ -1,6 +1,6 @@
--source include/have_innodb.inc
--source include/have_csv.inc
--source include/have_normal_bzip.inc
--source include/have_normal_zlib.inc
SET sql_mode=ORACLE;

View File

@ -165,6 +165,7 @@ CALL p3('TRIM(1,2)');
CALL p3('TRIM(''a'')');
CALL p3('TRIM(BOTH '' '' FROM ''a'')');
CALL p3('REGEXP_REPLACE(''test'',''t'','''')');
# Deprecated compatibility XXX_ORACLE functions.
# These functions are implemented as simple native functions

View File

@ -0,0 +1,26 @@
SET sql_mode=ORACLE;
--echo #
--echo # MDEV-29095 REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode
--echo #
#SELECT REGEXP_REPLACE(null,'a','b') ;
#SELECT REGEXP_REPLACE('ab',null,'b') ;
#SELECT REGEXP_REPLACE('ab','a',null) ;
#SELECT REGEXP_REPLACE('ab',null,null) ;
CREATE TABLE t1 (replacement VARCHAR(10));
INSERT INTO t1 VALUES (NULL), ('');
SELECT replacement, REGEXP_REPLACE('abba','a',replacement) FROM t1 ORDER BY replacement;
DROP TABLE t1;
SELECT REGEXP_REPLACE('abba','a',null);
EXPLAIN EXTENDED SELECT REPLACE('abba','a',null) ;
CREATE VIEW v1 AS SELECT REPLACE('abba','a',null) ;
SHOW CREATE VIEW v1;
SELECT * FROM v1;
SET sql_mode=DEFAULT;
SHOW CREATE VIEW v1;
SELECT * FROM v1;
DROP VIEW v1;

View File

@ -10,7 +10,7 @@ performance_schema
sys
test
USE DATABASE nond6;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE nond6' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'nond6' at line 1
DROP DATABASE d6;
SHOW DATABASES;
Database

View File

@ -1,5 +1,16 @@
include/master-slave.inc
[connection master]
select @@rpl_semi_sync_master_enabled;
@@rpl_semi_sync_master_enabled
0
connection slave;
select @@rpl_semi_sync_slave_enabled;
@@rpl_semi_sync_slave_enabled
0
show status like "rpl_semi_sync_slave_status";
Variable_name Value
Rpl_semi_sync_slave_status OFF
connection master;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'

View File

@ -0,0 +1,36 @@
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
connection master;
CREATE DATABASE federated;
connection slave;
CREATE DATABASE federated;
#
# MDEV-32984 Update federated table and column privileges
#
connection slave;
create database db1;
create user my@localhost identified by '1qaz2wsx';
create table db1.t1 (
f1 int auto_increment primary key,
f2 varchar(50),
f3 varchar(50),
unique (f2)
);
grant insert, select (f1, f2, f3), update (f3) on db1.t1 to my@localhost;
connection master;
create table tt1 engine=federated connection='mysql://my:1qaz2wsx@localhost:$SLAVE_MYPORT/db1/t1';
insert into tt1 (f2,f3) values ('test','123');
select * from tt1;
f1 f2 f3
1 test 123
update tt1 set f3='123456' where f2='test';
drop table tt1;
connection slave;
drop database db1;
drop user my@localhost;
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;

View File

@ -0,0 +1,32 @@
source include/federated.inc;
source have_federatedx.inc;
--echo #
--echo # MDEV-32984 Update federated table and column privileges
--echo #
connection slave;
create database db1;
create user my@localhost identified by '1qaz2wsx';
create table db1.t1 (
f1 int auto_increment primary key,
f2 varchar(50),
f3 varchar(50),
unique (f2)
);
grant insert, select (f1, f2, f3), update (f3) on db1.t1 to my@localhost;
connection master;
evalp create table tt1 engine=federated connection='mysql://my:1qaz2wsx@localhost:$SLAVE_MYPORT/db1/t1';
insert into tt1 (f2,f3) values ('test','123');
select * from tt1;
update tt1 set f3='123456' where f2='test';
drop table tt1;
connection slave;
drop database db1;
drop user my@localhost;
source include/federated_cleanup.inc;

View File

@ -22145,9 +22145,9 @@ DELETE FROM t1;
DROP VIEW v1;
CREATE VIEW v1 AS SELECT f1, f2, f3, 'HELLO' AS my_greeting FROM t1;
INSERT INTO v1 SET f1 = 1;
ERROR HY000: The target table v1 of the INSERT is not insertable-into
SELECT * from t1;
f1 f2 f3 f4
1 NULL NULL NULL
DELETE FROM t1;
INSERT INTO v1 SET f1 = 1, my_greeting = 'HELLO';
ERROR HY000: The target table v1 of the INSERT is not insertable-into

View File

@ -22147,9 +22147,9 @@ DELETE FROM t1;
DROP VIEW v1;
CREATE VIEW v1 AS SELECT f1, f2, f3, 'HELLO' AS my_greeting FROM t1;
INSERT INTO v1 SET f1 = 1;
ERROR HY000: The target table v1 of the INSERT is not insertable-into
SELECT * from t1;
f1 f2 f3 f4
1 NULL NULL NULL
DELETE FROM t1;
INSERT INTO v1 SET f1 = 1, my_greeting = 'HELLO';
ERROR HY000: The target table v1 of the INSERT is not insertable-into

View File

@ -23849,9 +23849,9 @@ DELETE FROM t1;
DROP VIEW v1;
CREATE VIEW v1 AS SELECT f1, f2, f3, 'HELLO' AS my_greeting FROM t1;
INSERT INTO v1 SET f1 = 1;
ERROR HY000: The target table v1 of the INSERT is not insertable-into
SELECT * from t1;
f1 f2 f3 f4
1 NULL NULL NULL
DELETE FROM t1;
INSERT INTO v1 SET f1 = 1, my_greeting = 'HELLO';
ERROR HY000: The target table v1 of the INSERT is not insertable-into

View File

@ -2088,9 +2088,11 @@ SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'cursor()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE database()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database()
SELECT * from t1 where f2=f1' at line 1
SELECT 1;
CALL database();
1
1
DROP PROCEDURE database;
CREATE PROCEDURE databases()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'databases()
@ -2350,6 +2352,12 @@ CREATE PROCEDURE join()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'join()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE json_table()
SELECT 1;
CALL json_table();
1
1
DROP PROCEDURE json_table;
CREATE PROCEDURE key()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key()
@ -2470,6 +2478,12 @@ CREATE PROCEDURE natural()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'natural()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE nested()
SELECT 1;
CALL nested();
1
1
DROP PROCEDURE nested;
CREATE PROCEDURE not()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not()
@ -2509,6 +2523,12 @@ CREATE PROCEDURE order()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE ordinality()
SELECT 1;
CALL ordinality;
1
1
DROP PROCEDURE ordinality;
CREATE PROCEDURE out()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'out()
@ -2521,6 +2541,12 @@ CREATE PROCEDURE outfile()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'outfile()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE path()
SELECT 1;
CALL path();
1
1
DROP PROCEDURE path;
CREATE PROCEDURE precision()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'precision()
@ -2602,9 +2628,11 @@ SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rlike()
SELECT * from t1 where f2=f1' at line 1
CREATE PROCEDURE schema()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'schema()
SELECT * from t1 where f2=f1' at line 1
SELECT 1;
CALL schema();
1
1
DROP PROCEDURE schema;
CREATE PROCEDURE schemas()
SELECT * from t1 where f2=f1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'schemas()
@ -4204,9 +4232,6 @@ CREATE PROCEDURE sp1()
database:BEGIN
SELECT @x;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database:BEGIN
SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
databases:BEGIN
@ -4737,6 +4762,11 @@ SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
json_table:BEGIN
SELECT @x;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
key:BEGIN
SELECT @x;
END//
@ -4977,6 +5007,11 @@ SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
nested:BEGIN
SELECT @x;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
not:BEGIN
SELECT @x;
END//
@ -5057,6 +5092,11 @@ SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
ordinality:BEGIN
SELECT @x;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
out:BEGIN
SELECT @x;
END//
@ -5081,6 +5121,11 @@ SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
path:BEGIN
SELECT @x;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
precision:BEGIN
SELECT @x;
END//
@ -5253,9 +5298,6 @@ CREATE PROCEDURE sp1()
schema:BEGIN
SELECT @x;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'schema:BEGIN
SELECT @x;
END' at line 2
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
schemas:BEGIN
@ -7811,8 +7853,6 @@ CREATE PROCEDURE sp1()
BEGIN
declare database char;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database char;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
@ -8278,6 +8318,11 @@ END' at line 3
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
declare json_table char;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
BEGIN
declare key char;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key char;
@ -8488,6 +8533,11 @@ END' at line 3
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
declare nested char;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
BEGIN
declare not char;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not char;
@ -8556,6 +8606,11 @@ END' at line 3
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
declare ordinality char;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
BEGIN
declare out char;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'out char;
@ -8577,6 +8632,11 @@ END' at line 3
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1()
BEGIN
declare path char;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1()
BEGIN
declare precision char;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'precision char;
@ -8745,11 +8805,7 @@ CREATE PROCEDURE sp1()
BEGIN
declare schema char;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'schema char;
END' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1()
BEGIN
declare schemas char;
@ -9704,11 +9760,7 @@ BEGIN
declare database condition for sqlstate '02000';
declare exit handler for database set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database condition for sqlstate '02000';
declare exit handler for database se...' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare databases condition for sqlstate '02000';
@ -10372,6 +10424,12 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare json_table condition for sqlstate '02000';
declare exit handler for json_table set @var2 = 1;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare key condition for sqlstate '02000';
declare exit handler for key set @var2 = 1;
END//
@ -10672,6 +10730,12 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare nested condition for sqlstate '02000';
declare exit handler for nested set @var2 = 1;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare not condition for sqlstate '02000';
declare exit handler for not set @var2 = 1;
END//
@ -10768,6 +10832,12 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare ordinality condition for sqlstate '02000';
declare exit handler for ordinality set @var2 = 1;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare out condition for sqlstate '02000';
declare exit handler for out set @var2 = 1;
END//
@ -10798,6 +10868,12 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare path condition for sqlstate '02000';
declare exit handler for path set @var2 = 1;
END//
DROP PROCEDURE sp1;
CREATE PROCEDURE sp1( )
BEGIN
declare precision condition for sqlstate '02000';
declare exit handler for precision set @var2 = 1;
END//
@ -11021,11 +11097,7 @@ BEGIN
declare schema condition for sqlstate '02000';
declare exit handler for schema set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'schema condition for sqlstate '02000';
declare exit handler for schema set @v...' at line 3
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare schemas condition for sqlstate '02000';
@ -11974,8 +12046,7 @@ CREATE PROCEDURE sp1( )
BEGIN
declare database handler for sqlstate '02000' set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'database handler for sqlstate '02000' set @var2 = 1;
END' at line 3
ERROR HY000: Unknown data type: 'handler'
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
@ -12571,6 +12642,11 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare json_table handler for sqlstate '02000' set @var2 = 1;
END//
ERROR HY000: Unknown data type: 'handler'
CREATE PROCEDURE sp1( )
BEGIN
declare key handler for sqlstate '02000' set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key handler for sqlstate '02000' set @var2 = 1;
@ -12841,6 +12917,11 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare nested handler for sqlstate '02000' set @var2 = 1;
END//
ERROR HY000: Unknown data type: 'handler'
CREATE PROCEDURE sp1( )
BEGIN
declare not handler for sqlstate '02000' set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'not handler for sqlstate '02000' set @var2 = 1;
@ -12930,6 +13011,11 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare ordinality handler for sqlstate '02000' set @var2 = 1;
END//
ERROR HY000: Unknown data type: 'handler'
CREATE PROCEDURE sp1( )
BEGIN
declare out handler for sqlstate '02000' set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'out handler for sqlstate '02000' set @var2 = 1;
@ -12957,6 +13043,11 @@ Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist
CREATE PROCEDURE sp1( )
BEGIN
declare path handler for sqlstate '02000' set @var2 = 1;
END//
ERROR HY000: Unknown data type: 'handler'
CREATE PROCEDURE sp1( )
BEGIN
declare precision handler for sqlstate '02000' set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'precision handler for sqlstate '02000' set @var2 = 1;
@ -13164,8 +13255,7 @@ CREATE PROCEDURE sp1( )
BEGIN
declare schema handler for sqlstate '02000' set @var2 = 1;
END//
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'schema handler for sqlstate '02000' set @var2 = 1;
END' at line 3
ERROR HY000: Unknown data type: 'handler'
DROP PROCEDURE IF EXISTS sp1;
Warnings:
Note 1305 PROCEDURE db_storedproc.sp1 does not exist

View File

@ -1102,9 +1102,11 @@ CREATE PROCEDURE current_user()
CREATE PROCEDURE cursor()
SELECT * from t1 where f2=f1;
--error ER_PARSE_ERROR
CREATE PROCEDURE database()
SELECT * from t1 where f2=f1;
SELECT 1;
CALL database();
DROP PROCEDURE database;
--error ER_PARSE_ERROR
CREATE PROCEDURE databases()
@ -1367,6 +1369,12 @@ CREATE PROCEDURE iterate()
CREATE PROCEDURE join()
SELECT * from t1 where f2=f1;
CREATE PROCEDURE json_table()
SELECT 1;
CALL json_table();
DROP PROCEDURE json_table;
--error ER_PARSE_ERROR
CREATE PROCEDURE key()
SELECT * from t1 where f2=f1;
@ -1487,6 +1495,13 @@ CREATE PROCEDURE modifies()
CREATE PROCEDURE natural()
SELECT * from t1 where f2=f1;
CREATE PROCEDURE nested()
SELECT 1;
CALL nested();
DROP PROCEDURE nested;
--error ER_PARSE_ERROR
CREATE PROCEDURE not()
SELECT * from t1 where f2=f1;
@ -1527,6 +1542,13 @@ CREATE PROCEDURE or()
CREATE PROCEDURE order()
SELECT * from t1 where f2=f1;
CREATE PROCEDURE ordinality()
SELECT 1;
CALL ordinality;
DROP PROCEDURE ordinality;
--error ER_PARSE_ERROR
CREATE PROCEDURE out()
SELECT * from t1 where f2=f1;
@ -1539,6 +1561,13 @@ CREATE PROCEDURE outer()
CREATE PROCEDURE outfile()
SELECT * from t1 where f2=f1;
CREATE PROCEDURE path()
SELECT 1;
CALL path();
DROP PROCEDURE path;
--error ER_PARSE_ERROR
CREATE PROCEDURE precision()
SELECT * from t1 where f2=f1;
@ -1619,9 +1648,11 @@ CREATE PROCEDURE right()
CREATE PROCEDURE rlike()
SELECT * from t1 where f2=f1;
--error ER_PARSE_ERROR
CREATE PROCEDURE schema()
SELECT * from t1 where f2=f1;
SELECT 1;
CALL schema();
DROP PROCEDURE schema;
--error ER_PARSE_ERROR
CREATE PROCEDURE schemas()
@ -3481,7 +3512,7 @@ DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
database:BEGIN
SELECT @x;
@ -4284,6 +4315,15 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
json_table:BEGIN
SELECT @x;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -4644,6 +4684,16 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
nested:BEGIN
SELECT @x;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -4765,6 +4815,16 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
ordinality:BEGIN
SELECT @x;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -4801,6 +4861,16 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
path:BEGIN
SELECT @x;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -5066,7 +5136,7 @@ DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
schema:BEGIN
SELECT @x;
@ -8938,7 +9008,7 @@ DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
BEGIN
declare database char;
@ -9736,11 +9806,20 @@ BEGIN
declare join char;
END//
delimiter ;//
--disable_warnings
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
declare json_table char;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -10101,6 +10180,16 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
declare nested char;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -10220,6 +10309,16 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
declare ordinality char;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -10256,6 +10355,16 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
declare path char;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
@ -10506,7 +10615,7 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1()
BEGIN
declare schema char;
@ -11624,7 +11733,7 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
BEGIN
declare database condition for sqlstate '02000';
@ -12360,6 +12469,17 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
CREATE PROCEDURE sp1( )
BEGIN
declare json_table condition for sqlstate '02000';
declare exit handler for json_table set @var2 = 1;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -12690,6 +12810,17 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
CREATE PROCEDURE sp1( )
BEGIN
declare nested condition for sqlstate '02000';
declare exit handler for nested set @var2 = 1;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -12799,6 +12930,17 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
CREATE PROCEDURE sp1( )
BEGIN
declare ordinality condition for sqlstate '02000';
declare exit handler for ordinality set @var2 = 1;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -12832,6 +12974,17 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
CREATE PROCEDURE sp1( )
BEGIN
declare path condition for sqlstate '02000';
declare exit handler for path set @var2 = 1;
END//
delimiter ;//
DROP PROCEDURE sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -13075,7 +13228,7 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
BEGIN
declare schema condition for sqlstate '02000';
@ -14181,7 +14334,7 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
BEGIN
declare database handler for sqlstate '02000' set @var2 = 1;
@ -14850,6 +15003,14 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_UNKNOWN_DATA_TYPE
CREATE PROCEDURE sp1( )
BEGIN
declare json_table handler for sqlstate '02000' set @var2 = 1;
END//
delimiter ;//
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -15150,6 +15311,14 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_UNKNOWN_DATA_TYPE
CREATE PROCEDURE sp1( )
BEGIN
declare nested handler for sqlstate '02000' set @var2 = 1;
END//
delimiter ;//
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -15250,6 +15419,14 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_UNKNOWN_DATA_TYPE
CREATE PROCEDURE sp1( )
BEGIN
declare ordinality handler for sqlstate '02000' set @var2 = 1;
END//
delimiter ;//
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -15280,6 +15457,14 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_UNKNOWN_DATA_TYPE
CREATE PROCEDURE sp1( )
BEGIN
declare path handler for sqlstate '02000' set @var2 = 1;
END//
delimiter ;//
delimiter //;
--error ER_PARSE_ERROR
CREATE PROCEDURE sp1( )
@ -15511,7 +15696,7 @@ delimiter ;//
DROP PROCEDURE IF EXISTS sp1;
delimiter //;
--error ER_PARSE_ERROR
--error ER_UNKNOWN_DATA_TYPE
CREATE PROCEDURE sp1( )
BEGIN
declare schema handler for sqlstate '02000' set @var2 = 1;

Some files were not shown because too many files have changed in this diff Show More