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

Merge 10.6 into 10.11

Some fixes related to commit f838b2d799 and
Rows_log_event::do_apply_event() and Update_rows_log_event::do_exec_row()
for system-versioned tables were provided by Nikita Malyavin.
This was required by test versioning.rpl,trx_id,row.
This commit is contained in:
Marko Mäkelä
2024-03-28 09:16:57 +02:00
319 changed files with 7106 additions and 3441 deletions

View File

@ -53,7 +53,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
${CMAKE_SOURCE_DIR}/extra/wolfssl/wolfssl ${CMAKE_SOURCE_DIR}/extra/wolfssl/wolfssl
${CMAKE_SOURCE_DIR}/extra/wolfssl/wolfssl/wolfssl ${CMAKE_SOURCE_DIR}/extra/wolfssl/wolfssl/wolfssl
) )
SET(SSL_LIBRARIES wolfssl wolfcrypt) SET(SSL_LIBRARIES wolfssl)
SET(SSL_INCLUDE_DIRS ${INC_DIRS}) SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_DEFINES "-DHAVE_OPENSSL -DHAVE_WOLFSSL -DWOLFSSL_USER_SETTINGS") SET(SSL_DEFINES "-DHAVE_OPENSSL -DHAVE_WOLFSSL -DWOLFSSL_USER_SETTINGS")
SET(HAVE_ERR_remove_thread_state ON CACHE INTERNAL "wolfssl doesn't have ERR_remove_thread_state") SET(HAVE_ERR_remove_thread_state ON CACHE INTERNAL "wolfssl doesn't have ERR_remove_thread_state")

View File

@ -1735,8 +1735,6 @@ copy_back()
return(false); return(false);
} }
srv_max_n_threads = 1000;
/* copy undo tablespaces */ /* copy undo tablespaces */
Copy_back_dst_dir dst_dir_buf; Copy_back_dst_dir dst_dir_buf;
@ -1998,8 +1996,6 @@ decrypt_decompress()
bool ret; bool ret;
datadir_iter_t *it = NULL; datadir_iter_t *it = NULL;
srv_max_n_threads = 1000;
/* cd to backup directory */ /* cd to backup directory */
if (my_setwd(xtrabackup_target_dir, MYF(MY_WME))) if (my_setwd(xtrabackup_target_dir, MYF(MY_WME)))
{ {

View File

@ -5285,22 +5285,6 @@ fail:
return(false); return(false);
} }
if (srv_buf_pool_size >= 1000 * 1024 * 1024) {
/* Here we still have srv_pool_size counted
in kilobytes (in 4.0 this was in bytes)
srv_boot() converts the value to
pages; if buffer pool is less than 1000 MB,
assume fewer threads. */
srv_max_n_threads = 50000;
} else if (srv_buf_pool_size >= 8 * 1024 * 1024) {
srv_max_n_threads = 10000;
} else {
srv_max_n_threads = 1000; /* saves several MB of memory,
especially in 64-bit
computers */
}
srv_thread_pool_init(); srv_thread_pool_init();
/* Reset the system variables in the recovery module. */ /* Reset the system variables in the recovery module. */
trx_pool_init(); trx_pool_init();
@ -6658,7 +6642,6 @@ static bool xtrabackup_prepare_func(char** argv)
return(false); return(false);
} }
srv_max_n_threads = 1000;
srv_n_purge_threads = 1; srv_n_purge_threads = 1;
xb_filters_init(); xb_filters_init();

View File

@ -1,86 +1,57 @@
IF(MSVC_INTEL) IF(MSVC_INTEL)
PROJECT(wolfssl C ASM_MASM) PROJECT(wolfssl C ASM_MASM)
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64") ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
PROJECT(wolfssl C ASM) PROJECT(wolfssl C ASM)
ELSE() ELSE()
PROJECT(wolfssl C) PROJECT(wolfssl C)
ENDIF() ENDIF()
IF(CMAKE_SIZEOF_VOID_P MATCHES 8) IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
IF(MSVC_INTEL) IF(MSVC_INTEL AND NOT (CMAKE_C_COMPILER_ID MATCHES Clang))
SET(WOLFSSL_INTELASM ON) SET(WOLFSSL_INTELASM ON)
SET(WOLFSSL_X86_64_BUILD 1)
SET(HAVE_INTEL_RDSEED 1) SET(HAVE_INTEL_RDSEED 1)
SET(HAVE_INTEL_RDRAND 1) SET(HAVE_INTEL_RDRAND 1)
ELSEIF(CMAKE_ASM_COMPILER_ID MATCHES "Clang" AND CMAKE_VERSION VERSION_LESS 3.16)
# WolfSSL 5.5.4 bug workaround below does not work, due to some CMake bug
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64") ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
SET(WOLFSSL_X86_64_BUILD 1)
IF(CMAKE_C_COMPILER_ID MATCHES GNU AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) IF(CMAKE_C_COMPILER_ID MATCHES GNU AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
MESSAGE_ONCE(NO_INTEL_ASSEMBLY "Disable Intel assembly for WolfSSL - compiler is too old") MESSAGE_ONCE(NO_INTEL_ASSEMBLY "Disable Intel assembly for WolfSSL - compiler is too old")
ELSEIF(WITH_MSAN)
MESSAGE_ONCE(MSAN_CANT_HANDLE_IT "Disable Intel assembly for WolfSSL - MSAN can't handle it")
ELSE() ELSE()
IF(WITH_MSAN) MY_CHECK_C_COMPILER_FLAG(-maes)
MESSAGE_ONCE(MSAN_CANT_HANDLE_IT MY_CHECK_C_COMPILER_FLAG(-msse4)
"Disable Intel assembly for WolfSSL - MSAN can't handle it") MY_CHECK_C_COMPILER_FLAG(-mpclmul)
ELSE() IF(have_C__maes AND have_C__msse4 AND have_C__mpclmul)
MY_CHECK_C_COMPILER_FLAG(-maes) SET(WOLFSSL_INTELASM ON)
MY_CHECK_C_COMPILER_FLAG(-msse4) MY_CHECK_C_COMPILER_FLAG(-mrdrnd)
MY_CHECK_C_COMPILER_FLAG(-mpclmul) MY_CHECK_C_COMPILER_FLAG(-mrdseed)
IF(have_C__maes AND have_C__msse4 AND have_C__mpclmul) IF(have_C__mrdrnd)
SET(WOLFSSL_INTELASM ON) SET(HAVE_INTEL_RDRAND ON)
ENDIF()
IF(have_C__mrdseed)
SET(HAVE_INTEL_RDSEED ON)
ENDIF() ENDIF()
ENDIF()
MY_CHECK_C_COMPILER_FLAG(-mrdrnd)
MY_CHECK_C_COMPILER_FLAG(-mrdseed)
IF(have_C__mrdrnd)
SET(HAVE_INTEL_RDRAND ON)
ENDIF()
IF(have_C__mrdseed)
SET(HAVE_INTEL_RDSEED ON)
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
SET(WOLFSSL_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/src) SET(WOLFSSL_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/src)
ADD_DEFINITIONS(${SSL_DEFINES})
SET(WOLFSSL_SOURCES
${WOLFSSL_SRCDIR}/crl.c
${WOLFSSL_SRCDIR}/internal.c
${WOLFSSL_SRCDIR}/keys.c
${WOLFSSL_SRCDIR}/tls.c
${WOLFSSL_SRCDIR}/wolfio.c
${WOLFSSL_SRCDIR}/ocsp.c
${WOLFSSL_SRCDIR}/ssl.c
${WOLFSSL_SRCDIR}/tls13.c)
ADD_DEFINITIONS(-DWOLFSSL_LIB -DBUILDING_WOLFSSL)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl)
IF(MSVC)
# size_t to long truncation warning
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4267 -wd4334 -wd4028 -wd4244")
ENDIF()
ADD_CONVENIENCE_LIBRARY(wolfssl ${WOLFSSL_SOURCES})
# Workaround linker crash with older Ubuntu binutils
# e.g aborting at ../../bfd/merge.c line 873 in _bfd_merged_section_offset
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
STRING(REPLACE "-g " "-g1 " CMAKE_C_FLAGS_RELWITHDEBINFO
${CMAKE_C_FLAGS_RELWITHDEBINFO})
STRING(REPLACE "-g " "-g1 " CMAKE_C_FLAGS_DEBUG
${CMAKE_C_FLAGS_DEBUG})
STRING(REPLACE "-ggdb3 " " " CMAKE_C_FLAGS_RELWITHDEBINFO
${CMAKE_C_FLAGS_RELWITHDEBINFO})
STRING(REPLACE "-ggdb3 " " " CMAKE_C_FLAGS_DEBUG
${CMAKE_C_FLAGS_DEBUG})
ENDIF()
SET(WOLFCRYPT_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfcrypt/src) SET(WOLFCRYPT_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/wolfcrypt/src)
SET(WOLFCRYPT_SOURCES ADD_DEFINITIONS(${SSL_DEFINES})
ADD_DEFINITIONS(-DWOLFSSL_LIB -DBUILDING_WOLFSSL)
ADD_DEFINITIONS(-DWOLFSSL_SP_4096)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl)
INCLUDE_DIRECTORIES(${SSL_INCLUDE_DIRS})
add_library(wolfssl STATIC
${WOLFSSL_SRCDIR}/crl.c
${WOLFSSL_SRCDIR}/internal.c
${WOLFSSL_SRCDIR}/keys.c
${WOLFSSL_SRCDIR}/tls.c
${WOLFSSL_SRCDIR}/wolfio.c
${WOLFSSL_SRCDIR}/ocsp.c
${WOLFSSL_SRCDIR}/ssl.c
${WOLFSSL_SRCDIR}/tls13.c
${WOLFCRYPT_SRCDIR}/aes.c ${WOLFCRYPT_SRCDIR}/aes.c
${WOLFCRYPT_SRCDIR}/arc4.c ${WOLFCRYPT_SRCDIR}/arc4.c
${WOLFCRYPT_SRCDIR}/asn.c ${WOLFCRYPT_SRCDIR}/asn.c
@ -110,69 +81,56 @@ ${WOLFCRYPT_SRCDIR}/wc_encrypt.c
${WOLFCRYPT_SRCDIR}/hash.c ${WOLFCRYPT_SRCDIR}/hash.c
${WOLFCRYPT_SRCDIR}/wolfmath.c ${WOLFCRYPT_SRCDIR}/wolfmath.c
${WOLFCRYPT_SRCDIR}/kdf.c ${WOLFCRYPT_SRCDIR}/kdf.c
${WOLFCRYPT_SRCDIR}/sp_int.c
${WOLFCRYPT_SRCDIR}/sp_c32.c
${WOLFCRYPT_SRCDIR}/sp_c64.c
) )
# Use fastmath large number math library. # Optimizations, assembly
IF(NOT (MSVC AND CMAKE_C_COMPILER_ID MATCHES Clang)) if(WOLFSSL_INTELASM)
# Can't use clang-cl with WOLFSSL_FASTMATH set(WOLFSSL_X86_64_BUILD 1)
# due to https://bugs.llvm.org/show_bug.cgi?id=25305 set(WOLFSSL_SP_X86_64 1)
SET(WOLFSSL_FASTMATH 1) set(WOLFSSL_SP_X86_64_ASM 1)
ENDIF() set(WOLFSSL_AESNI 1)
target_sources(wolfssl PRIVATE
IF(WOLFSSL_FASTMATH) ${WOLFCRYPT_SRCDIR}/cpuid.c
SET(USE_FAST_MATH 1) ${WOLFCRYPT_SRCDIR}/sp_x86_64.c
SET(TFM_TIMING_RESISTANT 1) )
# FP_MAX_BITS is set high solely to satisfy ssl_8k_key.test if(MSVC_INTEL)
# WolfSSL will use more stack space with it target_sources(wolfssl PRIVATE
SET(FP_MAX_BITS 16384) ${WOLFCRYPT_SRCDIR}/aes_asm.asm
SET(WOLFCRYPT_SOURCES ${WOLFCRYPT_SOURCES} ${WOLFCRYPT_SRCDIR}/tfm.c) ${WOLFCRYPT_SRCDIR}/aes_gcm_asm.asm
IF((CMAKE_SIZEOF_VOID_P MATCHES 4) AND (CMAKE_SYSTEM_PROCESSOR MATCHES "86") ${WOLFCRYPT_SRCDIR}/sp_x86_64_asm.asm
AND (NOT MSVC)) )
# Workaround https://github.com/wolfSSL/wolfssl/issues/4245 target_compile_options(wolfssl PRIVATE
# On 32bit Intel, to satisfy inline assembly's wish for free registers $<$<COMPILE_LANG_AND_ID:C,Clang>:-maes -msse4.2 -mpclmul -mrdrnd -mrdseed>
# 1. use -fomit-frame-pointer $<$<COMPILE_LANGUAGE:ASM_MASM>:/Zi>
# 2. With GCC 4, additionally use -fno-PIC, which works on x86 )
# (modern GCC has PIC optimizations, that make it unnecessary) else()
# The following assumes GCC or Clang set(USE_INTEL_SPEEDUP 1)
SET(TFM_COMPILE_FLAGS "-fomit-frame-pointer") target_sources(wolfssl PRIVATE
IF(CMAKE_C_COMPILER_VERSION VERSION_LESS "5")
SET(TFM_COMPILE_FLAGS "${TFM_COMPILE_FLAGS} -fno-PIC")
ENDIF()
SET_SOURCE_FILES_PROPERTIES(${WOLFCRYPT_SRCDIR}/tfm.c
PROPERTIES COMPILE_FLAGS ${TFM_COMPILE_FLAGS})
ENDIF()
ELSE()
SET(WOLFSSL_SP_MATH_ALL 1)
SET(WOLFCRYPT_SOURCES ${WOLFCRYPT_SOURCES} ${WOLFCRYPT_SRCDIR}/sp_int.c)
ENDIF()
IF(WOLFSSL_X86_64_BUILD)
LIST(APPEND WOLFCRYPT_SOURCES ${WOLFCRYPT_SRCDIR}/cpuid.c)
IF(MSVC)
SET(WOLFSSL_AESNI 1)
LIST(APPEND WOLFCRYPT_SOURCES
${WOLFCRYPT_SRCDIR}/aes_asm.asm
${WOLFCRYPT_SRCDIR}/aes_gcm_asm.asm)
IF(CMAKE_C_COMPILER_ID MATCHES Clang)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes -msse4.2 -mpclmul -mrdrnd -mrdseed")
ENDIF()
ELSEIF(WOLFSSL_INTELASM)
SET(WOLFSSL_AESNI 1)
SET(USE_INTEL_SPEEDUP 1)
LIST(APPEND WOLFCRYPT_SOURCES
${WOLFCRYPT_SRCDIR}/aes_asm.S ${WOLFCRYPT_SRCDIR}/aes_asm.S
${WOLFCRYPT_SRCDIR}/aes_gcm_asm.S ${WOLFCRYPT_SRCDIR}/aes_gcm_asm.S
${WOLFCRYPT_SRCDIR}/chacha_asm.S ${WOLFCRYPT_SRCDIR}/chacha_asm.S
${WOLFCRYPT_SRCDIR}/poly1305_asm.S ${WOLFCRYPT_SRCDIR}/poly1305_asm.S
${WOLFCRYPT_SRCDIR}/sha512_asm.S ${WOLFCRYPT_SRCDIR}/sha512_asm.S
${WOLFCRYPT_SRCDIR}/sha256_asm.S) ${WOLFCRYPT_SRCDIR}/sha256_asm.S
ADD_DEFINITIONS(-maes -msse4.2 -mpclmul) ${WOLFCRYPT_SRCDIR}/sp_x86_64_asm.S
# WolfSSL 5.5.4 bug - user_settings.h not included into aes_asm.S )
SET_PROPERTY(SOURCE ${WOLFCRYPT_SRCDIR}/aes_asm.S APPEND PROPERTY COMPILE_OPTIONS "-DWOLFSSL_X86_64_BUILD") target_compile_options(wolfssl PRIVATE -maes -msse4.2 -mpclmul)
ENDIF() # Workaround 5.5.4 bug (user_settings.h not included into aes_asm.S)
ENDIF() set_property(SOURCE ${WOLFCRYPT_SRCDIR}/aes_asm.S APPEND PROPERTY COMPILE_OPTIONS "-DWOLFSSL_X86_64_BUILD")
endif()
endif()
# Silence some warnings
if(MSVC)
# truncation warnings
target_compile_options(wolfssl PRIVATE $<$<COMPILE_LANGUAGE:C>:/wd4244>)
if(CMAKE_C_COMPILER_ID MATCHES Clang)
target_compile_options(wolfssl PRIVATE $<$<COMPILE_LANGUAGE:C>:-Wno-incompatible-function-pointer-types>)
endif()
endif()
CONFIGURE_FILE(user_settings.h.in user_settings.h) CONFIGURE_FILE(user_settings.h.in user_settings.h)
INCLUDE_DIRECTORIES(${SSL_INCLUDE_DIRS})
ADD_CONVENIENCE_LIBRARY(wolfcrypt ${WOLFCRYPT_SOURCES})

View File

@ -21,6 +21,7 @@
#define HAVE_AESGCM #define HAVE_AESGCM
#define HAVE_CHACHA #define HAVE_CHACHA
#define HAVE_POLY1305 #define HAVE_POLY1305
#define HAVE_THREAD_LS
#define WOLFSSL_AES_COUNTER #define WOLFSSL_AES_COUNTER
#define NO_WOLFSSL_STUB #define NO_WOLFSSL_STUB
#define OPENSSL_ALL #define OPENSSL_ALL
@ -51,20 +52,19 @@
#define NO_RABBIT #define NO_RABBIT
#define NO_RC4 #define NO_RC4
/*
FP_MAX_BITS is set high solely to satisfy ssl_8k_key.test
WolfSSL will use more stack space with it, with fastmath
*/
#cmakedefine FP_MAX_BITS 16384
#define RSA_MAX_SIZE 8192 #define RSA_MAX_SIZE 8192
#define WOLFSSL_SP_MATH_ALL
#define WOLFSSL_HAVE_SP_RSA
#ifndef WOLFSSL_SP_4096
#define WOLFSSL_SP_4096
#endif
#cmakedefine WOLFSSL_AESNI #cmakedefine WOLFSSL_AESNI
#cmakedefine USE_FAST_MATH
#cmakedefine TFM_TIMING_RESISTANT
#cmakedefine HAVE_INTEL_RDSEED #cmakedefine HAVE_INTEL_RDSEED
#cmakedefine HAVE_INTEL_RDRAND #cmakedefine HAVE_INTEL_RDRAND
#cmakedefine USE_INTEL_SPEEDUP #cmakedefine USE_INTEL_SPEEDUP
#cmakedefine USE_FAST_MATH
#cmakedefine WOLFSSL_X86_64_BUILD #cmakedefine WOLFSSL_X86_64_BUILD
#cmakedefine WOLFSSL_SP_MATH_ALL #cmakedefine WOLFSSL_SP_X86_64
#cmakedefine WOLFSSL_SP_X86_64_ASM
#endif /* WOLFSSL_USER_SETTINGS_H */ #endif /* WOLFSSL_USER_SETTINGS_H */

View File

@ -49,6 +49,7 @@
#define HA_OPEN_MERGE_TABLE 2048U #define HA_OPEN_MERGE_TABLE 2048U
#define HA_OPEN_FOR_CREATE 4096U #define HA_OPEN_FOR_CREATE 4096U
#define HA_OPEN_FOR_DROP (1U << 13) /* Open part of drop */ #define HA_OPEN_FOR_DROP (1U << 13) /* Open part of drop */
#define HA_OPEN_GLOBAL_TMP_TABLE (1U << 14) /* TMP table used by repliction */
/* /*
Allow opening even if table is incompatible as this is for ALTER TABLE which Allow opening even if table is incompatible as this is for ALTER TABLE which
@ -369,6 +370,12 @@ enum ha_base_keytype {
#define HA_CREATE_INTERNAL_TABLE 256U #define HA_CREATE_INTERNAL_TABLE 256U
#define HA_PRESERVE_INSERT_ORDER 512U #define HA_PRESERVE_INSERT_ORDER 512U
#define HA_CREATE_NO_ROLLBACK 1024U #define HA_CREATE_NO_ROLLBACK 1024U
/*
A temporary table that can be used by different threads, eg. replication
threads. This flag ensure that memory is not allocated with THREAD_SPECIFIC,
as we do for other temporary tables.
*/
#define HA_CREATE_GLOBAL_TMP_TABLE 2048U
/* Flags used by start_bulk_insert */ /* Flags used by start_bulk_insert */

View File

@ -22,14 +22,15 @@
#include <m_string.h> #include <m_string.h>
#include <my_pthread.h> #include <my_pthread.h>
typedef uint32 my_bitmap_map; typedef ulonglong my_bitmap_map;
typedef struct st_bitmap typedef struct st_bitmap
{ {
my_bitmap_map *bitmap; my_bitmap_map *bitmap;
my_bitmap_map *last_word_ptr; my_bitmap_map *last_word_ptr;
my_bitmap_map last_word_mask; my_bitmap_map last_bit_mask;
uint32 n_bits; /* number of bits occupied by the above */ uint32 n_bits; /* number of bits occupied by the above */
my_bool bitmap_allocated;
} MY_BITMAP; } MY_BITMAP;
#ifdef __cplusplus #ifdef __cplusplus
@ -39,7 +40,7 @@ extern "C" {
/* Reset memory. Faster then doing a full bzero */ /* Reset memory. Faster then doing a full bzero */
#define my_bitmap_clear(A) ((A)->bitmap= 0) #define my_bitmap_clear(A) ((A)->bitmap= 0)
extern void create_last_word_mask(MY_BITMAP *map); extern void create_last_bit_mask(MY_BITMAP *map);
extern my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits); extern my_bool my_bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits);
extern my_bool bitmap_is_clear_all(const MY_BITMAP *map); extern my_bool bitmap_is_clear_all(const MY_BITMAP *map);
extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size);
@ -53,12 +54,12 @@ extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit); extern my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1, extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
const MY_BITMAP *map2); const MY_BITMAP *map2);
extern my_bool bitmap_exists_intersection(const MY_BITMAP **bitmap_array, extern my_bool bitmap_exists_intersection(MY_BITMAP **bitmap_array,
uint bitmap_count, uint bitmap_count,
uint start_bit, uint end_bit); uint start_bit, uint end_bit);
extern uint bitmap_set_next(MY_BITMAP *map); extern uint bitmap_set_next(MY_BITMAP *map);
extern uint bitmap_get_first(const MY_BITMAP *map); extern uint bitmap_get_first_clear(const MY_BITMAP *map);
extern uint bitmap_get_first_set(const MY_BITMAP *map); extern uint bitmap_get_first_set(const MY_BITMAP *map);
extern uint bitmap_bits_set(const MY_BITMAP *map); extern uint bitmap_bits_set(const MY_BITMAP *map);
extern uint bitmap_get_next_set(const MY_BITMAP *map, uint bitmap_bit); extern uint bitmap_get_next_set(const MY_BITMAP *map, uint bitmap_bit);
@ -71,54 +72,70 @@ extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2); extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_invert(MY_BITMAP *map); extern void bitmap_invert(MY_BITMAP *map);
extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2); extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
/* Functions to export/import bitmaps to an architecture independent format */
extern void bitmap_export(uchar *to, MY_BITMAP *map);
extern void bitmap_import(MY_BITMAP *map, uchar *from);
#define my_bitmap_map_bytes sizeof(my_bitmap_map)
#define my_bitmap_map_bits (my_bitmap_map_bytes*8)
/* Size in bytes to store 'bits' number of bits */
#define bitmap_buffer_size(bits) (MY_ALIGN((bits), my_bitmap_map_bits)/8)
#define my_bitmap_buffer_size(map) bitmap_buffer_size((map)->n_bits)
#define no_bytes_in_export_map(map) (((map)->n_bits + 7)/8)
#define no_words_in_map(map) (((map)->n_bits + (my_bitmap_map_bits-1))/my_bitmap_map_bits)
/* Fast, not thread safe, bitmap functions */ /* Fast, not thread safe, bitmap functions */
#define bitmap_buffer_size(bits) (((bits)+31)/32)*4 /* The following functions must be compatible with create_last_bit_mask()! */
#define no_bytes_in_map(map) (((map)->n_bits + 7)/8)
#define no_words_in_map(map) (((map)->n_bits + 31)/32)
#define bytes_word_aligned(bytes) (4*((bytes + 3)/4))
/* The following functions must be compatible with create_last_word_mask()! */
static inline void static inline void
bitmap_set_bit(MY_BITMAP *map,uint bit) bitmap_set_bit(MY_BITMAP *map,uint bit)
{ {
uchar *b= (uchar*) map->bitmap + bit / 8;
DBUG_ASSERT(bit < map->n_bits); DBUG_ASSERT(bit < map->n_bits);
*b= (uchar) (*b | 1U << (bit & 7)); map->bitmap[bit/my_bitmap_map_bits]|=
(1ULL << (bit & (my_bitmap_map_bits-1)));
} }
static inline void static inline void
bitmap_flip_bit(MY_BITMAP *map,uint bit) bitmap_flip_bit(MY_BITMAP *map,uint bit)
{ {
uchar *b= (uchar*) map->bitmap + bit / 8;
DBUG_ASSERT(bit < map->n_bits); DBUG_ASSERT(bit < map->n_bits);
*b= (uchar) (*b ^ 1U << (bit & 7)); map->bitmap[bit/my_bitmap_map_bits]^=
(1ULL << (bit & (my_bitmap_map_bits-1)));
} }
static inline void static inline void
bitmap_clear_bit(MY_BITMAP *map,uint bit) bitmap_clear_bit(MY_BITMAP *map,uint bit)
{ {
uchar *b= (uchar*) map->bitmap + bit / 8;
DBUG_ASSERT(bit < map->n_bits); DBUG_ASSERT(bit < map->n_bits);
*b= (uchar) (*b & ~(1U << (bit & 7))); map->bitmap[bit/my_bitmap_map_bits]&=
~(1ULL << (bit & (my_bitmap_map_bits-1)));
} }
static inline uint static inline uint
bitmap_is_set(const MY_BITMAP *map,uint bit) bitmap_is_set(const MY_BITMAP *map,uint bit)
{ {
const uchar *b= (const uchar*) map->bitmap + bit / 8;
DBUG_ASSERT(bit < map->n_bits); DBUG_ASSERT(bit < map->n_bits);
return !!(*b & (1U << (bit & 7))); return (!!(map->bitmap[bit/my_bitmap_map_bits] &
(1ULL << (bit & (my_bitmap_map_bits-1)))));
} }
/* Return true if bitmaps are equal */
static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
{ {
if (memcmp(map1->bitmap, map2->bitmap, 4*(no_words_in_map(map1)-1)) != 0) DBUG_ASSERT(map1->n_bits == map2->n_bits);
return FALSE; return (memcmp(map1->bitmap, map2->bitmap,
return ((*map1->last_word_ptr | map1->last_word_mask) == my_bitmap_buffer_size(map1)) == 0);
(*map2->last_word_ptr | map2->last_word_mask));
} }
#define bitmap_clear_all(MAP) \ #define bitmap_clear_all(MAP) \
{ memset((MAP)->bitmap, 0, 4*no_words_in_map((MAP))); } { memset((MAP)->bitmap, 0, my_bitmap_buffer_size(MAP)); }
#define bitmap_set_all(MAP) \
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP)))) static inline void
bitmap_set_all(const MY_BITMAP *map)
{
if (map->n_bits)
{
memset(map->bitmap, 0xFF, my_bitmap_map_bytes * (no_words_in_map(map)-1));
DBUG_ASSERT(map->bitmap + no_words_in_map(map)-1 == map->last_word_ptr);
*map->last_word_ptr= ~map->last_bit_mask;
}
}
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -973,6 +973,7 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define SOCKET_ECONNRESET WSAECONNRESET #define SOCKET_ECONNRESET WSAECONNRESET
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#define SOCKET_CLOSED EIO
#else /* Unix */ #else /* Unix */
#define socket_errno errno #define socket_errno errno
#define closesocket(A) close(A) #define closesocket(A) close(A)
@ -982,6 +983,7 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define SOCKET_EADDRINUSE EADDRINUSE #define SOCKET_EADDRINUSE EADDRINUSE
#define SOCKET_ETIMEDOUT ETIMEDOUT #define SOCKET_ETIMEDOUT ETIMEDOUT
#define SOCKET_ECONNRESET ECONNRESET #define SOCKET_ECONNRESET ECONNRESET
#define SOCKET_CLOSED EIO
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#endif #endif

View File

@ -478,6 +478,7 @@ typedef struct st_net {
my_bool thread_specific_malloc; my_bool thread_specific_malloc;
unsigned char compress; unsigned char compress;
my_bool pkt_nr_can_be_reset; my_bool pkt_nr_can_be_reset;
my_bool using_proxy_protocol;
/* /*
Pointer to query object in query cache, do not equal NULL (0) for Pointer to query object in query cache, do not equal NULL (0) for
queries in cache that have not stored its results yet queries in cache that have not stored its results yet

View File

@ -41,6 +41,13 @@ enum enum_vio_type
VIO_TYPE_SSL VIO_TYPE_SSL
/* see also vio_type_names[] */ /* see also vio_type_names[] */
}; };
enum enum_vio_state
{
VIO_STATE_NOT_INITIALIZED, VIO_STATE_ACTIVE, VIO_STATE_SHUTDOWN,
VIO_STATE_CLOSED
};
#define FIRST_VIO_TYPE VIO_CLOSED #define FIRST_VIO_TYPE VIO_CLOSED
#define LAST_VIO_TYPE VIO_TYPE_SSL #define LAST_VIO_TYPE VIO_TYPE_SSL
@ -244,6 +251,7 @@ struct st_vio
struct sockaddr_storage local; /* Local internet address */ struct sockaddr_storage local; /* Local internet address */
struct sockaddr_storage remote; /* Remote internet address */ struct sockaddr_storage remote; /* Remote internet address */
enum enum_vio_type type; /* Type of connection */ enum enum_vio_type type; /* Type of connection */
enum enum_vio_state state; /* State of the connection */
const char *desc; /* String description */ const char *desc; /* String description */
char *read_buffer; /* buffer for vio_read_buff */ char *read_buffer; /* buffer for vio_read_buff */
char *read_pos; /* start of unfetched data in the char *read_pos; /* start of unfetched data in the

View File

@ -23,6 +23,8 @@ void init_embedded_mysql(MYSQL *mysql, ulong client_flag);
void *create_embedded_thd(ulong client_flag); void *create_embedded_thd(ulong client_flag);
int check_embedded_connection(MYSQL *mysql, const char *db); int check_embedded_connection(MYSQL *mysql, const char *db);
void free_old_query(MYSQL *mysql); void free_old_query(MYSQL *mysql);
THD *embedded_get_current_thd();
void embedded_set_current_thd(THD *thd);
extern MYSQL_METHODS embedded_methods; extern MYSQL_METHODS embedded_methods;
/* This one is used by embedded library to gather returning data */ /* This one is used by embedded library to gather returning data */

View File

@ -111,7 +111,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
MYSQL_STMT *stmt) MYSQL_STMT *stmt)
{ {
my_bool result= 1; my_bool result= 1;
THD *thd=(THD *) mysql->thd; THD *thd=(THD *) mysql->thd, *old_current_thd= current_thd;
NET *net= &mysql->net; NET *net= &mysql->net;
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE; my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
@ -122,6 +122,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
else else
{ {
free_embedded_thd(mysql); free_embedded_thd(mysql);
if (old_current_thd == thd)
old_current_thd= 0;
thd= 0; thd= 0;
} }
} }
@ -179,6 +181,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
end: end:
thd->reset_globals(); thd->reset_globals();
if (old_current_thd)
old_current_thd->store_globals();
return result; return result;
} }
@ -434,12 +438,15 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row)
static void free_embedded_thd(MYSQL *mysql) static void free_embedded_thd(MYSQL *mysql)
{ {
THD *thd= (THD*)mysql->thd; THD *thd= (THD*)mysql->thd, *org_current_thd= current_thd;
server_threads.erase(thd); server_threads.erase(thd);
thd->clear_data_list(); thd->clear_data_list();
thd->store_globals(); thd->store_globals();
delete thd; delete thd;
set_current_thd(nullptr); if (thd == org_current_thd)
set_current_thd(nullptr);
else
set_current_thd(org_current_thd);
mysql->thd=0; mysql->thd=0;
} }
@ -729,6 +736,17 @@ void *create_embedded_thd(ulong client_flag)
} }
THD *embedded_get_current_thd()
{
return current_thd;
}
void embedded_set_current_thd(THD *thd)
{
set_current_thd(thd);
}
#ifdef NO_EMBEDDED_ACCESS_CHECKS #ifdef NO_EMBEDDED_ACCESS_CHECKS
static void static void
emb_transfer_connect_attrs(MYSQL *mysql) emb_transfer_connect_attrs(MYSQL *mysql)

View File

@ -78,7 +78,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
uint port, const char *unix_socket,ulong client_flag) uint port, const char *unix_socket,ulong client_flag)
{ {
char name_buff[USERNAME_LENGTH]; char name_buff[USERNAME_LENGTH];
THD *org_current_thd= embedded_get_current_thd();
DBUG_ENTER("mysql_real_connect"); DBUG_ENTER("mysql_real_connect");
DBUG_PRINT("enter",("host: %s db: %s user: %s (libmysqld)", DBUG_PRINT("enter",("host: %s db: %s user: %s (libmysqld)",
host ? host : "(Null)", host ? host : "(Null)",
@ -200,6 +200,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
} }
} }
} }
embedded_set_current_thd(org_current_thd);
DBUG_PRINT("exit",("Mysql handler: %p", mysql)); DBUG_PRINT("exit",("Mysql handler: %p", mysql));
DBUG_RETURN(mysql); DBUG_RETURN(mysql);
@ -216,6 +217,7 @@ error:
mysql_close(mysql); mysql_close(mysql);
mysql->free_me=free_me; mysql->free_me=free_me;
} }
embedded_set_current_thd(org_current_thd);
DBUG_RETURN(0); DBUG_RETURN(0);
} }

View File

@ -103,7 +103,6 @@ connection con2;
# The following query should hang because con1 is locking the record # The following query should hang because con1 is locking the record
update t2 set a=2 where b = 0; update t2 set a=2 where b = 0;
select * from t2;
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2 --sleep 2

View File

@ -22,7 +22,6 @@ select * from t1;
connection con1; connection con1;
begin work; begin work;
insert into t1 values (5); insert into t1 values (5);
select * from t1;
# Lock wait timeout set to 2 seconds in <THIS TEST>-master.opt; this # Lock wait timeout set to 2 seconds in <THIS TEST>-master.opt; this
# statement will time out; in 5.0.13+, it will not roll back transaction. # statement will time out; in 5.0.13+, it will not roll back transaction.
--error ER_LOCK_WAIT_TIMEOUT --error ER_LOCK_WAIT_TIMEOUT

View File

@ -9,9 +9,6 @@
# #
# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set # The environment variables SEARCH_FILE and SEARCH_PATTERN must be set
# before sourcing this routine. # before sourcing this routine.
# SEARCH_TYPE can also be set to either NULL(default) or _gm_
# NULL is equivalent of using m/SEARCH_PATTERN/gs
# _gm_ is equivalent of using m/SEARCH_RANGE/gm
# #
# Optionally, SEARCH_RANGE can be set to the max number of bytes of the file # Optionally, SEARCH_RANGE can be set to the max number of bytes of the file
# to search. If negative, it will search that many bytes at the end of the # to search. If negative, it will search that many bytes at the end of the
@ -52,15 +49,12 @@
# Created: 2011-11-11 mleich # Created: 2011-11-11 mleich
# #
--error 0,1
perl; perl;
use strict; use strict;
die "SEARCH_FILE not set" unless $ENV{SEARCH_FILE}; die "SEARCH_FILE not set" unless $ENV{SEARCH_FILE};
my @search_files= glob($ENV{SEARCH_FILE}); my @search_files= glob($ENV{SEARCH_FILE});
my $search_pattern= $ENV{SEARCH_PATTERN} or die "SEARCH_PATTERN not set"; my $search_pattern= $ENV{SEARCH_PATTERN} or die "SEARCH_PATTERN not set";
my $search_range= $ENV{SEARCH_RANGE}; my $search_range= $ENV{SEARCH_RANGE};
my $silent= $ENV{SEARCH_SILENT};
my $search_result= 0;
my $content; my $content;
foreach my $search_file (@search_files) { foreach my $search_file (@search_files) {
open(FILE, '<', $search_file) || die("Can't open file $search_file: $!"); open(FILE, '<', $search_file) || die("Can't open file $search_file: $!");
@ -84,52 +78,23 @@ perl;
close(FILE); close(FILE);
$content.= $file_content; $content.= $file_content;
} }
my @matches; my @matches= ($content =~ /$search_pattern/gs);
if (not defined($ENV{SEARCH_TYPE})) my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
{
@matches=($content =~ /$search_pattern/gs);
}
elsif($ENV{SEARCH_TYPE} == "_gm_")
{
@matches=($content =~ /$search_pattern/gm);
}
my $res;
if (@matches)
{
$res="FOUND " . scalar(@matches);
$search_result= 1;
}
else
{
$res= "NOT FOUND";
}
$ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1}; $ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1};
if (!$silent || $search_result) if ($ENV{SEARCH_OUTPUT} eq "matches") {
{ foreach (@matches) {
if ($ENV{SEARCH_OUTPUT} eq "matches") print $_ . "\n";
{
foreach (@matches)
{
print $_ . "\n";
}
}
elsif ($ENV{SEARCH_OUTPUT} eq "count")
{
print "$res matches in $ENV{SEARCH_FILE}\n";
}
else
{
print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n";
} }
} }
die "$ENV{SEARCH_ABORT}\n" elsif ($ENV{SEARCH_OUTPUT} eq "count")
if $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/; {
exit($search_result != 1); print "$res matches in $ENV{SEARCH_FILE}\n";
}
elsif ($ENV{SEARCH_ABORT} and $res =~ /^$ENV{SEARCH_ABORT}/) {
die "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n";
} else {
print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n";
}
EOF EOF
let $SEARCH_RESULT= 1; # Found pattern
if ($errno)
{
let $SEARCH_RESULT= 0; # Did not find pattern
}

View File

@ -25,23 +25,23 @@ if (!$_timeout)
} }
let $_timeout_counter=`SELECT $_timeout * 10`; let $_timeout_counter=`SELECT $_timeout * 10`;
let SEARCH_SILENT=1; let SEARCH_ABORT=NOT FOUND;
let $_continue= 1; let $_continue= 1;
disable_abort_on_error;
while ($_continue) while ($_continue)
{ {
source include/search_pattern_in_file.inc; source include/search_pattern_in_file.inc;
if ($SEARCH_RESULT) if (!$errno)
{ {
# Found match # Found match
let $_continue= 0; let $_continue= 0;
} }
if (!$SEARCH_RESULT) if ($errno)
{ {
dec $_timeout_counter; dec $_timeout_counter;
if ($_timeout_counter == 1) if ($_timeout_counter == 1)
{ {
let $SEARCH_SILENT= 0; enable_abort_on_error;
} }
if (!$_timeout_counter) if (!$_timeout_counter)
{ {
@ -49,8 +49,7 @@ while ($_continue)
} }
} }
} }
enable_abort_on_error;
let SEARCH_SILENT=0;
--source include/end_include_file.inc --source include/end_include_file.inc
--let $keep_include_silent=$wait_save_keep_include_silent --let $keep_include_silent=$wait_save_keep_include_silent

View File

@ -3124,6 +3124,14 @@ CREATE TEMPORARY TABLE t2 LIKE t1;
DROP TEMPORARY TABLE t2; DROP TEMPORARY TABLE t2;
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-33313 Incorrect error message for "ALTER TABLE ... DROP CONSTRAINT ..., DROP col, DROP col"
#
create table t2(id int primary key) engine=innodb;
create table t1(id int primary key, t2_id int, constraint t1_fk_t2_id foreign key(t2_id) references t2(id)) engine=innodb;
alter table t1 drop constraint t1_fk_t2_id, drop t2_id, drop t2_id;
ERROR 42000: Can't DROP COLUMN `t2_id`; check that it exists
drop table t1, t2;
#
# End of 10.6 tests # End of 10.6 tests
# #
# #

View File

@ -2406,6 +2406,15 @@ CREATE TEMPORARY TABLE t2 LIKE t1;
DROP TEMPORARY TABLE t2; DROP TEMPORARY TABLE t2;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-33313 Incorrect error message for "ALTER TABLE ... DROP CONSTRAINT ..., DROP col, DROP col"
--echo #
create table t2(id int primary key) engine=innodb;
create table t1(id int primary key, t2_id int, constraint t1_fk_t2_id foreign key(t2_id) references t2(id)) engine=innodb;
--error ER_CANT_DROP_FIELD_OR_KEY
alter table t1 drop constraint t1_fk_t2_id, drop t2_id, drop t2_id;
drop table t1, t2;
--echo # --echo #
--echo # End of 10.6 tests --echo # End of 10.6 tests
--echo # --echo #

View File

@ -780,3 +780,27 @@ string
# #
# End of 10.2 tests # End of 10.2 tests
# #
#
# MDEV-33318 ORDER BY COLLATE improperly applied to non-character columns
#
set names utf8;
create table t1 (ts datetime);
insert t1 values ('2024-01-26 21:37:54'), ('2024-01-26 21:37:54'),
('2024-01-26 21:37:54'), ('2024-01-26 21:37:54'),
('2024-01-26 21:37:58'), ('2024-01-26 21:37:58'),
('2024-01-26 21:37:58'), ('2024-01-26 21:38:02'),
('2024-01-26 21:38:02'), ('2024-01-26 21:38:02');
select * from t1 order by ts collate utf8_bin;
ts
2024-01-26 21:37:54
2024-01-26 21:37:54
2024-01-26 21:37:54
2024-01-26 21:37:54
2024-01-26 21:37:58
2024-01-26 21:37:58
2024-01-26 21:37:58
2024-01-26 21:38:02
2024-01-26 21:38:02
2024-01-26 21:38:02
drop table t1;
# End of 10.6 tests

View File

@ -357,3 +357,18 @@ SELECT COLUMN_GET(COLUMN_CREATE(0, 'string'),0 AS CHAR CHARACTER SET latin1 COLL
--echo # --echo #
--echo # End of 10.2 tests --echo # End of 10.2 tests
--echo # --echo #
--echo #
--echo # MDEV-33318 ORDER BY COLLATE improperly applied to non-character columns
--echo #
set names utf8;
create table t1 (ts datetime);
insert t1 values ('2024-01-26 21:37:54'), ('2024-01-26 21:37:54'),
('2024-01-26 21:37:54'), ('2024-01-26 21:37:54'),
('2024-01-26 21:37:58'), ('2024-01-26 21:37:58'),
('2024-01-26 21:37:58'), ('2024-01-26 21:38:02'),
('2024-01-26 21:38:02'), ('2024-01-26 21:38:02');
select * from t1 order by ts collate utf8_bin;
drop table t1;
--echo # End of 10.6 tests

View File

@ -6520,5 +6520,25 @@ SELECT 1 COLLATE latin1_swedish_ci;
ERROR 42000: COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'ucs2' ERROR 42000: COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'ucs2'
SET NAMES utf8; SET NAMES utf8;
# #
# MDEV-33772 Bad SEPARATOR value in GROUP_CONCAT on character set conversion
#
SET NAMES utf8mb3, @@collation_connection=ucs2_general_ci;
CREATE TABLE t1 (c VARCHAR(10)) CHARACTER SET ucs2;
INSERT INTO t1 VALUES ('a'),('A');
CREATE OR REPLACE VIEW v1 AS
SELECT COUNT(*) AS cnt, GROUP_CONCAT(c) AS c1 FROM t1 GROUP BY c;
SELECT * FROM v1;
cnt c1
2 a,A
SELECT HEX(c1) FROM v1;
HEX(c1)
0061002C0041
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 count(0) AS `cnt`,group_concat(`t1`.`c` separator ',') AS `c1` from `t1` group by `t1`.`c` utf8mb3 ucs2_general_ci
DROP VIEW v1;
DROP TABLE t1;
SET NAMES utf8mb3;
#
# End of 10.5 tests # End of 10.5 tests
# #

View File

@ -1193,6 +1193,23 @@ SELECT HEX(1 COLLATE ucs2_bin);
SELECT 1 COLLATE latin1_swedish_ci; SELECT 1 COLLATE latin1_swedish_ci;
SET NAMES utf8; SET NAMES utf8;
--echo #
--echo # MDEV-33772 Bad SEPARATOR value in GROUP_CONCAT on character set conversion
--echo #
SET NAMES utf8mb3, @@collation_connection=ucs2_general_ci;
CREATE TABLE t1 (c VARCHAR(10)) CHARACTER SET ucs2;
INSERT INTO t1 VALUES ('a'),('A');
CREATE OR REPLACE VIEW v1 AS
SELECT COUNT(*) AS cnt, GROUP_CONCAT(c) AS c1 FROM t1 GROUP BY c;
SELECT * FROM v1;
SELECT HEX(c1) FROM v1;
SHOW CREATE VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
SET NAMES utf8mb3;
--echo # --echo #
--echo # End of 10.5 tests --echo # End of 10.5 tests
--echo # --echo #

View File

@ -89,11 +89,6 @@ id x
300 300 300 300
connection con2; connection con2;
update t2 set a=2 where b = 0; update t2 set a=2 where b = 0;
select * from t2;
b a
0 2
1 20
2 30
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;

View File

@ -4327,6 +4327,38 @@ dim1 dim2 dim3 p SUM(p)
DROP VIEW v; DROP VIEW v;
# End of 10.4 tests # End of 10.4 tests
# #
# MDEV-31277: 2-nd execution of PS to select from materialized view
# specified as left join whose inner table is mergeable
# derived containing a constant column
#
create table t1 (
Election int(10) unsigned NOT NULL
) engine=MyISAM;
insert into t1 (Election) values (1), (4);
create table t2 (
VoteID int(10),
ElectionID int(10),
UserID int(10)
);
insert into t2 (ElectionID, UserID) values (2, 30), (3, 30);
create view v1 as select * from t1
left join ( select 'Y' AS Voted, ElectionID from t2 ) AS T
on T.ElectionID = t1.Election
limit 9;
prepare stmt1 from "select * from v1";
execute stmt1;
Election Voted ElectionID
1 NULL NULL
4 NULL NULL
execute stmt1;
Election Voted ElectionID
1 NULL NULL
4 NULL NULL
deallocate prepare stmt1;
drop view v1;
drop table t1, t2;
# End of 10.5 tests
#
# MDEV-31143: view with ORDER BY used in query with rownum() in WHERE # MDEV-31143: view with ORDER BY used in query with rownum() in WHERE
# #
create table t1 (id int primary key); create table t1 (id int primary key);

View File

@ -2833,6 +2833,42 @@ DROP VIEW v;
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo #
--echo # MDEV-31277: 2-nd execution of PS to select from materialized view
--echo # specified as left join whose inner table is mergeable
--echo # derived containing a constant column
--echo #
create table t1 (
Election int(10) unsigned NOT NULL
) engine=MyISAM;
insert into t1 (Election) values (1), (4);
create table t2 (
VoteID int(10),
ElectionID int(10),
UserID int(10)
);
insert into t2 (ElectionID, UserID) values (2, 30), (3, 30);
create view v1 as select * from t1
left join ( select 'Y' AS Voted, ElectionID from t2 ) AS T
on T.ElectionID = t1.Election
limit 9;
prepare stmt1 from "select * from v1";
execute stmt1;
execute stmt1;
deallocate prepare stmt1;
drop view v1;
drop table t1, t2;
--echo # End of 10.5 tests
--echo # --echo #
--echo # MDEV-31143: view with ORDER BY used in query with rownum() in WHERE --echo # MDEV-31143: view with ORDER BY used in query with rownum() in WHERE
--echo # --echo #

View File

@ -64,7 +64,7 @@ SET sql_mode=@mode;
# Test litteral concat # Test litteral concat
# #
SELECT 'a' 'b'; SELECT 'a' 'b';
a ab
ab ab
SELECT 'a' ''; SELECT 'a' '';
a a
@ -76,13 +76,13 @@ SELECT '' '';
NULL NULL
NULL NULL
SELECT '' 'b' 'c'; SELECT '' 'b' 'c';
b bc
bc bc
SELECT '' '' 'c'; SELECT '' '' 'c';
c c
c c
SELECT 'a' '' 'c'; SELECT 'a' '' 'c';
a ac
ac ac
SELECT 'a' '' ''; SELECT 'a' '' '';
a a
@ -208,3 +208,22 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`,`b`) KEY `a` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1; drop table t1;
#
# MDEV-33460 select '123' 'x'; unexpected result
#
SELECT '';
NULL
NULL
SELECT '' 'b' 'c';
bc
bc
SELECT '' '' 'c';
c
c
SELECT 'a' '' 'c';
ac
ac
SELECT 'a' '' '';
a
a
# End of 10.5 test

View File

@ -25,3 +25,15 @@ flush tables;
update t1 set a = 2; update t1 set a = 2;
show create table t1; show create table t1;
drop table t1; drop table t1;
--echo #
--echo # MDEV-33460 select '123' 'x'; unexpected result
--echo #
SELECT '';
SELECT '' 'b' 'c';
SELECT '' '' 'c';
SELECT 'a' '' 'c';
SELECT 'a' '' '';
--echo # End of 10.5 test

View File

@ -590,3 +590,885 @@ Warning 1292 Truncated incorrect time value: '01:02:03/'
Warning 1292 Truncated incorrect time value: '01:02:03/' Warning 1292 Truncated incorrect time value: '01:02:03/'
Warning 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '01:02:03/' Warning 1292 Truncated incorrect INTERVAL DAY TO SECOND value: '01:02:03/'
DROP TABLE t1; DROP TABLE t1;
#
# Start of 10.5 tests
#
#
# MDEV-33496 Out of range error in AVG(YEAR(datetime)) due to a wrong data type
#
CREATE FUNCTION select01() RETURNS TEXT RETURN 'SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?';
CREATE FUNCTION select02() RETURNS TEXT RETURN 'SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)';
CREATE TABLE t1 (a DATETIME(6));
INSERT INTO t1 VALUES ('2001-12-31 10:20:30.999999');
CREATE FUNCTION params(expr TEXT, count INT) RETURNS TEXT
BEGIN
RETURN CONCAT(expr, REPEAT(CONCAT(', ', expr), count-1));
END;
$$
CREATE PROCEDURE show_drop()
BEGIN
SELECT TABLE_NAME, COLUMN_TYPE, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA='test'
AND TABLE_NAME IN ('t1e_nm','t2e_nm','t1f_nm','t2f_nm',
't1e_ps','t1f_ps','t2e_ps','t2f_ps')
ORDER BY LEFT(TABLE_NAME, 2), ORDINAL_POSITION, TABLE_NAME;
FOR rec IN (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test'
AND TABLE_NAME IN ('t1e_nm','t2e_nm','t1f_nm','t2f_nm',
't1e_ps','t1f_ps','t2e_ps','t2f_ps'))
DO
EXECUTE IMMEDIATE CONCAT('DROP TABLE ', rec.TABLE_NAME);
END FOR;
END;
$$
CREATE PROCEDURE p1(unit VARCHAR(32))
BEGIN
DECLARE do_extract BOOL DEFAULT unit NOT IN('DAYOFYEAR');
DECLARE query01 TEXT DEFAULT
CONCAT('CREATE TABLE t2 AS ', select01(), ' FROM t1');
DECLARE query02 TEXT DEFAULT
CONCAT('CREATE TABLE t2 AS ', select02(), ' FROM t1');
IF (do_extract)
THEN
EXECUTE IMMEDIATE REPLACE(REPLACE(query01,'t2','t1e_nm'),'?', CONCAT('EXTRACT(',unit,' FROM a)'));
EXECUTE IMMEDIATE REPLACE(REPLACE(query02,'t2','t2e_nm'),'?', CONCAT('EXTRACT(',unit,' FROM a)'));
END IF;
EXECUTE IMMEDIATE REPLACE(REPLACE(query01,'t2','t1f_nm'),'?', CONCAT(unit,'(a)'));
EXECUTE IMMEDIATE REPLACE(REPLACE(query02,'t2','t2f_nm'),'?', CONCAT(unit,'(a)'));
END;
$$
# EXTRACT(YEAR FROM expr) and YEAR(expr) are equivalent
CALL p1('YEAR');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(YEAR FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), YEAR(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(5) EXTRACT(YEAR FROM a)
t1e_ps int(5) ?
t1f_nm int(5) YEAR(a)
t1f_ps int(5) ?
t1e_nm int(4) unsigned CAST(EXTRACT(YEAR FROM a) AS UNSIGNED)
t1e_ps int(4) unsigned CAST(? AS UNSIGNED)
t1f_nm int(4) unsigned CAST(YEAR(a) AS UNSIGNED)
t1f_ps int(4) unsigned CAST(? AS UNSIGNED)
t1e_nm int(5) CAST(EXTRACT(YEAR FROM a) AS SIGNED)
t1e_ps int(5) CAST(? AS SIGNED)
t1f_nm int(5) CAST(YEAR(a) AS SIGNED)
t1f_ps int(5) CAST(? AS SIGNED)
t1e_nm int(5) ABS(EXTRACT(YEAR FROM a))
t1e_ps int(5) ABS(?)
t1f_nm int(5) ABS(YEAR(a))
t1f_ps int(5) ABS(?)
t1e_nm int(5) ROUND(EXTRACT(YEAR FROM a))
t1e_ps int(5) ROUND(?)
t1f_nm int(5) ROUND(YEAR(a))
t1f_ps int(5) ROUND(?)
t1e_nm int(5) -EXTRACT(YEAR FROM a)
t1e_ps int(5) -?
t1f_nm int(5) -YEAR(a)
t1f_ps int(5) -?
t1e_nm int(6) ROUND(EXTRACT(YEAR FROM a),-1)
t1e_ps int(6) ROUND(?,-1)
t1f_nm int(6) ROUND(YEAR(a),-1)
t1f_ps int(6) ROUND(?,-1)
t1e_nm int(6) EXTRACT(YEAR FROM a)+0
t1e_ps int(6) ?+0
t1f_nm int(6) YEAR(a)+0
t1f_ps int(6) ?+0
t1e_nm decimal(6,1) EXTRACT(YEAR FROM a)+0.0
t1e_ps decimal(6,1) ?+0.0
t1f_nm decimal(6,1) YEAR(a)+0.0
t1f_ps decimal(6,1) ?+0.0
t1e_nm varchar(4) CONCAT(EXTRACT(YEAR FROM a))
t1e_ps varchar(4) CONCAT(?)
t1f_nm varchar(4) CONCAT(YEAR(a))
t1f_ps varchar(4) CONCAT(?)
t1e_nm int(5) LEAST(EXTRACT(YEAR FROM a),EXTRACT(YEAR FROM a))
t1e_ps int(5) LEAST(?,?)
t1f_nm int(5) LEAST(YEAR(a),YEAR(a))
t1f_ps int(5) LEAST(?,?)
t1e_nm int(5) COALESCE(EXTRACT(YEAR FROM a))
t1e_ps int(5) COALESCE(?)
t1f_nm int(5) COALESCE(YEAR(a))
t1f_ps int(5) COALESCE(?)
t1e_nm int(5) COALESCE(EXTRACT(YEAR FROM a),CAST(1 AS SIGNED))
t1e_ps int(5) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(5) COALESCE(YEAR(a),CAST(1 AS SIGNED))
t1f_ps int(5) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(4,0) COALESCE(EXTRACT(YEAR FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(4,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(4,0) COALESCE(YEAR(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(4,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(5) @a:=EXTRACT(YEAR FROM a)
t1e_ps int(5) @a:=?
t1f_nm int(5) @a:=YEAR(a)
t1f_ps int(5) @a:=?
t2e_nm decimal(8,4) AVG(EXTRACT(YEAR FROM a))
t2e_ps decimal(8,4) AVG(?)
t2f_nm decimal(8,4) AVG(YEAR(a))
t2f_ps decimal(8,4) AVG(?)
t2e_nm bigint(5) MIN(EXTRACT(YEAR FROM a))
t2e_ps bigint(5) MIN(?)
t2f_nm bigint(5) MIN(YEAR(a))
t2f_ps bigint(5) MIN(?)
t2e_nm bigint(5) MAX(EXTRACT(YEAR FROM a))
t2e_ps bigint(5) MAX(?)
t2f_nm bigint(5) MAX(YEAR(a))
t2f_ps bigint(5) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(YEAR FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(YEAR(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(QUARTER FROM expr) and QUARTER(expr) are equavalent
CALL p1('QUARTER');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(QUARTER FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999'), QUARTER(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(2) EXTRACT(QUARTER FROM a)
t1e_ps int(2) ?
t1f_nm int(2) QUARTER(a)
t1f_ps int(2) ?
t1e_nm int(1) unsigned CAST(EXTRACT(QUARTER FROM a) AS UNSIGNED)
t1e_ps int(1) unsigned CAST(? AS UNSIGNED)
t1f_nm int(1) unsigned CAST(QUARTER(a) AS UNSIGNED)
t1f_ps int(1) unsigned CAST(? AS UNSIGNED)
t1e_nm int(2) CAST(EXTRACT(QUARTER FROM a) AS SIGNED)
t1e_ps int(2) CAST(? AS SIGNED)
t1f_nm int(2) CAST(QUARTER(a) AS SIGNED)
t1f_ps int(2) CAST(? AS SIGNED)
t1e_nm int(2) ABS(EXTRACT(QUARTER FROM a))
t1e_ps int(2) ABS(?)
t1f_nm int(2) ABS(QUARTER(a))
t1f_ps int(2) ABS(?)
t1e_nm int(2) ROUND(EXTRACT(QUARTER FROM a))
t1e_ps int(2) ROUND(?)
t1f_nm int(2) ROUND(QUARTER(a))
t1f_ps int(2) ROUND(?)
t1e_nm int(2) -EXTRACT(QUARTER FROM a)
t1e_ps int(2) -?
t1f_nm int(2) -QUARTER(a)
t1f_ps int(2) -?
t1e_nm int(3) ROUND(EXTRACT(QUARTER FROM a),-1)
t1e_ps int(3) ROUND(?,-1)
t1f_nm int(3) ROUND(QUARTER(a),-1)
t1f_ps int(3) ROUND(?,-1)
t1e_nm int(3) EXTRACT(QUARTER FROM a)+0
t1e_ps int(3) ?+0
t1f_nm int(3) QUARTER(a)+0
t1f_ps int(3) ?+0
t1e_nm decimal(3,1) EXTRACT(QUARTER FROM a)+0.0
t1e_ps decimal(3,1) ?+0.0
t1f_nm decimal(3,1) QUARTER(a)+0.0
t1f_ps decimal(3,1) ?+0.0
t1e_nm varchar(1) CONCAT(EXTRACT(QUARTER FROM a))
t1e_ps varchar(1) CONCAT(?)
t1f_nm varchar(1) CONCAT(QUARTER(a))
t1f_ps varchar(1) CONCAT(?)
t1e_nm int(2) LEAST(EXTRACT(QUARTER FROM a),EXTRACT(QUARTER FROM a))
t1e_ps int(2) LEAST(?,?)
t1f_nm int(2) LEAST(QUARTER(a),QUARTER(a))
t1f_ps int(2) LEAST(?,?)
t1e_nm int(2) COALESCE(EXTRACT(QUARTER FROM a))
t1e_ps int(2) COALESCE(?)
t1f_nm int(2) COALESCE(QUARTER(a))
t1f_ps int(2) COALESCE(?)
t1e_nm int(2) COALESCE(EXTRACT(QUARTER FROM a),CAST(1 AS SIGNED))
t1e_ps int(2) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(2) COALESCE(QUARTER(a),CAST(1 AS SIGNED))
t1f_ps int(2) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(1,0) COALESCE(EXTRACT(QUARTER FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(1,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(1,0) COALESCE(QUARTER(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(1,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(2) @a:=EXTRACT(QUARTER FROM a)
t1e_ps int(2) @a:=?
t1f_nm int(2) @a:=QUARTER(a)
t1f_ps int(2) @a:=?
t2e_nm decimal(5,4) AVG(EXTRACT(QUARTER FROM a))
t2e_ps decimal(5,4) AVG(?)
t2f_nm decimal(5,4) AVG(QUARTER(a))
t2f_ps decimal(5,4) AVG(?)
t2e_nm bigint(2) MIN(EXTRACT(QUARTER FROM a))
t2e_ps bigint(2) MIN(?)
t2f_nm bigint(2) MIN(QUARTER(a))
t2f_ps bigint(2) MIN(?)
t2e_nm bigint(2) MAX(EXTRACT(QUARTER FROM a))
t2e_ps bigint(2) MAX(?)
t2f_nm bigint(2) MAX(QUARTER(a))
t2f_ps bigint(2) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(QUARTER FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(QUARTER(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(MONTH FROM expr) and MONTH(expr) are equavalent
CALL p1('MONTH');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MONTH FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999'), MONTH(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(3) EXTRACT(MONTH FROM a)
t1e_ps int(3) ?
t1f_nm int(3) MONTH(a)
t1f_ps int(3) ?
t1e_nm int(2) unsigned CAST(EXTRACT(MONTH FROM a) AS UNSIGNED)
t1e_ps int(2) unsigned CAST(? AS UNSIGNED)
t1f_nm int(2) unsigned CAST(MONTH(a) AS UNSIGNED)
t1f_ps int(2) unsigned CAST(? AS UNSIGNED)
t1e_nm int(3) CAST(EXTRACT(MONTH FROM a) AS SIGNED)
t1e_ps int(3) CAST(? AS SIGNED)
t1f_nm int(3) CAST(MONTH(a) AS SIGNED)
t1f_ps int(3) CAST(? AS SIGNED)
t1e_nm int(3) ABS(EXTRACT(MONTH FROM a))
t1e_ps int(3) ABS(?)
t1f_nm int(3) ABS(MONTH(a))
t1f_ps int(3) ABS(?)
t1e_nm int(3) ROUND(EXTRACT(MONTH FROM a))
t1e_ps int(3) ROUND(?)
t1f_nm int(3) ROUND(MONTH(a))
t1f_ps int(3) ROUND(?)
t1e_nm int(3) -EXTRACT(MONTH FROM a)
t1e_ps int(3) -?
t1f_nm int(3) -MONTH(a)
t1f_ps int(3) -?
t1e_nm int(4) ROUND(EXTRACT(MONTH FROM a),-1)
t1e_ps int(4) ROUND(?,-1)
t1f_nm int(4) ROUND(MONTH(a),-1)
t1f_ps int(4) ROUND(?,-1)
t1e_nm int(4) EXTRACT(MONTH FROM a)+0
t1e_ps int(4) ?+0
t1f_nm int(4) MONTH(a)+0
t1f_ps int(4) ?+0
t1e_nm decimal(4,1) EXTRACT(MONTH FROM a)+0.0
t1e_ps decimal(4,1) ?+0.0
t1f_nm decimal(4,1) MONTH(a)+0.0
t1f_ps decimal(4,1) ?+0.0
t1e_nm varchar(2) CONCAT(EXTRACT(MONTH FROM a))
t1e_ps varchar(2) CONCAT(?)
t1f_nm varchar(2) CONCAT(MONTH(a))
t1f_ps varchar(2) CONCAT(?)
t1e_nm int(3) LEAST(EXTRACT(MONTH FROM a),EXTRACT(MONTH FROM a))
t1e_ps int(3) LEAST(?,?)
t1f_nm int(3) LEAST(MONTH(a),MONTH(a))
t1f_ps int(3) LEAST(?,?)
t1e_nm int(3) COALESCE(EXTRACT(MONTH FROM a))
t1e_ps int(3) COALESCE(?)
t1f_nm int(3) COALESCE(MONTH(a))
t1f_ps int(3) COALESCE(?)
t1e_nm int(3) COALESCE(EXTRACT(MONTH FROM a),CAST(1 AS SIGNED))
t1e_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(3) COALESCE(MONTH(a),CAST(1 AS SIGNED))
t1f_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(2,0) COALESCE(EXTRACT(MONTH FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(2,0) COALESCE(MONTH(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(3) @a:=EXTRACT(MONTH FROM a)
t1e_ps int(3) @a:=?
t1f_nm int(3) @a:=MONTH(a)
t1f_ps int(3) @a:=?
t2e_nm decimal(6,4) AVG(EXTRACT(MONTH FROM a))
t2e_ps decimal(6,4) AVG(?)
t2f_nm decimal(6,4) AVG(MONTH(a))
t2f_ps decimal(6,4) AVG(?)
t2e_nm bigint(3) MIN(EXTRACT(MONTH FROM a))
t2e_ps bigint(3) MIN(?)
t2f_nm bigint(3) MIN(MONTH(a))
t2f_ps bigint(3) MIN(?)
t2e_nm bigint(3) MAX(EXTRACT(MONTH FROM a))
t2e_ps bigint(3) MAX(?)
t2f_nm bigint(3) MAX(MONTH(a))
t2f_ps bigint(3) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(MONTH FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(MONTH(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(WEEK FROM expr) and WEEK(expr) are equavalent
CALL p1('WEEK');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(WEEK FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999'), WEEK(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(3) EXTRACT(WEEK FROM a)
t1e_ps int(3) ?
t1f_nm int(3) WEEK(a)
t1f_ps int(3) ?
t1e_nm int(2) unsigned CAST(EXTRACT(WEEK FROM a) AS UNSIGNED)
t1e_ps int(2) unsigned CAST(? AS UNSIGNED)
t1f_nm int(2) unsigned CAST(WEEK(a) AS UNSIGNED)
t1f_ps int(2) unsigned CAST(? AS UNSIGNED)
t1e_nm int(3) CAST(EXTRACT(WEEK FROM a) AS SIGNED)
t1e_ps int(3) CAST(? AS SIGNED)
t1f_nm int(3) CAST(WEEK(a) AS SIGNED)
t1f_ps int(3) CAST(? AS SIGNED)
t1e_nm int(3) ABS(EXTRACT(WEEK FROM a))
t1e_ps int(3) ABS(?)
t1f_nm int(3) ABS(WEEK(a))
t1f_ps int(3) ABS(?)
t1e_nm int(3) ROUND(EXTRACT(WEEK FROM a))
t1e_ps int(3) ROUND(?)
t1f_nm int(3) ROUND(WEEK(a))
t1f_ps int(3) ROUND(?)
t1e_nm int(3) -EXTRACT(WEEK FROM a)
t1e_ps int(3) -?
t1f_nm int(3) -WEEK(a)
t1f_ps int(3) -?
t1e_nm int(4) ROUND(EXTRACT(WEEK FROM a),-1)
t1e_ps int(4) ROUND(?,-1)
t1f_nm int(4) ROUND(WEEK(a),-1)
t1f_ps int(4) ROUND(?,-1)
t1e_nm int(4) EXTRACT(WEEK FROM a)+0
t1e_ps int(4) ?+0
t1f_nm int(4) WEEK(a)+0
t1f_ps int(4) ?+0
t1e_nm decimal(4,1) EXTRACT(WEEK FROM a)+0.0
t1e_ps decimal(4,1) ?+0.0
t1f_nm decimal(4,1) WEEK(a)+0.0
t1f_ps decimal(4,1) ?+0.0
t1e_nm varchar(2) CONCAT(EXTRACT(WEEK FROM a))
t1e_ps varchar(2) CONCAT(?)
t1f_nm varchar(2) CONCAT(WEEK(a))
t1f_ps varchar(2) CONCAT(?)
t1e_nm int(3) LEAST(EXTRACT(WEEK FROM a),EXTRACT(WEEK FROM a))
t1e_ps int(3) LEAST(?,?)
t1f_nm int(3) LEAST(WEEK(a),WEEK(a))
t1f_ps int(3) LEAST(?,?)
t1e_nm int(3) COALESCE(EXTRACT(WEEK FROM a))
t1e_ps int(3) COALESCE(?)
t1f_nm int(3) COALESCE(WEEK(a))
t1f_ps int(3) COALESCE(?)
t1e_nm int(3) COALESCE(EXTRACT(WEEK FROM a),CAST(1 AS SIGNED))
t1e_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(3) COALESCE(WEEK(a),CAST(1 AS SIGNED))
t1f_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(2,0) COALESCE(EXTRACT(WEEK FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(2,0) COALESCE(WEEK(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(3) @a:=EXTRACT(WEEK FROM a)
t1e_ps int(3) @a:=?
t1f_nm int(3) @a:=WEEK(a)
t1f_ps int(3) @a:=?
t2e_nm decimal(6,4) AVG(EXTRACT(WEEK FROM a))
t2e_ps decimal(6,4) AVG(?)
t2f_nm decimal(6,4) AVG(WEEK(a))
t2f_ps decimal(6,4) AVG(?)
t2e_nm bigint(3) MIN(EXTRACT(WEEK FROM a))
t2e_ps bigint(3) MIN(?)
t2f_nm bigint(3) MIN(WEEK(a))
t2f_ps bigint(3) MIN(?)
t2e_nm bigint(3) MAX(EXTRACT(WEEK FROM a))
t2e_ps bigint(3) MAX(?)
t2f_nm bigint(3) MAX(WEEK(a))
t2f_ps bigint(3) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(WEEK FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(WEEK(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(DAY FROM expr) returns hours/24 and includes the sign for TIME
# DAY(expr) returns the DD part of CAST(expr AS DATETIME)
CALL p1('DAY');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(DAY FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999'), DAY(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(3) EXTRACT(DAY FROM a)
t1e_ps int(3) ?
t1f_nm int(3) DAY(a)
t1f_ps int(3) ?
t1e_nm bigint(20) unsigned CAST(EXTRACT(DAY FROM a) AS UNSIGNED)
t1e_ps bigint(20) unsigned CAST(? AS UNSIGNED)
t1f_nm int(2) unsigned CAST(DAY(a) AS UNSIGNED)
t1f_ps int(2) unsigned CAST(? AS UNSIGNED)
t1e_nm int(3) CAST(EXTRACT(DAY FROM a) AS SIGNED)
t1e_ps int(3) CAST(? AS SIGNED)
t1f_nm int(3) CAST(DAY(a) AS SIGNED)
t1f_ps int(3) CAST(? AS SIGNED)
t1e_nm int(3) ABS(EXTRACT(DAY FROM a))
t1e_ps int(3) ABS(?)
t1f_nm int(3) ABS(DAY(a))
t1f_ps int(3) ABS(?)
t1e_nm int(3) ROUND(EXTRACT(DAY FROM a))
t1e_ps int(3) ROUND(?)
t1f_nm int(3) ROUND(DAY(a))
t1f_ps int(3) ROUND(?)
t1e_nm int(4) -EXTRACT(DAY FROM a)
t1e_ps int(4) -?
t1f_nm int(3) -DAY(a)
t1f_ps int(3) -?
t1e_nm int(4) ROUND(EXTRACT(DAY FROM a),-1)
t1e_ps int(4) ROUND(?,-1)
t1f_nm int(4) ROUND(DAY(a),-1)
t1f_ps int(4) ROUND(?,-1)
t1e_nm int(4) EXTRACT(DAY FROM a)+0
t1e_ps int(4) ?+0
t1f_nm int(4) DAY(a)+0
t1f_ps int(4) ?+0
t1e_nm decimal(4,1) EXTRACT(DAY FROM a)+0.0
t1e_ps decimal(4,1) ?+0.0
t1f_nm decimal(4,1) DAY(a)+0.0
t1f_ps decimal(4,1) ?+0.0
t1e_nm varchar(3) CONCAT(EXTRACT(DAY FROM a))
t1e_ps varchar(3) CONCAT(?)
t1f_nm varchar(2) CONCAT(DAY(a))
t1f_ps varchar(2) CONCAT(?)
t1e_nm int(3) LEAST(EXTRACT(DAY FROM a),EXTRACT(DAY FROM a))
t1e_ps int(3) LEAST(?,?)
t1f_nm int(3) LEAST(DAY(a),DAY(a))
t1f_ps int(3) LEAST(?,?)
t1e_nm int(3) COALESCE(EXTRACT(DAY FROM a))
t1e_ps int(3) COALESCE(?)
t1f_nm int(3) COALESCE(DAY(a))
t1f_ps int(3) COALESCE(?)
t1e_nm int(3) COALESCE(EXTRACT(DAY FROM a),CAST(1 AS SIGNED))
t1e_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(3) COALESCE(DAY(a),CAST(1 AS SIGNED))
t1f_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(2,0) COALESCE(EXTRACT(DAY FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(2,0) COALESCE(DAY(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(3) @a:=EXTRACT(DAY FROM a)
t1e_ps int(3) @a:=?
t1f_nm int(3) @a:=DAY(a)
t1f_ps int(3) @a:=?
t2e_nm decimal(6,4) AVG(EXTRACT(DAY FROM a))
t2e_ps decimal(6,4) AVG(?)
t2f_nm decimal(6,4) AVG(DAY(a))
t2f_ps decimal(6,4) AVG(?)
t2e_nm bigint(3) MIN(EXTRACT(DAY FROM a))
t2e_ps bigint(3) MIN(?)
t2f_nm bigint(3) MIN(DAY(a))
t2f_ps bigint(3) MIN(?)
t2e_nm bigint(3) MAX(EXTRACT(DAY FROM a))
t2e_ps bigint(3) MAX(?)
t2f_nm bigint(3) MAX(DAY(a))
t2f_ps bigint(3) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(DAY FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(DAY(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(HOUR FROM expr) returns hours%24 and includes the sign for TIME
# HOUR(expr) returns the hh part of CAST(expr AS DATETIME)
CALL p1('HOUR');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(HOUR FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999'), HOUR(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(3) EXTRACT(HOUR FROM a)
t1e_ps int(3) ?
t1f_nm int(3) HOUR(a)
t1f_ps int(3) ?
t1e_nm bigint(20) unsigned CAST(EXTRACT(HOUR FROM a) AS UNSIGNED)
t1e_ps bigint(20) unsigned CAST(? AS UNSIGNED)
t1f_nm int(2) unsigned CAST(HOUR(a) AS UNSIGNED)
t1f_ps int(2) unsigned CAST(? AS UNSIGNED)
t1e_nm int(3) CAST(EXTRACT(HOUR FROM a) AS SIGNED)
t1e_ps int(3) CAST(? AS SIGNED)
t1f_nm int(3) CAST(HOUR(a) AS SIGNED)
t1f_ps int(3) CAST(? AS SIGNED)
t1e_nm int(3) ABS(EXTRACT(HOUR FROM a))
t1e_ps int(3) ABS(?)
t1f_nm int(3) ABS(HOUR(a))
t1f_ps int(3) ABS(?)
t1e_nm int(3) ROUND(EXTRACT(HOUR FROM a))
t1e_ps int(3) ROUND(?)
t1f_nm int(3) ROUND(HOUR(a))
t1f_ps int(3) ROUND(?)
t1e_nm int(4) -EXTRACT(HOUR FROM a)
t1e_ps int(4) -?
t1f_nm int(3) -HOUR(a)
t1f_ps int(3) -?
t1e_nm int(4) ROUND(EXTRACT(HOUR FROM a),-1)
t1e_ps int(4) ROUND(?,-1)
t1f_nm int(4) ROUND(HOUR(a),-1)
t1f_ps int(4) ROUND(?,-1)
t1e_nm int(4) EXTRACT(HOUR FROM a)+0
t1e_ps int(4) ?+0
t1f_nm int(4) HOUR(a)+0
t1f_ps int(4) ?+0
t1e_nm decimal(4,1) EXTRACT(HOUR FROM a)+0.0
t1e_ps decimal(4,1) ?+0.0
t1f_nm decimal(4,1) HOUR(a)+0.0
t1f_ps decimal(4,1) ?+0.0
t1e_nm varchar(3) CONCAT(EXTRACT(HOUR FROM a))
t1e_ps varchar(3) CONCAT(?)
t1f_nm varchar(2) CONCAT(HOUR(a))
t1f_ps varchar(2) CONCAT(?)
t1e_nm int(3) LEAST(EXTRACT(HOUR FROM a),EXTRACT(HOUR FROM a))
t1e_ps int(3) LEAST(?,?)
t1f_nm int(3) LEAST(HOUR(a),HOUR(a))
t1f_ps int(3) LEAST(?,?)
t1e_nm int(3) COALESCE(EXTRACT(HOUR FROM a))
t1e_ps int(3) COALESCE(?)
t1f_nm int(3) COALESCE(HOUR(a))
t1f_ps int(3) COALESCE(?)
t1e_nm int(3) COALESCE(EXTRACT(HOUR FROM a),CAST(1 AS SIGNED))
t1e_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(3) COALESCE(HOUR(a),CAST(1 AS SIGNED))
t1f_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(2,0) COALESCE(EXTRACT(HOUR FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(2,0) COALESCE(HOUR(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(3) @a:=EXTRACT(HOUR FROM a)
t1e_ps int(3) @a:=?
t1f_nm int(3) @a:=HOUR(a)
t1f_ps int(3) @a:=?
t2e_nm decimal(6,4) AVG(EXTRACT(HOUR FROM a))
t2e_ps decimal(6,4) AVG(?)
t2f_nm decimal(6,4) AVG(HOUR(a))
t2f_ps decimal(6,4) AVG(?)
t2e_nm bigint(3) MIN(EXTRACT(HOUR FROM a))
t2e_ps bigint(3) MIN(?)
t2f_nm bigint(3) MIN(HOUR(a))
t2f_ps bigint(3) MIN(?)
t2e_nm bigint(3) MAX(EXTRACT(HOUR FROM a))
t2e_ps bigint(3) MAX(?)
t2f_nm bigint(3) MAX(HOUR(a))
t2f_ps bigint(3) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(HOUR FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(HOUR(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(MINUTE FROM expr) includes the sign for TIME
# MINUTE(expr) returns the absolute value
CALL p1('MINUTE');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MINUTE FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999'), MINUTE(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(3) EXTRACT(MINUTE FROM a)
t1e_ps int(3) ?
t1f_nm int(3) MINUTE(a)
t1f_ps int(3) ?
t1e_nm bigint(20) unsigned CAST(EXTRACT(MINUTE FROM a) AS UNSIGNED)
t1e_ps bigint(20) unsigned CAST(? AS UNSIGNED)
t1f_nm int(2) unsigned CAST(MINUTE(a) AS UNSIGNED)
t1f_ps int(2) unsigned CAST(? AS UNSIGNED)
t1e_nm int(3) CAST(EXTRACT(MINUTE FROM a) AS SIGNED)
t1e_ps int(3) CAST(? AS SIGNED)
t1f_nm int(3) CAST(MINUTE(a) AS SIGNED)
t1f_ps int(3) CAST(? AS SIGNED)
t1e_nm int(3) ABS(EXTRACT(MINUTE FROM a))
t1e_ps int(3) ABS(?)
t1f_nm int(3) ABS(MINUTE(a))
t1f_ps int(3) ABS(?)
t1e_nm int(3) ROUND(EXTRACT(MINUTE FROM a))
t1e_ps int(3) ROUND(?)
t1f_nm int(3) ROUND(MINUTE(a))
t1f_ps int(3) ROUND(?)
t1e_nm int(4) -EXTRACT(MINUTE FROM a)
t1e_ps int(4) -?
t1f_nm int(3) -MINUTE(a)
t1f_ps int(3) -?
t1e_nm int(4) ROUND(EXTRACT(MINUTE FROM a),-1)
t1e_ps int(4) ROUND(?,-1)
t1f_nm int(4) ROUND(MINUTE(a),-1)
t1f_ps int(4) ROUND(?,-1)
t1e_nm int(4) EXTRACT(MINUTE FROM a)+0
t1e_ps int(4) ?+0
t1f_nm int(4) MINUTE(a)+0
t1f_ps int(4) ?+0
t1e_nm decimal(4,1) EXTRACT(MINUTE FROM a)+0.0
t1e_ps decimal(4,1) ?+0.0
t1f_nm decimal(4,1) MINUTE(a)+0.0
t1f_ps decimal(4,1) ?+0.0
t1e_nm varchar(3) CONCAT(EXTRACT(MINUTE FROM a))
t1e_ps varchar(3) CONCAT(?)
t1f_nm varchar(2) CONCAT(MINUTE(a))
t1f_ps varchar(2) CONCAT(?)
t1e_nm int(3) LEAST(EXTRACT(MINUTE FROM a),EXTRACT(MINUTE FROM a))
t1e_ps int(3) LEAST(?,?)
t1f_nm int(3) LEAST(MINUTE(a),MINUTE(a))
t1f_ps int(3) LEAST(?,?)
t1e_nm int(3) COALESCE(EXTRACT(MINUTE FROM a))
t1e_ps int(3) COALESCE(?)
t1f_nm int(3) COALESCE(MINUTE(a))
t1f_ps int(3) COALESCE(?)
t1e_nm int(3) COALESCE(EXTRACT(MINUTE FROM a),CAST(1 AS SIGNED))
t1e_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(3) COALESCE(MINUTE(a),CAST(1 AS SIGNED))
t1f_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(2,0) COALESCE(EXTRACT(MINUTE FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(2,0) COALESCE(MINUTE(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(3) @a:=EXTRACT(MINUTE FROM a)
t1e_ps int(3) @a:=?
t1f_nm int(3) @a:=MINUTE(a)
t1f_ps int(3) @a:=?
t2e_nm decimal(6,4) AVG(EXTRACT(MINUTE FROM a))
t2e_ps decimal(6,4) AVG(?)
t2f_nm decimal(6,4) AVG(MINUTE(a))
t2f_ps decimal(6,4) AVG(?)
t2e_nm bigint(3) MIN(EXTRACT(MINUTE FROM a))
t2e_ps bigint(3) MIN(?)
t2f_nm bigint(3) MIN(MINUTE(a))
t2f_ps bigint(3) MIN(?)
t2e_nm bigint(3) MAX(EXTRACT(MINUTE FROM a))
t2e_ps bigint(3) MAX(?)
t2f_nm bigint(3) MAX(MINUTE(a))
t2f_ps bigint(3) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(MINUTE FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(MINUTE(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(SECONDS FROM expr) includes the sign for TIME
# SECONDS(expr) returns the absolute value
CALL p1('SECOND');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(SECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), SECOND(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(3) EXTRACT(SECOND FROM a)
t1e_ps int(3) ?
t1f_nm int(3) SECOND(a)
t1f_ps int(3) ?
t1e_nm bigint(20) unsigned CAST(EXTRACT(SECOND FROM a) AS UNSIGNED)
t1e_ps bigint(20) unsigned CAST(? AS UNSIGNED)
t1f_nm int(2) unsigned CAST(SECOND(a) AS UNSIGNED)
t1f_ps int(2) unsigned CAST(? AS UNSIGNED)
t1e_nm int(3) CAST(EXTRACT(SECOND FROM a) AS SIGNED)
t1e_ps int(3) CAST(? AS SIGNED)
t1f_nm int(3) CAST(SECOND(a) AS SIGNED)
t1f_ps int(3) CAST(? AS SIGNED)
t1e_nm int(3) ABS(EXTRACT(SECOND FROM a))
t1e_ps int(3) ABS(?)
t1f_nm int(3) ABS(SECOND(a))
t1f_ps int(3) ABS(?)
t1e_nm int(3) ROUND(EXTRACT(SECOND FROM a))
t1e_ps int(3) ROUND(?)
t1f_nm int(3) ROUND(SECOND(a))
t1f_ps int(3) ROUND(?)
t1e_nm int(4) -EXTRACT(SECOND FROM a)
t1e_ps int(4) -?
t1f_nm int(3) -SECOND(a)
t1f_ps int(3) -?
t1e_nm int(4) ROUND(EXTRACT(SECOND FROM a),-1)
t1e_ps int(4) ROUND(?,-1)
t1f_nm int(4) ROUND(SECOND(a),-1)
t1f_ps int(4) ROUND(?,-1)
t1e_nm int(4) EXTRACT(SECOND FROM a)+0
t1e_ps int(4) ?+0
t1f_nm int(4) SECOND(a)+0
t1f_ps int(4) ?+0
t1e_nm decimal(4,1) EXTRACT(SECOND FROM a)+0.0
t1e_ps decimal(4,1) ?+0.0
t1f_nm decimal(4,1) SECOND(a)+0.0
t1f_ps decimal(4,1) ?+0.0
t1e_nm varchar(3) CONCAT(EXTRACT(SECOND FROM a))
t1e_ps varchar(3) CONCAT(?)
t1f_nm varchar(2) CONCAT(SECOND(a))
t1f_ps varchar(2) CONCAT(?)
t1e_nm int(3) LEAST(EXTRACT(SECOND FROM a),EXTRACT(SECOND FROM a))
t1e_ps int(3) LEAST(?,?)
t1f_nm int(3) LEAST(SECOND(a),SECOND(a))
t1f_ps int(3) LEAST(?,?)
t1e_nm int(3) COALESCE(EXTRACT(SECOND FROM a))
t1e_ps int(3) COALESCE(?)
t1f_nm int(3) COALESCE(SECOND(a))
t1f_ps int(3) COALESCE(?)
t1e_nm int(3) COALESCE(EXTRACT(SECOND FROM a),CAST(1 AS SIGNED))
t1e_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(3) COALESCE(SECOND(a),CAST(1 AS SIGNED))
t1f_ps int(3) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(2,0) COALESCE(EXTRACT(SECOND FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(2,0) COALESCE(SECOND(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(2,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(3) @a:=EXTRACT(SECOND FROM a)
t1e_ps int(3) @a:=?
t1f_nm int(3) @a:=SECOND(a)
t1f_ps int(3) @a:=?
t2e_nm decimal(6,4) AVG(EXTRACT(SECOND FROM a))
t2e_ps decimal(6,4) AVG(?)
t2f_nm decimal(6,4) AVG(SECOND(a))
t2f_ps decimal(6,4) AVG(?)
t2e_nm bigint(3) MIN(EXTRACT(SECOND FROM a))
t2e_ps bigint(3) MIN(?)
t2f_nm bigint(3) MIN(SECOND(a))
t2f_ps bigint(3) MIN(?)
t2e_nm bigint(3) MAX(EXTRACT(SECOND FROM a))
t2e_ps bigint(3) MAX(?)
t2f_nm bigint(3) MAX(SECOND(a))
t2f_ps bigint(3) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(SECOND FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(SECOND(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# EXTRACT(MICROSECONDS FROM expr) includes the sign for TIME
# MICROSECONDS(expr) returns the absolute value
CALL p1('MICROSECOND');
EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999'), EXTRACT(MICROSECOND FROM TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999'), MICROSECOND(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1e_nm int(7) EXTRACT(MICROSECOND FROM a)
t1e_ps int(7) ?
t1f_nm int(7) MICROSECOND(a)
t1f_ps int(7) ?
t1e_nm bigint(20) unsigned CAST(EXTRACT(MICROSECOND FROM a) AS UNSIGNED)
t1e_ps bigint(20) unsigned CAST(? AS UNSIGNED)
t1f_nm int(6) unsigned CAST(MICROSECOND(a) AS UNSIGNED)
t1f_ps int(6) unsigned CAST(? AS UNSIGNED)
t1e_nm int(7) CAST(EXTRACT(MICROSECOND FROM a) AS SIGNED)
t1e_ps int(7) CAST(? AS SIGNED)
t1f_nm int(7) CAST(MICROSECOND(a) AS SIGNED)
t1f_ps int(7) CAST(? AS SIGNED)
t1e_nm int(7) ABS(EXTRACT(MICROSECOND FROM a))
t1e_ps int(7) ABS(?)
t1f_nm int(7) ABS(MICROSECOND(a))
t1f_ps int(7) ABS(?)
t1e_nm int(7) ROUND(EXTRACT(MICROSECOND FROM a))
t1e_ps int(7) ROUND(?)
t1f_nm int(7) ROUND(MICROSECOND(a))
t1f_ps int(7) ROUND(?)
t1e_nm int(8) -EXTRACT(MICROSECOND FROM a)
t1e_ps int(8) -?
t1f_nm int(7) -MICROSECOND(a)
t1f_ps int(7) -?
t1e_nm int(8) ROUND(EXTRACT(MICROSECOND FROM a),-1)
t1e_ps int(8) ROUND(?,-1)
t1f_nm int(8) ROUND(MICROSECOND(a),-1)
t1f_ps int(8) ROUND(?,-1)
t1e_nm int(8) EXTRACT(MICROSECOND FROM a)+0
t1e_ps int(8) ?+0
t1f_nm int(8) MICROSECOND(a)+0
t1f_ps int(8) ?+0
t1e_nm decimal(8,1) EXTRACT(MICROSECOND FROM a)+0.0
t1e_ps decimal(8,1) ?+0.0
t1f_nm decimal(8,1) MICROSECOND(a)+0.0
t1f_ps decimal(8,1) ?+0.0
t1e_nm varchar(7) CONCAT(EXTRACT(MICROSECOND FROM a))
t1e_ps varchar(7) CONCAT(?)
t1f_nm varchar(6) CONCAT(MICROSECOND(a))
t1f_ps varchar(6) CONCAT(?)
t1e_nm int(7) LEAST(EXTRACT(MICROSECOND FROM a),EXTRACT(MICROSECOND FROM a))
t1e_ps int(7) LEAST(?,?)
t1f_nm int(7) LEAST(MICROSECOND(a),MICROSECOND(a))
t1f_ps int(7) LEAST(?,?)
t1e_nm int(7) COALESCE(EXTRACT(MICROSECOND FROM a))
t1e_ps int(7) COALESCE(?)
t1f_nm int(7) COALESCE(MICROSECOND(a))
t1f_ps int(7) COALESCE(?)
t1e_nm int(7) COALESCE(EXTRACT(MICROSECOND FROM a),CAST(1 AS SIGNED))
t1e_ps int(7) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm int(7) COALESCE(MICROSECOND(a),CAST(1 AS SIGNED))
t1f_ps int(7) COALESCE(?,CAST(1 AS SIGNED))
t1e_nm decimal(6,0) COALESCE(EXTRACT(MICROSECOND FROM a),CAST(1 AS UNSIGNED))
t1e_ps decimal(6,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm decimal(6,0) COALESCE(MICROSECOND(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(6,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1e_nm int(7) @a:=EXTRACT(MICROSECOND FROM a)
t1e_ps int(7) @a:=?
t1f_nm int(7) @a:=MICROSECOND(a)
t1f_ps int(7) @a:=?
t2e_nm decimal(10,4) AVG(EXTRACT(MICROSECOND FROM a))
t2e_ps decimal(10,4) AVG(?)
t2f_nm decimal(10,4) AVG(MICROSECOND(a))
t2f_ps decimal(10,4) AVG(?)
t2e_nm bigint(7) MIN(EXTRACT(MICROSECOND FROM a))
t2e_ps bigint(7) MIN(?)
t2f_nm bigint(7) MIN(MICROSECOND(a))
t2f_ps bigint(7) MIN(?)
t2e_nm bigint(7) MAX(EXTRACT(MICROSECOND FROM a))
t2e_ps bigint(7) MAX(?)
t2f_nm bigint(7) MAX(MICROSECOND(a))
t2f_ps bigint(7) MAX(?)
t2e_nm mediumtext GROUP_CONCAT(EXTRACT(MICROSECOND FROM a))
t2e_ps mediumtext GROUP_CONCAT(?)
t2f_nm mediumtext GROUP_CONCAT(MICROSECOND(a))
t2f_ps mediumtext GROUP_CONCAT(?)
# DAYOFYEAR
CALL p1('DAYOFYEAR');
EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?' USING DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999');
EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?)' USING DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999'), DAYOFYEAR(TIMESTAMP'2001-12-13 10:20:30.999999');
CALL show_drop;
TABLE_NAME COLUMN_TYPE COLUMN_NAME
t1f_nm int(4) DAYOFYEAR(a)
t1f_ps int(4) ?
t1f_nm int(3) unsigned CAST(DAYOFYEAR(a) AS UNSIGNED)
t1f_ps int(3) unsigned CAST(? AS UNSIGNED)
t1f_nm int(4) CAST(DAYOFYEAR(a) AS SIGNED)
t1f_ps int(4) CAST(? AS SIGNED)
t1f_nm int(4) ABS(DAYOFYEAR(a))
t1f_ps int(4) ABS(?)
t1f_nm int(4) ROUND(DAYOFYEAR(a))
t1f_ps int(4) ROUND(?)
t1f_nm int(4) -DAYOFYEAR(a)
t1f_ps int(4) -?
t1f_nm int(5) ROUND(DAYOFYEAR(a),-1)
t1f_ps int(5) ROUND(?,-1)
t1f_nm int(5) DAYOFYEAR(a)+0
t1f_ps int(5) ?+0
t1f_nm decimal(5,1) DAYOFYEAR(a)+0.0
t1f_ps decimal(5,1) ?+0.0
t1f_nm varchar(3) CONCAT(DAYOFYEAR(a))
t1f_ps varchar(3) CONCAT(?)
t1f_nm int(4) LEAST(DAYOFYEAR(a),DAYOFYEAR(a))
t1f_ps int(4) LEAST(?,?)
t1f_nm int(4) COALESCE(DAYOFYEAR(a))
t1f_ps int(4) COALESCE(?)
t1f_nm int(4) COALESCE(DAYOFYEAR(a),CAST(1 AS SIGNED))
t1f_ps int(4) COALESCE(?,CAST(1 AS SIGNED))
t1f_nm decimal(3,0) COALESCE(DAYOFYEAR(a),CAST(1 AS UNSIGNED))
t1f_ps decimal(3,0) COALESCE(?,CAST(1 AS UNSIGNED))
t1f_nm int(4) @a:=DAYOFYEAR(a)
t1f_ps int(4) @a:=?
t2f_nm decimal(7,4) AVG(DAYOFYEAR(a))
t2f_ps decimal(7,4) AVG(?)
t2f_nm bigint(4) MIN(DAYOFYEAR(a))
t2f_ps bigint(4) MIN(?)
t2f_nm bigint(4) MAX(DAYOFYEAR(a))
t2f_ps bigint(4) MAX(?)
t2f_nm mediumtext GROUP_CONCAT(DAYOFYEAR(a))
t2f_ps mediumtext GROUP_CONCAT(?)
DROP TABLE t1;
DROP PROCEDURE p1;
DROP PROCEDURE show_drop;
DROP FUNCTION params;
DROP FUNCTION select01;
DROP FUNCTION select02;
#
# End of 10.5 tests
#

View File

@ -263,3 +263,254 @@ SELECT
FROM t1; FROM t1;
DROP TABLE t1; DROP TABLE t1;
--enable_view_protocol --enable_view_protocol
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-33496 Out of range error in AVG(YEAR(datetime)) due to a wrong data type
--echo #
let select01=SELECT ?, CAST(? AS UNSIGNED), CAST(? AS SIGNED), ABS(?), ROUND(?), -?, ROUND(?,-1), ?+0, ?+0.0, CONCAT(?), LEAST(?,?), COALESCE(?), COALESCE(?,CAST(1 AS SIGNED)), COALESCE(?,CAST(1 AS UNSIGNED)), @a:=?;
let pcount01=16;
let select02=SELECT AVG(?), MIN(?), MAX(?), GROUP_CONCAT(?);
let pcount02=4;
let ts=TIMESTAMP'2001-12-13 10:20:30.999999';
eval CREATE FUNCTION select01() RETURNS TEXT RETURN '$select01';
eval CREATE FUNCTION select02() RETURNS TEXT RETURN '$select02';
CREATE TABLE t1 (a DATETIME(6));
INSERT INTO t1 VALUES ('2001-12-31 10:20:30.999999');
DELIMITER $$;
CREATE FUNCTION params(expr TEXT, count INT) RETURNS TEXT
BEGIN
RETURN CONCAT(expr, REPEAT(CONCAT(', ', expr), count-1));
END;
$$
CREATE PROCEDURE show_drop()
BEGIN
SELECT TABLE_NAME, COLUMN_TYPE, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA='test'
AND TABLE_NAME IN ('t1e_nm','t2e_nm','t1f_nm','t2f_nm',
't1e_ps','t1f_ps','t2e_ps','t2f_ps')
ORDER BY LEFT(TABLE_NAME, 2), ORDINAL_POSITION, TABLE_NAME;
FOR rec IN (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test'
AND TABLE_NAME IN ('t1e_nm','t2e_nm','t1f_nm','t2f_nm',
't1e_ps','t1f_ps','t2e_ps','t2f_ps'))
DO
EXECUTE IMMEDIATE CONCAT('DROP TABLE ', rec.TABLE_NAME);
END FOR;
END;
$$
CREATE PROCEDURE p1(unit VARCHAR(32))
BEGIN
DECLARE do_extract BOOL DEFAULT unit NOT IN('DAYOFYEAR');
DECLARE query01 TEXT DEFAULT
CONCAT('CREATE TABLE t2 AS ', select01(), ' FROM t1');
DECLARE query02 TEXT DEFAULT
CONCAT('CREATE TABLE t2 AS ', select02(), ' FROM t1');
IF (do_extract)
THEN
EXECUTE IMMEDIATE REPLACE(REPLACE(query01,'t2','t1e_nm'),'?', CONCAT('EXTRACT(',unit,' FROM a)'));
EXECUTE IMMEDIATE REPLACE(REPLACE(query02,'t2','t2e_nm'),'?', CONCAT('EXTRACT(',unit,' FROM a)'));
END IF;
EXECUTE IMMEDIATE REPLACE(REPLACE(query01,'t2','t1f_nm'),'?', CONCAT(unit,'(a)'));
EXECUTE IMMEDIATE REPLACE(REPLACE(query02,'t2','t2f_nm'),'?', CONCAT(unit,'(a)'));
END;
$$
DELIMITER ;$$
--echo
--echo
--echo # EXTRACT(YEAR FROM expr) and YEAR(expr) are equivalent
CALL p1('YEAR');
let extr=EXTRACT(YEAR FROM $ts);
let func=YEAR($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(QUARTER FROM expr) and QUARTER(expr) are equavalent
CALL p1('QUARTER');
let extr=EXTRACT(QUARTER FROM $ts);
let func=QUARTER($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(MONTH FROM expr) and MONTH(expr) are equavalent
CALL p1('MONTH');
let extr=EXTRACT(MONTH FROM $ts);
let func=MONTH($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(WEEK FROM expr) and WEEK(expr) are equavalent
CALL p1('WEEK');
let extr=EXTRACT(WEEK FROM $ts);
let func=WEEK($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(DAY FROM expr) returns hours/24 and includes the sign for TIME
--echo # DAY(expr) returns the DD part of CAST(expr AS DATETIME)
CALL p1('DAY');
let extr=EXTRACT(DAY FROM $ts);
let func=DAY($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(HOUR FROM expr) returns hours%24 and includes the sign for TIME
--echo # HOUR(expr) returns the hh part of CAST(expr AS DATETIME)
CALL p1('HOUR');
let extr=EXTRACT(HOUR FROM $ts);
let func=HOUR($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(MINUTE FROM expr) includes the sign for TIME
--echo # MINUTE(expr) returns the absolute value
CALL p1('MINUTE');
let extr=EXTRACT(MINUTE FROM $ts);
let func=MINUTE($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(SECONDS FROM expr) includes the sign for TIME
--echo # SECONDS(expr) returns the absolute value
CALL p1('SECOND');
let extr=EXTRACT(SECOND FROM $ts);
let func=SECOND($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # EXTRACT(MICROSECONDS FROM expr) includes the sign for TIME
--echo # MICROSECONDS(expr) returns the absolute value
CALL p1('MICROSECOND');
let extr=EXTRACT(MICROSECOND FROM $ts);
let func=MICROSECOND($ts);
let extr01=`SELECT params("$extr", $pcount01) AS p`;
let func01=`SELECT params("$func", $pcount01) AS p`;
let extr02=`SELECT params("$extr", $pcount02) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1e_ps AS $select01' USING $extr01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2e_ps AS $select02' USING $extr02;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
--echo
--echo
--echo # DAYOFYEAR
CALL p1('DAYOFYEAR');
let func=DAYOFYEAR($ts);
let func01=`SELECT params("$func", $pcount01) AS p`;
let func02=`SELECT params("$func", $pcount02) AS p`;
eval EXECUTE IMMEDIATE 'CREATE TABLE t1f_ps AS $select01' USING $func01;
eval EXECUTE IMMEDIATE 'CREATE TABLE t2f_ps AS $select02' USING $func02;
CALL show_drop;
DROP TABLE t1;
DROP PROCEDURE p1;
DROP PROCEDURE show_drop;
DROP FUNCTION params;
DROP FUNCTION select01;
DROP FUNCTION select02;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -1443,3 +1443,98 @@ drop table t1;
# #
# End of 10.3 tests # End of 10.3 tests
# #
#
# MDEV-31276: Execution of PS from grouping query with join
# and GROUP_CONCAT set function
#
create table t1 (a int, b varchar(20)) engine=myisam;
create table t2 (a int, c varchar(20)) engine=myisam;
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
insert into t2 values (1,"eeeeeee"),(2,"fffffff");
set group_concat_max_len=5;
select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
explain select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
prepare stmt from "select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a";
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
deallocate prepare stmt;
set join_cache_level=0;
select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
explain select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
prepare stmt from "select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a";
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
execute stmt;
count(*) group_concat(t1.b,t2.c)
2 aaaaa
2 bbbbb
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
Warning 1260 Row 2 was cut by GROUP_CONCAT()
deallocate prepare stmt;
set join_cache_level=default;
set group_concat_max_len=default;
drop table t1,t2;
#
# MDEV-33772 Bad SEPARATOR value in GROUP_CONCAT on character set conversion
#
SET NAMES utf8, @@collation_connection=latin1_swedish_ci;
CREATE TABLE t1 (c VARCHAR(10)) CHARACTER SET latin1;
INSERT INTO t1 VALUES ('a'),('A');
CREATE OR REPLACE VIEW v1 AS
SELECT GROUP_CONCAT(c SEPARATOR 'ß') AS c1 FROM t1 GROUP BY c;
SELECT * FROM v1;
c1
aßA
SELECT HEX(c1) FROM v1;
HEX(c1)
61DF41
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 group_concat(`t1`.`c` separator 'ß') AS `c1` from `t1` group by `t1`.`c` utf8mb3 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1;
SET NAMES latin1;
# End of 10.5 tests

View File

@ -1066,3 +1066,59 @@ drop table t1;
--echo # --echo #
--echo # End of 10.3 tests --echo # End of 10.3 tests
--echo # --echo #
--echo #
--echo # MDEV-31276: Execution of PS from grouping query with join
--echo # and GROUP_CONCAT set function
--echo #
create table t1 (a int, b varchar(20)) engine=myisam;
create table t2 (a int, c varchar(20)) engine=myisam;
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
insert into t2 values (1,"eeeeeee"),(2,"fffffff");
let $q=
select count(*), group_concat(t1.b,t2.c)
from t1 join t2 on t1.a=t2.a group by t1.a;
set group_concat_max_len=5;
eval $q;
eval explain $q;
eval prepare stmt from "$q";
execute stmt;
execute stmt;
deallocate prepare stmt;
set join_cache_level=0;
eval $q;
eval explain $q;
eval prepare stmt from "$q";
execute stmt;
execute stmt;
deallocate prepare stmt;
set join_cache_level=default;
set group_concat_max_len=default;
drop table t1,t2;
--echo #
--echo # MDEV-33772 Bad SEPARATOR value in GROUP_CONCAT on character set conversion
--echo #
SET NAMES utf8, @@collation_connection=latin1_swedish_ci;
CREATE TABLE t1 (c VARCHAR(10)) CHARACTER SET latin1;
INSERT INTO t1 VALUES ('a'),('A');
CREATE OR REPLACE VIEW v1 AS
SELECT GROUP_CONCAT(c SEPARATOR 'ß') AS c1 FROM t1 GROUP BY c;
SELECT * FROM v1;
SELECT HEX(c1) FROM v1;
SHOW CREATE VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
SET NAMES latin1;
--echo # End of 10.5 tests

View File

@ -272,7 +272,7 @@ create table t1 as select json_object('id', 87, 'name', 'carrot') as f;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`f` varchar(32) DEFAULT NULL `f` varchar(46) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
select * from t1; select * from t1;
f f

View File

@ -87,15 +87,12 @@ select json_extract('[10, 20, [30, 40], 1, 10]', '$[1]') as exp;
select json_extract('[10, 20, [30, 40], 1, 10]', '$[1]', '$[25]') as exp; select json_extract('[10, 20, [30, 40], 1, 10]', '$[1]', '$[25]') as exp;
select json_extract( '[{"a": [3, 4]}, {"b": 2}]', '$[0].a', '$[1].a') as exp; select json_extract( '[{"a": [3, 4]}, {"b": 2}]', '$[0].a', '$[1].a') as exp;
#enable after MDEV-32454 fix
--disable_view_protocol
select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word') as exp; select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word') as exp;
select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.d[3]', 3) as exp; select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.d[3]', 3) as exp;
select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.a[2]', 2) as exp; select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.a[2]', 2) as exp;
select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.c', 'word') as exp; select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.c', 'word') as exp;
select json_set('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]') as exp; select json_set('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]') as exp;
--enable_view_protocol
select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]') as exp; select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]') as exp;
select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.b', '[true, false]') as exp; select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.b', '[true, false]') as exp;
@ -137,14 +134,11 @@ select json_merge('a','b');
select json_merge('{"a":"b"}','{"c":"d"}'); select json_merge('{"a":"b"}','{"c":"d"}');
SELECT JSON_MERGE('[1, 2]', '{"id": 47}'); SELECT JSON_MERGE('[1, 2]', '{"id": 47}');
#enable after MDEV-32454 fix
--disable_view_protocol
select json_type('{"k1":123, "k2":345}'); select json_type('{"k1":123, "k2":345}');
select json_type('[123, "k2", 345]'); select json_type('[123, "k2", 345]');
select json_type("true"); select json_type("true");
select json_type('123'); select json_type('123');
select json_type('123.12'); select json_type('123.12');
--enable_view_protocol
select json_keys('{"a":{"c":1, "d":2}, "b":2}'); select json_keys('{"a":{"c":1, "d":2}, "b":2}');
select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.a"); select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.a");
@ -173,11 +167,8 @@ select json_search( json_col, 'all', 'foot' ) as ex from t1;
drop table t1; drop table t1;
#enable after MDEV-32454 fix
--disable_view_protocol
select json_unquote('"abc"'); select json_unquote('"abc"');
select json_unquote('abc'); select json_unquote('abc');
--enable_view_protocol
# #
# MDEV-13703 Illegal mix of collations for operation 'json_object' on using JSON_UNQUOTE as an argument. # MDEV-13703 Illegal mix of collations for operation 'json_object' on using JSON_UNQUOTE as an argument.
# #
@ -188,13 +179,9 @@ select json_object('foo', json_unquote(json_object('bar', c)),'qux', c) as fld f
drop table t1; drop table t1;
#enable after MDEV-32454 fix
--disable_view_protocol
select json_object("a", json_object("b", "abcd")); select json_object("a", json_object("b", "abcd"));
select json_object("a", '{"b": "abcd"}'); select json_object("a", '{"b": "abcd"}');
select json_object("a", json_compact('{"b": "abcd"}')); select json_object("a", json_compact('{"b": "abcd"}'));
--enable_view_protocol
select json_compact(NULL); select json_compact(NULL);
select json_depth(json_compact(NULL)); select json_depth(json_compact(NULL));
@ -270,11 +257,8 @@ select json_merge('{"a":{"u":12, "x":"b"}}', '{"a":{"x":"c"}}') as ex ;
select json_merge('{"a":{"u":12, "x":"b", "r":1}}', '{"a":{"x":"c", "r":2}}') as ex ; select json_merge('{"a":{"u":12, "x":"b", "r":1}}', '{"a":{"x":"c", "r":2}}') as ex ;
select json_compact('{"a":1, "b":[1,2,3], "c":{"aa":"v1", "bb": "v2"}}') as ex; select json_compact('{"a":1, "b":[1,2,3], "c":{"aa":"v1", "bb": "v2"}}') as ex;
#enable after MDEV-32454 fix
--disable_view_protocol
select json_loose('{"a":1, "b":[1,2,3], "c":{"aa":"v1", "bb": "v2"}}') as ex; select json_loose('{"a":1, "b":[1,2,3], "c":{"aa":"v1", "bb": "v2"}}') as ex;
select json_detailed('{"a":1, "b":[1,2,3], "c":{"aa":"v1", "bb": "v2"}}') as ex; select json_detailed('{"a":1, "b":[1,2,3], "c":{"aa":"v1", "bb": "v2"}}') as ex;
--enable_view_protocol
# #
# MDEV-11856 json_search doesn't search for values with double quotes character (") # MDEV-11856 json_search doesn't search for values with double quotes character (")
@ -469,12 +453,9 @@ drop table t1;
--echo # MDEV-16750 JSON_SET mishandles unicode every second pair of arguments. --echo # MDEV-16750 JSON_SET mishandles unicode every second pair of arguments.
--echo # --echo #
#enable after MDEV-32454 fix
--disable_view_protocol
SELECT JSON_SET('{}', '$.a', _utf8 0xC3B6) as exp; SELECT JSON_SET('{}', '$.a', _utf8 0xC3B6) as exp;
SELECT JSON_SET('{}', '$.a', _utf8 0xC3B6, '$.b', _utf8 0xC3B6) as exp; SELECT JSON_SET('{}', '$.a', _utf8 0xC3B6, '$.b', _utf8 0xC3B6) as exp;
SELECT JSON_SET('{}', '$.a', _utf8 X'C3B6', '$.x', 1, '$.b', _utf8 X'C3B6') as exp; SELECT JSON_SET('{}', '$.a', _utf8 X'C3B6', '$.x', 1, '$.b', _utf8 X'C3B6') as exp;
--enable_view_protocol
--echo # --echo #
--echo # MDEV-17121 JSON_ARRAY_APPEND --echo # MDEV-17121 JSON_ARRAY_APPEND

View File

@ -110,7 +110,7 @@ R2
R3 R3
deallocate prepare stmt1; deallocate prepare stmt1;
drop table t1; drop table t1;
End of 4.1 tests # End of 4.1 tests
SELECT 1 REGEXP NULL; SELECT 1 REGEXP NULL;
1 REGEXP NULL 1 REGEXP NULL
NULL NULL
@ -126,7 +126,7 @@ NULL
SELECT "ABC" REGEXP BINARY NULL; SELECT "ABC" REGEXP BINARY NULL;
"ABC" REGEXP BINARY NULL "ABC" REGEXP BINARY NULL
NULL NULL
End of 5.0 tests # End of 5.0 tests
CREATE TABLE t1(a INT, b CHAR(4)); CREATE TABLE t1(a INT, b CHAR(4));
INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0'); INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0');
PREPARE stmt1 FROM "SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1"; PREPARE stmt1 FROM "SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1";
@ -144,7 +144,7 @@ a
1 1
DEALLOCATE PREPARE stmt1; DEALLOCATE PREPARE stmt1;
DROP TABLE t1; DROP TABLE t1;
End of 5.1 tests # End of 5.1 tests
SELECT ' ' REGEXP '[[:blank:]]'; SELECT ' ' REGEXP '[[:blank:]]';
' ' REGEXP '[[:blank:]]' ' ' REGEXP '[[:blank:]]'
1 1
@ -163,3 +163,19 @@ SELECT '\t' REGEXP '[[:space:]]';
SELECT REGEXP_INSTR('111222333',2); SELECT REGEXP_INSTR('111222333',2);
REGEXP_INSTR('111222333',2) REGEXP_INSTR('111222333',2)
4 4
# End of 10.3 tests
#
# MDEV-33344 REGEXP empty string inconsistent
#
create table t1 (x char(5));
insert t1 values (''), ('x');
select 'foo' regexp x from t1 order by x asc;
'foo' regexp x
1
0
select 'foo' regexp x from t1 order by x desc;
'foo' regexp x
0
1
drop table t1;
# End of 10.5 tests

View File

@ -55,7 +55,7 @@ execute stmt1 using @a;
deallocate prepare stmt1; deallocate prepare stmt1;
drop table t1; drop table t1;
--echo End of 4.1 tests --echo # End of 4.1 tests
# #
@ -74,7 +74,7 @@ SELECT NULL REGEXP BINARY NULL;
SELECT 'A' REGEXP BINARY NULL; SELECT 'A' REGEXP BINARY NULL;
SELECT "ABC" REGEXP BINARY NULL; SELECT "ABC" REGEXP BINARY NULL;
--echo End of 5.0 tests --echo # End of 5.0 tests
# #
@ -91,7 +91,7 @@ DEALLOCATE PREPARE stmt1;
DROP TABLE t1; DROP TABLE t1;
--echo End of 5.1 tests --echo # End of 5.1 tests
# #
# MDEV-5820 MySQL Bug #54805 definitions in regex/my_regex.h conflict with /usr/include/regex.h # MDEV-5820 MySQL Bug #54805 definitions in regex/my_regex.h conflict with /usr/include/regex.h
@ -110,3 +110,15 @@ SELECT '\t' REGEXP '[[:space:]]';
--echo # --echo #
SELECT REGEXP_INSTR('111222333',2); SELECT REGEXP_INSTR('111222333',2);
--echo # End of 10.3 tests
--echo #
--echo # MDEV-33344 REGEXP empty string inconsistent
--echo #
create table t1 (x char(5));
insert t1 values (''), ('x');
select 'foo' regexp x from t1 order by x asc;
select 'foo' regexp x from t1 order by x desc;
drop table t1;
--echo # End of 10.5 tests

View File

@ -7,7 +7,7 @@ select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
select 'hello' 'monty'; select 'hello' 'monty';
hello hellomonty
hellomonty hellomonty
select length('\n\t\r\b\0\_\%\\'); select length('\n\t\r\b\0\_\%\\');
length('\n\t\r\b\0\_\%\\') length('\n\t\r\b\0\_\%\\')

View File

@ -3142,7 +3142,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def test t1 t1 a a 12 26 26 Y 128 6 63 def test t1 t1 a a 12 26 26 Y 128 6 63
def EXTRACT(YEAR FROM a) 3 4 4 Y 32896 0 63 def EXTRACT(YEAR FROM a) 3 4 4 Y 32896 0 63
def EXTRACT(YEAR_MONTH FROM a) 3 6 6 Y 32896 0 63 def EXTRACT(YEAR_MONTH FROM a) 3 6 6 Y 32896 0 63
def EXTRACT(QUARTER FROM a) 3 2 1 Y 32896 0 63 def EXTRACT(QUARTER FROM a) 3 1 1 Y 32896 0 63
def EXTRACT(MONTH FROM a) 3 2 2 Y 32896 0 63 def EXTRACT(MONTH FROM a) 3 2 2 Y 32896 0 63
def EXTRACT(WEEK FROM a) 3 2 2 Y 32896 0 63 def EXTRACT(WEEK FROM a) 3 2 2 Y 32896 0 63
def EXTRACT(DAY FROM a) 3 3 2 Y 32896 0 63 def EXTRACT(DAY FROM a) 3 3 2 Y 32896 0 63
@ -3230,11 +3230,11 @@ SHOW CREATE TABLE t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`a` datetime(6) DEFAULT NULL, `a` datetime(6) DEFAULT NULL,
`EXTRACT(YEAR FROM a)` int(4) DEFAULT NULL, `EXTRACT(YEAR FROM a)` int(5) DEFAULT NULL,
`EXTRACT(YEAR_MONTH FROM a)` int(6) DEFAULT NULL, `EXTRACT(YEAR_MONTH FROM a)` int(7) DEFAULT NULL,
`EXTRACT(QUARTER FROM a)` int(2) DEFAULT NULL, `EXTRACT(QUARTER FROM a)` int(2) DEFAULT NULL,
`EXTRACT(MONTH FROM a)` int(2) DEFAULT NULL, `EXTRACT(MONTH FROM a)` int(3) DEFAULT NULL,
`EXTRACT(WEEK FROM a)` int(2) DEFAULT NULL, `EXTRACT(WEEK FROM a)` int(3) DEFAULT NULL,
`EXTRACT(DAY FROM a)` int(3) DEFAULT NULL, `EXTRACT(DAY FROM a)` int(3) DEFAULT NULL,
`EXTRACT(DAY_HOUR FROM a)` int(5) DEFAULT NULL, `EXTRACT(DAY_HOUR FROM a)` int(5) DEFAULT NULL,
`EXTRACT(DAY_MINUTE FROM a)` int(7) DEFAULT NULL, `EXTRACT(DAY_MINUTE FROM a)` int(7) DEFAULT NULL,
@ -3281,7 +3281,7 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def test t1 t1 a a 11 17 17 Y 128 6 63 def test t1 t1 a a 11 17 17 Y 128 6 63
def EXTRACT(YEAR FROM a) 3 4 1 Y 32896 0 63 def EXTRACT(YEAR FROM a) 3 4 1 Y 32896 0 63
def EXTRACT(YEAR_MONTH FROM a) 3 6 1 Y 32896 0 63 def EXTRACT(YEAR_MONTH FROM a) 3 6 1 Y 32896 0 63
def EXTRACT(QUARTER FROM a) 3 2 1 Y 32896 0 63 def EXTRACT(QUARTER FROM a) 3 1 1 Y 32896 0 63
def EXTRACT(MONTH FROM a) 3 2 1 Y 32896 0 63 def EXTRACT(MONTH FROM a) 3 2 1 Y 32896 0 63
def EXTRACT(WEEK FROM a) 3 2 9 Y 32896 0 63 def EXTRACT(WEEK FROM a) 3 2 9 Y 32896 0 63
def EXTRACT(DAY FROM a) 3 3 3 Y 32896 0 63 def EXTRACT(DAY FROM a) 3 3 3 Y 32896 0 63
@ -3411,11 +3411,11 @@ SHOW CREATE TABLE t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`a` time(6) DEFAULT NULL, `a` time(6) DEFAULT NULL,
`EXTRACT(YEAR FROM a)` int(4) DEFAULT NULL, `EXTRACT(YEAR FROM a)` int(5) DEFAULT NULL,
`EXTRACT(YEAR_MONTH FROM a)` int(6) DEFAULT NULL, `EXTRACT(YEAR_MONTH FROM a)` int(7) DEFAULT NULL,
`EXTRACT(QUARTER FROM a)` int(2) DEFAULT NULL, `EXTRACT(QUARTER FROM a)` int(2) DEFAULT NULL,
`EXTRACT(MONTH FROM a)` int(2) DEFAULT NULL, `EXTRACT(MONTH FROM a)` int(3) DEFAULT NULL,
`EXTRACT(WEEK FROM a)` int(2) DEFAULT NULL, `EXTRACT(WEEK FROM a)` int(3) DEFAULT NULL,
`EXTRACT(DAY FROM a)` int(3) DEFAULT NULL, `EXTRACT(DAY FROM a)` int(3) DEFAULT NULL,
`EXTRACT(DAY_HOUR FROM a)` int(5) DEFAULT NULL, `EXTRACT(DAY_HOUR FROM a)` int(5) DEFAULT NULL,
`EXTRACT(DAY_MINUTE FROM a)` int(7) DEFAULT NULL, `EXTRACT(DAY_MINUTE FROM a)` int(7) DEFAULT NULL,

View File

@ -894,7 +894,7 @@ show status like 'Last_query_cost';
Variable_name Value Variable_name Value
Last_query_cost 4.016090 Last_query_cost 4.016090
select 'The cost of accessing t1 (dont care if it changes' '^'; select 'The cost of accessing t1 (dont care if it changes' '^';
The cost of accessing t1 (dont care if it changes The cost of accessing t1 (dont care if it changes^
The cost of accessing t1 (dont care if it changes^ The cost of accessing t1 (dont care if it changes^
select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z; select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z;
Z Z
@ -3423,6 +3423,62 @@ SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.
COUNT(*) COUNT(*)
2 2
DROP TABLE t1, t2, t3; DROP TABLE t1, t2, t3;
#
# MDEV-30975: Wrong result with cross Join given join order
#
CREATE TABLE `t1` (
`t1_seq` INT NOT NULL,
`c1` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`t1_seq`) USING BTREE
);
CREATE TABLE `t2` (
`t2_seq` INT NOT NULL,
`t1_seq` INT NOT NULL,
`c2` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`t2_seq`, `t1_seq`) USING BTREE
);
INSERT INTO t1 VALUES(1, 'A');
INSERT INTO t2 VALUES(1, 1, 'T2-1-1');
INSERT INTO t2 VALUES(2, 1, 'T2-1-2');
INSERT INTO t2 VALUES(3, 1, 'T2-1-3');
SELECT LPAD(@rownum := @rownum + 1, 8, 0) AS str_num
, t1.t1_seq
, t2.t2_seq
, t1.c1
, t2.c2
FROM t1
INNER JOIN t2 ON (t1.t1_seq = t2.t1_seq)
CROSS JOIN ( SELECT @rownum := 0 ) X;
str_num t1_seq t2_seq c1 c2
00000001 1 1 A T2-1-1
00000002 1 2 A T2-1-2
00000003 1 3 A T2-1-3
SELECT STRAIGHT_JOIN LPAD(@rownum := @rownum + 1, 8, 0) AS str_num
, t1.t1_seq
, t2.t2_seq
, t1.c1
, t2.c2
FROM t1
INNER JOIN t2 ON (t1.t1_seq = t2.t1_seq)
CROSS JOIN ( SELECT @rownum := 0 ) X;
str_num t1_seq t2_seq c1 c2
00000001 1 1 A T2-1-1
00000002 1 2 A T2-1-2
00000003 1 3 A T2-1-3
SELECT STRAIGHT_JOIN * FROM t1 JOIN t2 ON (t1.t1_seq = t2.t1_seq) JOIN (SELECT @a := 0) x;
t1_seq c1 t2_seq t1_seq c2 @a := 0
1 A 1 1 T2-1-1 0
1 A 2 1 T2-1-2 0
1 A 3 1 T2-1-3 0
SELECT * FROM t1 JOIN t2 ON (t1.t1_seq = t2.t1_seq) JOIN (SELECT @a := 0) x;
t1_seq c1 t2_seq t1_seq c2 @a := 0
1 A 1 1 T2-1-1 0
1 A 2 1 T2-1-2 0
1 A 3 1 T2-1-3 0
SELECT STRAIGHT_JOIN c1 FROM t1 JOIN (SELECT @a := 0) x;
c1
A
DROP TABLE t1, t2;
# End of 10.5 tests # End of 10.5 tests
# #
# MDEV-31449: Assertion s->table->opt_range_condition_rows <= s->found_records # MDEV-31449: Assertion s->table->opt_range_condition_rows <= s->found_records

View File

@ -1838,6 +1838,52 @@ SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b; SELECT COUNT(*) FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.b = t3.c) ON t1.a = t2.b;
DROP TABLE t1, t2, t3; DROP TABLE t1, t2, t3;
--echo #
--echo # MDEV-30975: Wrong result with cross Join given join order
--echo #
CREATE TABLE `t1` (
`t1_seq` INT NOT NULL,
`c1` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`t1_seq`) USING BTREE
);
CREATE TABLE `t2` (
`t2_seq` INT NOT NULL,
`t1_seq` INT NOT NULL,
`c2` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`t2_seq`, `t1_seq`) USING BTREE
);
INSERT INTO t1 VALUES(1, 'A');
INSERT INTO t2 VALUES(1, 1, 'T2-1-1');
INSERT INTO t2 VALUES(2, 1, 'T2-1-2');
INSERT INTO t2 VALUES(3, 1, 'T2-1-3');
SELECT LPAD(@rownum := @rownum + 1, 8, 0) AS str_num
, t1.t1_seq
, t2.t2_seq
, t1.c1
, t2.c2
FROM t1
INNER JOIN t2 ON (t1.t1_seq = t2.t1_seq)
CROSS JOIN ( SELECT @rownum := 0 ) X;
SELECT STRAIGHT_JOIN LPAD(@rownum := @rownum + 1, 8, 0) AS str_num
, t1.t1_seq
, t2.t2_seq
, t1.c1
, t2.c2
FROM t1
INNER JOIN t2 ON (t1.t1_seq = t2.t1_seq)
CROSS JOIN ( SELECT @rownum := 0 ) X;
SELECT STRAIGHT_JOIN * FROM t1 JOIN t2 ON (t1.t1_seq = t2.t1_seq) JOIN (SELECT @a := 0) x;
SELECT * FROM t1 JOIN t2 ON (t1.t1_seq = t2.t1_seq) JOIN (SELECT @a := 0) x;
SELECT STRAIGHT_JOIN c1 FROM t1 JOIN (SELECT @a := 0) x;
DROP TABLE t1, t2;
--echo # End of 10.5 tests --echo # End of 10.5 tests
--echo # --echo #

View File

@ -685,15 +685,9 @@ create table t1 (a int, b varchar(20));
create table t2 (a int, c varchar(20)); create table t2 (a int, c varchar(20));
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb"); insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd"); insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
#Enable after fix MDEV-31276
--disable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a; select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a;
--enable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a; select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
#Enable after fix MDEV-31276
--disable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a; select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
--enable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a; select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
drop table t1, t2; drop table t1, t2;
set group_concat_max_len=default; set group_concat_max_len=default;
@ -2372,11 +2366,8 @@ create view v1 as select * from t1
left join ( select 'Y' AS Voted, ElectionID from t2 ) AS T left join ( select 'Y' AS Voted, ElectionID from t2 ) AS T
on T.ElectionID = t1.Election on T.ElectionID = t1.Election
limit 9; limit 9;
#enable after fix MDEV-31277
--disable_ps2_protocol
# limit X causes merge algorithm select as opposed to temp table # limit X causes merge algorithm select as opposed to temp table
select * from v1; select * from v1;
--enable_ps2_protocol
drop table t1, t2; drop table t1, t2;
drop view v1; drop view v1;
@ -2391,10 +2382,7 @@ create view v10 as select *, 'U' as u from t10 left join (select 'Y' as y, t20.b
create table t30 (c int); create table t30 (c int);
insert into t30 values (1),(3); insert into t30 values (1),(3);
create view v20 as select * from t30 left join (select 'X' as x, v10.u, v10.y, v10.b from v10) dt2 on t30.c=dt2.b limit 6; create view v20 as select * from t30 left join (select 'X' as x, v10.u, v10.y, v10.b from v10) dt2 on t30.c=dt2.b limit 6;
#check after fix MDEV-31277
--disable_ps2_protocol
select * from v20 limit 9; select * from v20 limit 9;
--enable_ps2_protocol
drop view v10, v20; drop view v10, v20;
drop table t10, t20, t30; drop table t10, t20, t30;
@ -2408,8 +2396,6 @@ insert into t3 values (3),(1);
create table t1 (a int); create table t1 (a int);
insert into t1 values (1),(2),(7),(1); insert into t1 values (1),(2),(7),(1);
#check after fix MDEV-31277
--disable_ps2_protocol
select * from select * from
( (
select * from select * from
@ -2422,7 +2408,6 @@ select * from
on dt1.a=dt2.b on dt1.a=dt2.b
limit 9 limit 9
) dt; ) dt;
--enable_ps2_protocol
## Same as dt3 above ## Same as dt3 above
create view v3(x,c) as select * from (select 'X' as x, t3.c from t3) dt3; create view v3(x,c) as select * from (select 'X' as x, t3.c from t3) dt3;
@ -2436,10 +2421,7 @@ create view v0(y,b,x,c) as select * from v2 left join v3 on v2.b=v3.c;
# Same as above select statement # Same as above select statement
create view v1 as select 'Z' as z, t1.a, v0.* from t1 left join v0 on t1.a=v0.b limit 9; create view v1 as select 'Z' as z, t1.a, v0.* from t1 left join v0 on t1.a=v0.b limit 9;
#check after fix MDEV-31277
--disable_ps2_protocol
select * from v1; select * from v1;
--enable_ps2_protocol
set statement join_cache_level=0 for set statement join_cache_level=0 for
select * from v1; select * from v1;

View File

@ -1,4 +1,8 @@
SET DEBUG_SYNC='dispatch_command_end SIGNAL ready WAIT_FOR go';
select 1;
connect con1,localhost,root,,; connect con1,localhost,root,,;
SET DEBUG_SYNC='now wait_for ready';
SET DEBUG_SYNC='now signal go';
SHOW PROCESSLIST; SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress Id User Host db Command Time State Info Progress
# root # test Sleep # # NULL 0.000 # root # test Sleep # # NULL 0.000
@ -6,6 +10,8 @@ Id User Host db Command Time State Info Progress
SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go'; SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go';
SHOW PROCESSLIST; SHOW PROCESSLIST;
connection default; connection default;
1
1
SET DEBUG_SYNC='now WAIT_FOR ready'; SET DEBUG_SYNC='now WAIT_FOR ready';
KILL QUERY con_id; KILL QUERY con_id;
SET DEBUG_SYNC='now SIGNAL go'; SET DEBUG_SYNC='now SIGNAL go';

View File

@ -4,7 +4,14 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
# This is to ensure that the following SHOW PROCESSLIST does not show the query
SET DEBUG_SYNC='dispatch_command_end SIGNAL ready WAIT_FOR go';
--send select 1
--connect (con1,localhost,root,,) --connect (con1,localhost,root,,)
SET DEBUG_SYNC='now wait_for ready';
SET DEBUG_SYNC='now signal go';
--let $con_id = `SELECT CONNECTION_ID()` --let $con_id = `SELECT CONNECTION_ID()`
--replace_result Execute Query --replace_result Execute Query
--replace_column 1 # 3 # 6 # 7 # --replace_column 1 # 3 # 6 # 7 #
@ -12,6 +19,8 @@ SHOW PROCESSLIST;
SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go'; SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go';
send SHOW PROCESSLIST; send SHOW PROCESSLIST;
--connection default --connection default
--reap
# We must wait for the SHOW PROCESSLIST query to have started before sending # We must wait for the SHOW PROCESSLIST query to have started before sending
# the kill. Otherwise, the KILL may be lost since it is reset at the start of # the kill. Otherwise, the KILL may be lost since it is reset at the start of
# query execution. # query execution.

View File

@ -3,6 +3,8 @@
--echo # --echo #
source include/not_embedded.inc; source include/not_embedded.inc;
source include/not_windows.inc; source include/not_windows.inc;
# this would need an instrumented ncurses library
source include/not_msan.inc;
error 0,1; error 0,1;
exec $MYSQL -V|grep -q readline; exec $MYSQL -V|grep -q readline;

View File

@ -261,3 +261,4 @@ SET @@global.character_set_server= @save_character_set_server;
SET @@global.collation_server= @save_collation_server; SET @@global.collation_server= @save_collation_server;
SET @@global.character_set_client= @save_character_set_client; SET @@global.character_set_client= @save_character_set_client;
SET @@global.collation_connection= @save_collation_connection; SET @@global.collation_connection= @save_collation_connection;
FOUND 1 /Aborted connection.*'u' host: '192.0.2.1' real ip: '(localhost|::1)'/ in mysqld.1.err

View File

@ -57,3 +57,9 @@ SET @@global.character_set_server= @save_character_set_server;
SET @@global.collation_server= @save_collation_server; SET @@global.collation_server= @save_collation_server;
SET @@global.character_set_client= @save_character_set_client; SET @@global.character_set_client= @save_character_set_client;
SET @@global.collation_connection= @save_collation_connection; SET @@global.collation_connection= @save_collation_connection;
# Search for "real ip" in Aborted message
# This is indicator for abort of the proxied connections.
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN= Aborted connection.*'u' host: '192.0.2.1' real ip: '(localhost|::1)';
source include/search_pattern_in_file.inc;

View File

@ -1880,7 +1880,7 @@ slave-run-triggers-for-rbr NO
slave-skip-errors OFF slave-skip-errors OFF
slave-sql-verify-checksum TRUE slave-sql-verify-checksum TRUE
slave-transaction-retries 10 slave-transaction-retries 10
slave-transaction-retry-errors 1158,1159,1160,1161,1205,1213,1429,2013,12701 slave-transaction-retry-errors 1158,1159,1160,1161,1205,1213,1020,1429,2013,12701
slave-transaction-retry-interval 0 slave-transaction-retry-interval 0
slave-type-conversions slave-type-conversions
slow-launch-time 2 slow-launch-time 2

View File

@ -3,6 +3,14 @@ Test bad binlog format.
Test bad default storage engine. Test bad default storage engine.
Test non-numeric value passed to number option. Test non-numeric value passed to number option.
Test that bad value for plugin enum option is rejected correctly. Test that bad value for plugin enum option is rejected correctly.
Test to see if multiple unknown options will be displayed in the error output
unknown option '--nonexistentoption'
unknown option '--alsononexistent'
unknown variable 'nonexistentvariable=1'
Test to see if multiple ambiguous options and invalid arguments will be displayed in the error output
Error while setting value 'invalid_value' to 'sql_mode'
ambiguous option '--character' (character-set-client-handshake, character_sets_dir)
option '--bootstrap' cannot take an argument
Test that --help --verbose works Test that --help --verbose works
Test that --not-known-option --help --verbose gives error Test that --not-known-option --help --verbose gives error
Done. Done.

View File

@ -46,6 +46,18 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--error 7 --error 7
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1 --exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--echo Test to see if multiple unknown options will be displayed in the error output
# Remove the noise to make the test robust
--replace_regex /^((?!nonexistent).)*$// /.*unknown/unknown/
--error 7
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --nonexistentoption --alsononexistent --nonexistentvariable=1 2>&1
--echo Test to see if multiple ambiguous options and invalid arguments will be displayed in the error output
# Remove the noise to make the test robust
--replace_regex /^((?!('sql_mode'|'--character'|'--bootstrap')).)*$// /.*Error while setting value/Error while setting value/ /.*ambiguous option/ambiguous option/ /.*option '--bootstrap'/option '--bootstrap'/
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --getopt-prefix-matching --sql-mode=invalid_value --character --bootstrap=partstoob 2>&1
# #
# Test that an wrong option with --help --verbose gives an error # Test that an wrong option with --help --verbose gives an error
# #

View File

@ -5930,5 +5930,55 @@ a b
2 30 2 30
DROP TABLE t1, t2; DROP TABLE t1, t2;
# #
# MDEV-33549: Incorrect handling of UPDATE in PS mode in case a table's colum declared as NOT NULL
#
CREATE TABLE t1 (a INT, b INT DEFAULT NULL);
INSERT INTO t1 VALUES (20, 30);
EXECUTE IMMEDIATE 'UPDATE t1 SET b=?' USING DEFAULT;
SELECT * FROM t1;
a b
20 NULL
# Run twice the same update in PS mode to check
# that no memory relating issues taken place.
PREPARE stmt FROM 'UPDATE t1 SET b=?';
EXECUTE stmt USING DEFAULT;
EXECUTE stmt USING DEFAULT;
# Clean up
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
# The same test for multi-table update
CREATE TABLE t1 (a INT, b INT DEFAULT NULL);
CREATE TABLE t2 (a INT, c INT DEFAULT NULL);
INSERT INTO t1 VALUES (20, 30);
INSERT INTO t2 VALUES (20, 30);
EXECUTE IMMEDIATE 'UPDATE t1,t2 SET b=? WHERE t1.a=t2.a' USING DEFAULT;
SELECT * FROM t1;
a b
20 NULL
# Run twice the same multi-table update in PS mode to check
# that no memory relating issues taken place.
PREPARE stmt FROM 'UPDATE t1,t2 SET b=? WHERE t1.a=t2.a';
EXECUTE stmt USING DEFAULT;
EXECUTE stmt USING DEFAULT;
DEALLOCATE PREPARE stmt;
# Clean up
DROP TABLE t1;
# This time checks that a default value for table's column
# represented by a function call is handled correctly on UPDATE in PS mode
CREATE TABLE t1 (a INT, b INT DEFAULT MOD(a, 3));
INSERT INTO t1 VALUES (20, 30);
EXECUTE IMMEDIATE 'UPDATE t1, t2 SET b=? WHERE t1.a=t2.a' USING DEFAULT;
SELECT * FROM t1;
a b
20 2
# Run twice the same multi-table update in PS mode to check
# that no memory relating issues taken place.
PREPARE stmt FROM 'UPDATE t1, t2 SET b=? WHERE t1.a=t2.a';
EXECUTE stmt USING DEFAULT;
EXECUTE stmt USING DEFAULT;
# Clean up
DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2;
#
# End of 10.4 tests # End of 10.4 tests
# #

View File

@ -5367,6 +5367,60 @@ SELECT * FROM t2;
# Cleanup # Cleanup
DROP TABLE t1, t2; DROP TABLE t1, t2;
--echo #
--echo # MDEV-33549: Incorrect handling of UPDATE in PS mode in case a table's colum declared as NOT NULL
--echo #
CREATE TABLE t1 (a INT, b INT DEFAULT NULL);
INSERT INTO t1 VALUES (20, 30);
EXECUTE IMMEDIATE 'UPDATE t1 SET b=?' USING DEFAULT;
SELECT * FROM t1;
--echo # Run twice the same update in PS mode to check
--echo # that no memory relating issues taken place.
PREPARE stmt FROM 'UPDATE t1 SET b=?';
EXECUTE stmt USING DEFAULT;
EXECUTE stmt USING DEFAULT;
--echo # Clean up
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
--echo # The same test for multi-table update
CREATE TABLE t1 (a INT, b INT DEFAULT NULL);
CREATE TABLE t2 (a INT, c INT DEFAULT NULL);
INSERT INTO t1 VALUES (20, 30);
INSERT INTO t2 VALUES (20, 30);
EXECUTE IMMEDIATE 'UPDATE t1,t2 SET b=? WHERE t1.a=t2.a' USING DEFAULT;
SELECT * FROM t1;
--echo # Run twice the same multi-table update in PS mode to check
--echo # that no memory relating issues taken place.
PREPARE stmt FROM 'UPDATE t1,t2 SET b=? WHERE t1.a=t2.a';
EXECUTE stmt USING DEFAULT;
EXECUTE stmt USING DEFAULT;
DEALLOCATE PREPARE stmt;
--echo # Clean up
DROP TABLE t1;
--echo # This time checks that a default value for table's column
--echo # represented by a function call is handled correctly on UPDATE in PS mode
CREATE TABLE t1 (a INT, b INT DEFAULT MOD(a, 3));
INSERT INTO t1 VALUES (20, 30);
EXECUTE IMMEDIATE 'UPDATE t1, t2 SET b=? WHERE t1.a=t2.a' USING DEFAULT;
SELECT * FROM t1;
--echo # Run twice the same multi-table update in PS mode to check
--echo # that no memory relating issues taken place.
PREPARE stmt FROM 'UPDATE t1, t2 SET b=? WHERE t1.a=t2.a';
EXECUTE stmt USING DEFAULT;
EXECUTE stmt USING DEFAULT;
--echo # Clean up
DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2;
--echo # --echo #
--echo # End of 10.4 tests --echo # End of 10.4 tests
--echo # --echo #

View File

@ -1798,7 +1798,7 @@ t5 CREATE TABLE `t5` (
`param09` longtext DEFAULT NULL, `param09` longtext DEFAULT NULL,
`const10` bigint(17) DEFAULT NULL, `const10` bigint(17) DEFAULT NULL,
`param10` bigint(20) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL, `const11` int(5) DEFAULT NULL,
`param11` bigint(20) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL,
`const12` binary(0) DEFAULT NULL, `const12` binary(0) DEFAULT NULL,
`param12` bigint(20) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL,
@ -1828,7 +1828,7 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 def test t5 t5 const10 const10 8 17 9 Y 32768 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63

View File

@ -1781,7 +1781,7 @@ t5 CREATE TABLE `t5` (
`param09` longtext DEFAULT NULL, `param09` longtext DEFAULT NULL,
`const10` bigint(17) DEFAULT NULL, `const10` bigint(17) DEFAULT NULL,
`param10` bigint(20) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL, `const11` int(5) DEFAULT NULL,
`param11` bigint(20) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL,
`const12` binary(0) DEFAULT NULL, `const12` binary(0) DEFAULT NULL,
`param12` bigint(20) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL,
@ -1811,7 +1811,7 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 def test t5 t5 const10 const10 8 17 9 Y 32768 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63

View File

@ -1782,7 +1782,7 @@ t5 CREATE TABLE `t5` (
`param09` longtext DEFAULT NULL, `param09` longtext DEFAULT NULL,
`const10` bigint(17) DEFAULT NULL, `const10` bigint(17) DEFAULT NULL,
`param10` bigint(20) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL, `const11` int(5) DEFAULT NULL,
`param11` bigint(20) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL,
`const12` binary(0) DEFAULT NULL, `const12` binary(0) DEFAULT NULL,
`param12` bigint(20) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL,
@ -1812,7 +1812,7 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 def test t5 t5 const10 const10 8 17 9 Y 32768 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63

View File

@ -1719,7 +1719,7 @@ t5 CREATE TABLE `t5` (
`param09` longtext DEFAULT NULL, `param09` longtext DEFAULT NULL,
`const10` bigint(17) DEFAULT NULL, `const10` bigint(17) DEFAULT NULL,
`param10` bigint(20) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL, `const11` int(5) DEFAULT NULL,
`param11` bigint(20) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL,
`const12` binary(0) DEFAULT NULL, `const12` binary(0) DEFAULT NULL,
`param12` bigint(20) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL,
@ -1749,7 +1749,7 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 def test t5 t5 const10 const10 8 17 9 Y 32768 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
@ -5087,7 +5087,7 @@ t5 CREATE TABLE `t5` (
`param09` longtext DEFAULT NULL, `param09` longtext DEFAULT NULL,
`const10` bigint(17) DEFAULT NULL, `const10` bigint(17) DEFAULT NULL,
`param10` bigint(20) DEFAULT NULL, `param10` bigint(20) DEFAULT NULL,
`const11` int(4) DEFAULT NULL, `const11` int(5) DEFAULT NULL,
`param11` bigint(20) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL,
`const12` binary(0) DEFAULT NULL, `const12` binary(0) DEFAULT NULL,
`param12` bigint(20) DEFAULT NULL, `param12` bigint(20) DEFAULT NULL,
@ -5117,7 +5117,7 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8 def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 def test t5 t5 const10 const10 8 17 9 Y 32768 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63

View File

@ -523,8 +523,6 @@ where a1 in (select substring(b1,1,512) from t2_512 where b1 > '0');
# group_concat with a blob argument - depends on # group_concat with a blob argument - depends on
# the variable group_concat_max_len, and # the variable group_concat_max_len, and
# convert_blob_length == max_len*collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB # convert_blob_length == max_len*collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB
#Check after fix MDEV-31276
--disable_ps2_protocol
explain extended select left(a1,7), left(a2,7) explain extended select left(a1,7), left(a2,7)
from t1_512 from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2); where a1 in (select group_concat(b1) from t2_512 group by b2);
@ -542,7 +540,6 @@ where a1 in (select group_concat(b1) from t2_512 group by b2);
select left(a1,7), left(a2,7) select left(a1,7), left(a2,7)
from t1_512 from t1_512
where a1 in (select group_concat(b1) from t2_512 group by b2); where a1 in (select group_concat(b1) from t2_512 group by b2);
--enable_ps2_protocol
drop table t1_512, t2_512, t3_512; drop table t1_512, t2_512, t3_512;
@ -608,8 +605,6 @@ where a1 in (select substring(b1,1,1024) from t2_1024 where b1 > '0');
# group_concat with a blob argument - depends on # group_concat with a blob argument - depends on
# the variable group_concat_max_len, and # the variable group_concat_max_len, and
# convert_blob_length == max_len*collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB # convert_blob_length == max_len*collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB
#Check after fix MDEV-31276
--disable_ps2_protocol
explain extended select left(a1,7), left(a2,7) explain extended select left(a1,7), left(a2,7)
from t1_1024 from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2); where a1 in (select group_concat(b1) from t2_1024 group by b2);
@ -627,7 +622,6 @@ where a1 in (select group_concat(b1) from t2_1024 group by b2);
select left(a1,7), left(a2,7) select left(a1,7), left(a2,7)
from t1_1024 from t1_1024
where a1 in (select group_concat(b1) from t2_1024 group by b2); where a1 in (select group_concat(b1) from t2_1024 group by b2);
--enable_ps2_protocol
drop table t1_1024, t2_1024, t3_1024; drop table t1_1024, t2_1024, t3_1024;
@ -693,8 +687,6 @@ where a1 in (select substring(b1,1,1025) from t2_1025 where b1 > '0');
# group_concat with a blob argument - depends on # group_concat with a blob argument - depends on
# the variable group_concat_max_len, and # the variable group_concat_max_len, and
# convert_blob_length == max_len*collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB # convert_blob_length == max_len*collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB
#Check after fix MDEV-31276
--disable_ps2_protocol
explain extended select left(a1,7), left(a2,7) explain extended select left(a1,7), left(a2,7)
from t1_1025 from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2); where a1 in (select group_concat(b1) from t2_1025 group by b2);
@ -712,7 +704,6 @@ where a1 in (select group_concat(b1) from t2_1025 group by b2);
select left(a1,7), left(a2,7) select left(a1,7), left(a2,7)
from t1_1025 from t1_1025
where a1 in (select group_concat(b1) from t2_1025 group by b2); where a1 in (select group_concat(b1) from t2_1025 group by b2);
--enable_ps2_protocol
drop table t1_1025, t2_1025, t3_1025; drop table t1_1025, t2_1025, t3_1025;

View File

@ -151,7 +151,7 @@ columns_priv CREATE TABLE `columns_priv` (
show create table procs_priv; show create table procs_priv;
Table Create Table Table Create Table
procs_priv CREATE TABLE `procs_priv` ( procs_priv CREATE TABLE `procs_priv` (
`Host` char(60) NOT NULL DEFAULT '', `Host` char(255) NOT NULL DEFAULT '',
`Db` char(64) NOT NULL DEFAULT '', `Db` char(64) NOT NULL DEFAULT '',
`User` char(128) NOT NULL DEFAULT '', `User` char(128) NOT NULL DEFAULT '',
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '', `Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',

View File

@ -131,7 +131,7 @@ columns_priv CREATE TABLE `columns_priv` (
show create table procs_priv; show create table procs_priv;
Table Create Table Table Create Table
procs_priv CREATE TABLE `procs_priv` ( procs_priv CREATE TABLE `procs_priv` (
`Host` char(60) NOT NULL DEFAULT '', `Host` char(255) NOT NULL DEFAULT '',
`Db` char(64) NOT NULL DEFAULT '', `Db` char(64) NOT NULL DEFAULT '',
`User` char(128) NOT NULL DEFAULT '', `User` char(128) NOT NULL DEFAULT '',
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '', `Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',

View File

@ -152,7 +152,7 @@ columns_priv CREATE TABLE `columns_priv` (
show create table procs_priv; show create table procs_priv;
Table Create Table Table Create Table
procs_priv CREATE TABLE `procs_priv` ( procs_priv CREATE TABLE `procs_priv` (
`Host` char(60) NOT NULL DEFAULT '', `Host` char(255) NOT NULL DEFAULT '',
`Db` char(64) NOT NULL DEFAULT '', `Db` char(64) NOT NULL DEFAULT '',
`User` char(128) NOT NULL DEFAULT '', `User` char(128) NOT NULL DEFAULT '',
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '', `Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',

View File

@ -155,7 +155,7 @@ DROP TABLE t1;
# #
SELECT json_object('a', (SELECT json_objectagg(b, c) FROM (SELECT 'b','c') d)) AS j FROM DUAL; SELECT json_object('a', (SELECT json_objectagg(b, c) FROM (SELECT 'b','c') d)) AS j FROM DUAL;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def j 250 (format=json) 9437283 16 Y 0 39 33 def j 250 (format=json) 9437310 16 Y 0 39 33
j j
{"a": {"b":"c"}} {"a": {"b":"c"}}
# #

View File

@ -4486,6 +4486,14 @@ sub extract_warning_lines ($$) {
qr/Slave I\/0: Master command COM_BINLOG_DUMP failed/, qr/Slave I\/0: Master command COM_BINLOG_DUMP failed/,
qr/Error reading packet/, qr/Error reading packet/,
qr/Lost connection to MariaDB server at 'reading initial communication packet'/, qr/Lost connection to MariaDB server at 'reading initial communication packet'/,
qr/Could not read packet:.* state: [2-3] /,
qr/Could not read packet:.* errno: 104 /,
qr/Could not read packet:.* errno: 0 .* length: 0/,
qr/Could not write packet:.* errno: 32 /,
qr/Could not write packet:.* errno: 104 /,
qr/Semisync ack receiver got error 1158/,
qr/Semisync ack receiver got hangup/,
qr/Connection was killed/,
qr/Failed on request_dump/, qr/Failed on request_dump/,
qr/Slave: Can't drop database.* database doesn't exist/, qr/Slave: Can't drop database.* database doesn't exist/,
qr/Slave: Operation DROP USER failed for 'create_rout_db'/, qr/Slave: Operation DROP USER failed for 'create_rout_db'/,
@ -4541,6 +4549,7 @@ sub extract_warning_lines ($$) {
qr/WSREP: Failed to guess base node address/, qr/WSREP: Failed to guess base node address/,
qr/WSREP: Guessing address for incoming client/, qr/WSREP: Guessing address for incoming client/,
qr/InnoDB: Difficult to find free blocks in the buffer pool*/,
# for UBSAN # for UBSAN
qr/decimal\.c.*: runtime error: signed integer overflow/, qr/decimal\.c.*: runtime error: signed integer overflow/,
# Disable test for UBSAN on dynamically loaded objects # Disable test for UBSAN on dynamically loaded objects

View File

@ -16,10 +16,9 @@ if ($stop_position)
--exec $MYSQL_BINLOG -F --print-table-metadata $_stop_position_opt $binlog_file > $output_file --exec $MYSQL_BINLOG -F --print-table-metadata $_stop_position_opt $binlog_file > $output_file
--let SEARCH_PATTERN= # (?:Columns\(| {8}).* --let SEARCH_PATTERN= (?m-s:# (?:Columns\(| {8}).*)
--let SEARCH_FILE= $output_file --let SEARCH_FILE= $output_file
--let SEARCH_OUTPUT=matches --let SEARCH_OUTPUT=matches
--let SEARCH_TYPE="_gm_"
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
if ($print_primary_key) if ($print_primary_key)

View File

@ -2,6 +2,8 @@ include/master-slave.inc
[connection master] [connection master]
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153"); call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
call mtr.add_suppression("Could not write packet:");
call mtr.add_suppression("Got a packet bigger than 'max_allowed_packet' bytes");
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
connection master; connection master;

View File

@ -37,7 +37,9 @@ connection con_temp1;
BEGIN; BEGIN;
INSERT INTO t2 VALUES (21); INSERT INTO t2 VALUES (21);
connection server_2; connection server_2;
START SLAVE; START SLAVE IO_THREAD;
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
START SLAVE SQL_THREAD;
connection con_temp2; connection con_temp2;
SET @old_dbug= @@GLOBAL.debug_dbug; SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";

View File

@ -64,7 +64,7 @@ SET sql_mode=@mode;
# Test litteral concat # Test litteral concat
# #
SELECT 'a' 'b'; SELECT 'a' 'b';
a ab
ab ab
SELECT 'a' ''; SELECT 'a' '';
a a
@ -76,13 +76,13 @@ SELECT '' '';
NULL NULL
NULL NULL
SELECT '' 'b' 'c'; SELECT '' 'b' 'c';
b bc
bc bc
SELECT '' '' 'c'; SELECT '' '' 'c';
c c
c c
SELECT 'a' '' 'c'; SELECT 'a' '' 'c';
a ac
ac ac
SELECT 'a' '' ''; SELECT 'a' '' '';
a a

View File

@ -24,8 +24,9 @@ insert t2 values (repeat('tempsecret', 12));
insert t3 values (repeat('dummysecret', 12)); insert t3 values (repeat('dummysecret', 12));
--echo # Wait max 10 min for key encryption threads to encrypt all spaces --echo # Wait max 10 min for key encryption threads to encrypt all spaces
--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'`
--let $wait_timeout= 600 --let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 --let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
--source include/wait_condition.inc --source include/wait_condition.inc
--sorted_result --sorted_result
@ -95,8 +96,9 @@ UNLOCK TABLES;
SET GLOBAL innodb_encrypt_tables = on; SET GLOBAL innodb_encrypt_tables = on;
--echo # Wait max 10 min for key encryption threads to encrypt all spaces --echo # Wait max 10 min for key encryption threads to encrypt all spaces
--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'`
--let $wait_timeout= 600 --let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; --let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
--source include/wait_condition.inc --source include/wait_condition.inc
--sorted_result --sorted_result

View File

@ -1,6 +1,6 @@
include/master-slave.inc include/master-slave.inc
[connection master] [connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET GLOBAL LOG_WARNINGS=4;
create table t1(n int); create table t1(n int);
insert into t1 values(get_lock("lock",2)); insert into t1 values(get_lock("lock",2));
disconnect master; disconnect master;
@ -35,4 +35,5 @@ NULL
connection master1; connection master1;
drop table t1; drop table t1;
connection slave; connection slave;
connection default;
include/rpl_end.inc include/rpl_end.inc

View File

@ -0,0 +1,21 @@
connection node_2;
connection node_1;
connect node_1a,127.0.0.1,root,,test,$NODE_MYPORT_1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_1a;
TRUNCATE TABLE t1;
SET SESSION wsrep_retry_autocommit = 0;
SET DEBUG_SYNC = 'dict_stats_mdl_acquired SIGNAL may_toi WAIT_FOR bf_abort';
INSERT INTO t1 VALUES (1);
connection node_1;
SET DEBUG_SYNC = 'now WAIT_FOR may_toi';
TRUNCATE TABLE t1;
connection node_1a;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1;
disconnect node_1a;
disconnect node_2;
disconnect node_1;

View File

@ -10,7 +10,7 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1); INSERT INTO t2 VALUES (1);
connection node_2a; connection node_2a;
SET SESSION wsrep_sync_wait=0; SET SESSION wsrep_sync_wait=0;
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE 'Commit' or STATE = 'Waiting for certification');
EXPECT_1 EXPECT_1
1 1
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';

View File

@ -0,0 +1,44 @@
#
# MDEV-33136: Properly BF-abort user transactions with explicit locks
#
# User transactions may acquire explicit MDL locks from InnoDB level
# when persistent statistics is re-read for a table.
# If such a transaction would be subject to BF-abort, it was improperly
# detected as a system transaction and wouldn't get aborted.
#
# The fix: Check if a transaction holding explicit MDL locks is a user
# transaction in the MDL conflict handling code.
--source include/galera_cluster.inc
--source include/have_debug_sync.inc
--source include/have_debug.inc
--connect node_1a,127.0.0.1,root,,test,$NODE_MYPORT_1
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
--connection node_1a
TRUNCATE TABLE t1;
# TRUNCATE forces the next statement to re-read statistics from persistent storage,
# which will acquire MDL locks on the statistics tables in InnoDB.
SET SESSION wsrep_retry_autocommit = 0;
SET DEBUG_SYNC = 'dict_stats_mdl_acquired SIGNAL may_toi WAIT_FOR bf_abort';
--send
INSERT INTO t1 VALUES (1);
--connection node_1
SET DEBUG_SYNC = 'now WAIT_FOR may_toi';
TRUNCATE TABLE t1;
--connection node_1a
# Local INSERT gets aborted.
--error ER_LOCK_DEADLOCK
--reap
# Cleanup
--connection node_1
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1;
--disconnect node_1a
--source include/galera_end.inc

View File

@ -32,7 +32,7 @@ INSERT INTO t2 VALUES (1);
--connection node_2a --connection node_2a
--sleep 1 --sleep 1
SET SESSION wsrep_sync_wait=0; SET SESSION wsrep_sync_wait=0;
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification'); SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE 'Commit' or STATE = 'Waiting for certification');
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%'; SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
SELECT COUNT(*) AS EXPECT_0 FROM t1; SELECT COUNT(*) AS EXPECT_0 FROM t1;
SELECT COUNT(*) AS EXPECT_0 FROM t2; SELECT COUNT(*) AS EXPECT_0 FROM t2;

View File

@ -51,7 +51,7 @@ SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%'; --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
--source include/wait_condition.inc --source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committing%'; --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Commit';
--source include/wait_condition.inc --source include/wait_condition.inc
UNLOCK TABLES; UNLOCK TABLES;

View File

@ -96,11 +96,8 @@ a b c
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b)); CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b));
INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4); INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4);
connection con1; connect stop_purge,localhost,root,,;
# disable purge START TRANSACTION WITH CONSISTENT SNAPSHOT;
BEGIN;
SELECT * FROM t0;
a
connection default; connection default;
DELETE FROM t1 WHERE a = 1; DELETE FROM t1 WHERE a = 1;
UPDATE t1 SET a = 2, b = 2 WHERE a = 5; UPDATE t1 SET a = 2, b = 2 WHERE a = 5;
@ -109,10 +106,11 @@ SET DEBUG_SYNC= 'inplace_after_index_build SIGNAL uncommitted WAIT_FOR purged';
ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE; ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE;
connection con1; connection con1;
SET DEBUG_SYNC= 'now WAIT_FOR uncommitted'; SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
BEGIN;
DELETE FROM t1 WHERE a = 3; DELETE FROM t1 WHERE a = 3;
UPDATE t1 SET a = 7, b = 7 WHERE a = 4; UPDATE t1 SET a = 7, b = 7 WHERE a = 4;
INSERT INTO t1(a, b) VALUES (8, 8); INSERT INTO t1(a, b) VALUES (8, 8);
# enable purge disconnect stop_purge;
COMMIT; COMMIT;
# wait for purge to process the deleted/updated records. # wait for purge to process the deleted/updated records.
InnoDB 2 transactions not purged InnoDB 2 transactions not purged

View File

@ -131,9 +131,8 @@ CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b));
INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4); INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4);
connection con1; connect (stop_purge,localhost,root,,);
--echo # disable purge START TRANSACTION WITH CONSISTENT SNAPSHOT;
BEGIN; SELECT * FROM t0;
connection default; connection default;
DELETE FROM t1 WHERE a = 1; DELETE FROM t1 WHERE a = 1;
@ -148,13 +147,14 @@ send ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE;
connection con1; connection con1;
SET DEBUG_SYNC= 'now WAIT_FOR uncommitted'; SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
BEGIN;
DELETE FROM t1 WHERE a = 3; DELETE FROM t1 WHERE a = 3;
UPDATE t1 SET a = 7, b = 7 WHERE a = 4; UPDATE t1 SET a = 7, b = 7 WHERE a = 4;
INSERT INTO t1(a, b) VALUES (8, 8); INSERT INTO t1(a, b) VALUES (8, 8);
--echo # enable purge disconnect stop_purge;
COMMIT; COMMIT;
--echo # wait for purge to process the deleted/updated records. --echo # wait for purge to process the deleted/updated records.

View File

@ -51,7 +51,7 @@ ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
ALGORITHM=COPY; ALGORITHM=COPY;
connection default; connection default;
SET DEBUG_SYNC='now WAIT_FOR hung'; SET DEBUG_SYNC='now WAIT_FOR hung';
# restart: --innodb-force-recovery=3 --debug_dbug=+d,recv_ran_out_of_buffer # restart: --innodb-force-recovery=3
disconnect hang; disconnect hang;
FTS_INDEX_1.ibd FTS_INDEX_1.ibd
FTS_INDEX_2.ibd FTS_INDEX_2.ibd

View File

@ -105,3 +105,60 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1; DROP TABLE t1;
SET DEBUG_SYNC='RESET'; SET DEBUG_SYNC='RESET';
#
# MDEV-33593: Auto increment deadlock error causes ASSERT in subsequent save point
#
CREATE TABLE t1(col1 INT PRIMARY KEY AUTO_INCREMENT, col2 INT) ENGINE=InnoDB;
CREATE TABLE t2(col1 INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1(col2) values(100);
connect con1, localhost, root,,;
START TRANSACTION;
# T1: Acquiring Row X lock on table t2
INSERT INTO t2 values(100);
connect con2, localhost, root,,;
START TRANSACTION;
# T2: Wait for (T1) row lock on t2 after acquiring GAP Lock on t1
UPDATE t1 SET col2 = 20 where col1 = 10;
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t2_waiting';
INSERT INTO t2 values(100);
connection default;
SET DEBUG_SYNC='now WAIT_FOR t2_waiting';
# T3: Wait for (T2) II row Lock on t1 after acquiring Auto Increment Lock on t1
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t3_waiting';
INSERT INTO t1(col2) SELECT col2 from t1;
connection con1;
SAVEPOINT s1;
SET DEBUG_SYNC='now WAIT_FOR t3_waiting';
# T1: Wait for (T3) auto increment lock on t1 causing T1 -> T3 -> T2 -> T1 deadlock
SET debug_dbug = '+d,innodb_deadlock_victim_self';
INSERT INTO t1(col2) VALUES(200);
ERROR HY000: Failed to read auto-increment value from storage engine
# The transaction should have been rolled back
SELECT * FROM t1;
col1 col2
1 100
SELECT * FROM t2;
col1
# Release the previous savepoint using the same name
SAVEPOINT s1;
COMMIT;
connection con2;
COMMIT;
connection default;
COMMIT;
disconnect con1;
disconnect con2;
# Cleanup
SELECT * FROM t1;
col1 col2
1 100
2 100
DROP TABLE t1;
SELECT * FROM t2;
col1
100
DROP TABLE t2;
SET DEBUG_SYNC='RESET';
#
# End of 10.5 tests
#

View File

@ -1,10 +0,0 @@
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
SET @saved_debug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
BEGIN;
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
COMMIT;
SET debug_dbug = @saved_debug;
DROP TABLE t1;
FOUND 1 /InnoDB: Difficult to find free blocks / in mysqld.1.err

View File

@ -37,7 +37,7 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK test.t1 analyze status OK
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
CLUST_INDEX_SIZE CLUST_INDEX_SIZE
1856 1792
connection con2; connection con2;
DELETE FROM t1 WHERE a00 = 'cnm'; DELETE FROM t1 WHERE a00 = 'cnm';
COMMIT; COMMIT;
@ -80,7 +80,7 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK test.t1 analyze status OK
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
CLUST_INDEX_SIZE CLUST_INDEX_SIZE
1856 1792
DELETE FROM t1 WHERE a00 = 'dpn'; DELETE FROM t1 WHERE a00 = 'dpn';
COMMIT; COMMIT;
INSERT INTO t1 SET a00 = 'dpn'; INSERT INTO t1 SET a00 = 'dpn';
@ -117,6 +117,6 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK test.t1 analyze status OK
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1'; SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
CLUST_INDEX_SIZE CLUST_INDEX_SIZE
1856 1792
SET DEBUG_SYNC = 'RESET'; SET DEBUG_SYNC = 'RESET';
DROP TABLE t1; DROP TABLE t1;

View File

@ -431,10 +431,6 @@ a
connection con1; connection con1;
begin work; begin work;
insert into t1 values (5); insert into t1 values (5);
select * from t1;
a
1
5
insert into t1 values (2); insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1; select * from t1;
@ -509,10 +505,6 @@ a
connection con1; connection con1;
begin work; begin work;
insert into t1 values (5); insert into t1 values (5);
select * from t1;
a
1
5
insert into t1 values (2); insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1; select * from t1;
@ -1217,10 +1209,6 @@ a
connection con1; connection con1;
begin work; begin work;
insert into t1 values (5); insert into t1 values (5);
select * from t1;
a
1
5
insert into t1 values (2); insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1; select * from t1;

View File

@ -86,7 +86,6 @@ buffer_flush_n_to_flush_by_age buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NUL
buffer_flush_adaptive_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Avg time (ms) spent for adaptive flushing recently. buffer_flush_adaptive_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Avg time (ms) spent for adaptive flushing recently.
buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of adaptive flushes passed during the recent Avg period. buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of adaptive flushes passed during the recent Avg period.
buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Total loops in LRU get free. buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Total loops in LRU get free.
buffer_LRU_get_free_waits buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Total sleep waits in LRU get free.
buffer_flush_avg_page_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average number of pages at which flushing is happening buffer_flush_avg_page_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average number of pages at which flushing is happening
buffer_flush_lsn_avg_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average redo generation rate buffer_flush_lsn_avg_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average redo generation rate
buffer_flush_pct_for_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Percent of IO capacity used to avoid max dirty page limit buffer_flush_pct_for_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Percent of IO capacity used to avoid max dirty page limit
@ -106,7 +105,6 @@ buffer_LRU_batch_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NUL
buffer_LRU_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages scanned per LRU batch call buffer_LRU_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages scanned per LRU batch call
buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages flushed as part of LRU batches buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages flushed as part of LRU batches
buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages evicted as part of LRU batches buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages evicted as part of LRU batches
buffer_LRU_single_flush_failure_count Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times attempt to flush a single page from LRU failed
buffer_LRU_get_free_search Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of searches performed for a clean page buffer_LRU_get_free_search Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of searches performed for a clean page
buffer_LRU_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU search buffer_LRU_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU search
buffer_LRU_search_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of times LRU search is performed buffer_LRU_search_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of times LRU search is performed

View File

@ -174,3 +174,10 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5;
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-33462 Disallow LOCK=NONE operation on statistics table
#
ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_table_stats. Try LOCK=SHARED
ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_index_stats. Try LOCK=SHARED

View File

@ -17,10 +17,6 @@ a
connection con1; connection con1;
begin work; begin work;
insert into t1 values (5); insert into t1 values (5);
select * from t1;
a
1
5
insert into t1 values (2); insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1; select * from t1;

View File

@ -202,27 +202,3 @@ Table Op Msg_type Msg_text
test.t2 check status OK test.t2 check status OK
DROP TABLE t1,t2; DROP TABLE t1,t2;
db.opt db.opt
#
# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
# ADD PRIMARY KEY or OPTIMIZE TABLE
#
CREATE TABLE t1(f1 year default null, f2 year default null,
f3 text, f4 year default null, f5 year default null,
f6 year default null, f7 year default null,
f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
connect con1,localhost,root,,,;
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
SET DEBUG_SYNC="now SIGNAL con1_finish";
connection default;
disconnect con1;
SET DEBUG_SYNC=RESET;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;

View File

@ -2,7 +2,7 @@
FROM information_schema.global_status FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column'; WHERE variable_name = 'innodb_instant_alter_column';
instants instants
-35 -37
+36 +38
SET GLOBAL innodb_stats_persistent = @save_stats_persistent; SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
# End of 10.6 tests # End of 10.6 tests

View File

@ -477,10 +477,59 @@ SET DEBUG_SYNC="now WAIT_FOR try_insert";
INSERT INTO t1 VALUES(1, 2); INSERT INTO t1 VALUES(1, 2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC="now SIGNAL alter_progress"; SET DEBUG_SYNC="now SIGNAL alter_progress";
disconnect con1;
connection default; connection default;
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
# ADD PRIMARY KEY or OPTIMIZE TABLE
#
CREATE TABLE t1(f1 year default null, f2 year default null,
f3 text, f4 year default null, f5 year default null,
f6 year default null, f7 year default null,
f8 year default null)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
ALTER TABLE t1 ADD COLUMN f10 YEAR DEFAULT NULL, FORCE, ALGORITHM=INPLACE;
connection con1;
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
SET DEBUG_SYNC="now SIGNAL con1_finish";
connection default;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
#
# MDEV-19044 Alter table corrupts while applying the
# modification log
#
CREATE TABLE t1 (
f1 INT,
f2 INT,
f3 char(19) CHARACTER SET utf8mb3,
f4 VARCHAR(500),
f5 TEXT)ENGINE=InnoDB;
INSERT INTO t1 VALUES(3, 1, REPEAT('a', 2), REPEAT("b", 20),'a');
ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INSTANT;
INSERT INTO t1 VALUES(1, 2, REPEAT('InnoDB', 2),
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
INSERT INTO t1 VALUES(1, 2, REPEAT('MYSQL', 2),
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL con1_begin WAIT_FOR con1_update';
ALTER TABLE t1 MODIFY COLUMN f2 INT NOT NULL, FORCE, ALGORITHM=INPLACE;
connection con1;
SET DEBUG_SYNC='now WAIT_FOR con1_begin';
UPDATE t1 SET f2=204 order by f1 limit 2;
SET DEBUG_SYNC='now SIGNAL con1_update';
connection default;
disconnect con1;
SET DEBUG_SYNC=reset; SET DEBUG_SYNC=reset;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
# End of 10.4 tests # End of 10.4 tests
# #
# MDEV-22867 Assertion instant.n_core_fields == n_core_fields # MDEV-22867 Assertion instant.n_core_fields == n_core_fields
@ -525,6 +574,6 @@ SELECT variable_value-@old_instant instants
FROM information_schema.global_status FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column'; WHERE variable_name = 'innodb_instant_alter_column';
instants instants
35 37
SET GLOBAL innodb_stats_persistent = @save_stats_persistent; SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
# End of 10.6 tests # End of 10.6 tests

View File

@ -47,6 +47,9 @@ CREATE TABLE t1 (k INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SET k=1; INSERT INTO t1 SET k=1;
START TRANSACTION; START TRANSACTION;
INSERT INTO t1 SET k=2; INSERT INTO t1 SET k=2;
SELECT count(*) > 0 FROM mysql.innodb_index_stats lock in share mode;
count(*) > 0
1
connect con1,localhost,root,,test; connect con1,localhost,root,,test;
SET innodb_lock_wait_timeout=0; SET innodb_lock_wait_timeout=0;
CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
@ -54,4 +57,6 @@ AS SELECT k FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con1; disconnect con1;
connection default; connection default;
SET innodb_lock_wait_timeout=default;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE IF EXISTS t2;

View File

@ -0,0 +1,108 @@
#
# MDEV-26642 Weird SELECT view when a record is
# modified to the same value by two transactions
# MDEV-32898 Phantom rows caused by updates of PRIMARY KEY
#
CREATE TABLE t(a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t VALUES (1,1),(2,2);
BEGIN;
SELECT * FROM t LOCK IN SHARE MODE;
a b
1 1
2 2
connect con_weird,localhost,root;
BEGIN;
SELECT * FROM t;
a b
1 1
2 2
connect consistent,localhost,root;
SET innodb_snapshot_isolation=ON;
BEGIN;
SELECT * FROM t;
a b
1 1
2 2
connection default;
UPDATE t SET a=3 WHERE b=2;
COMMIT;
connection consistent;
UPDATE t SET b=3;
ERROR HY000: Record has changed since last read in table 't'
SELECT * FROM t;
a b
1 1
3 2
COMMIT;
connection con_weird;
UPDATE t SET b=3;
SELECT * FROM t;
a b
1 3
2 2
3 3
COMMIT;
connection default;
SELECT * FROM t;
a b
1 3
3 3
DROP TABLE t;
#
# MDEV-26643 Inconsistent behaviors of UPDATE under
# READ UNCOMMITTED and READ COMMITTED isolation level
#
CREATE TABLE t(a INT, b INT) ENGINE=InnoDB;
INSERT INTO t VALUES(NULL, 1), (2, 2);
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
BEGIN;
UPDATE t SET a = 10;
connection consistent;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
UPDATE t SET b = 20 WHERE a;
connection default;
COMMIT;
connection consistent;
SELECT * FROM t;
a b
10 20
10 20
connection default;
TRUNCATE TABLE t;
INSERT INTO t VALUES(NULL, 1), (2, 2);
BEGIN;
UPDATE t SET a = 10;
connection consistent;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
UPDATE t SET b = 20 WHERE a;
connection default;
COMMIT;
connection consistent;
SELECT * FROM t;
a b
10 20
10 20
disconnect consistent;
connection default;
TRUNCATE TABLE t;
INSERT INTO t VALUES(NULL, 1), (2, 2);
BEGIN;
UPDATE t SET a = 10;
connection con_weird;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
UPDATE t SET b = 20 WHERE a;
connection default;
SELECT * FROM t;
a b
10 1
10 2
COMMIT;
connection con_weird;
COMMIT;
disconnect con_weird;
connection default;
SELECT * FROM t;
a b
10 1
10 20
DROP TABLE t;

View File

@ -0,0 +1,12 @@
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
call mtr.add_suppression("InnoDB: Tablespace size stored in header is 768 pages, but the sum of data file sizes is 384 pages");
call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# restart
# End of 10.5 tests

View File

@ -51,7 +51,6 @@ buffer_flush_n_to_flush_by_age disabled
buffer_flush_adaptive_avg_time disabled buffer_flush_adaptive_avg_time disabled
buffer_flush_adaptive_avg_pass disabled buffer_flush_adaptive_avg_pass disabled
buffer_LRU_get_free_loops disabled buffer_LRU_get_free_loops disabled
buffer_LRU_get_free_waits disabled
buffer_flush_avg_page_rate disabled buffer_flush_avg_page_rate disabled
buffer_flush_lsn_avg_rate disabled buffer_flush_lsn_avg_rate disabled
buffer_flush_pct_for_dirty disabled buffer_flush_pct_for_dirty disabled
@ -71,7 +70,6 @@ buffer_LRU_batch_num_scan disabled
buffer_LRU_batch_scanned_per_call disabled buffer_LRU_batch_scanned_per_call disabled
buffer_LRU_batch_flush_total_pages enabled buffer_LRU_batch_flush_total_pages enabled
buffer_LRU_batch_evict_total_pages enabled buffer_LRU_batch_evict_total_pages enabled
buffer_LRU_single_flush_failure_count disabled
buffer_LRU_get_free_search disabled buffer_LRU_get_free_search disabled
buffer_LRU_search_scanned disabled buffer_LRU_search_scanned disabled
buffer_LRU_search_num_scan disabled buffer_LRU_search_num_scan disabled

View File

@ -21,11 +21,17 @@ path
DROP DATABASE abc_def; DROP DATABASE abc_def;
# restart # restart
DROP DATABASE abc_def2; DROP DATABASE abc_def2;
call mtr.add_suppression("InnoDB: (Operating system error|Error number \\d+ means|Cannot rename file)"); call mtr.add_suppression("InnoDB: Cannot rename '.*t1.ibd' to '.*non_existing_db.*' because the target schema directory doesn't exist");
CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES(100);
RENAME TABLE t1 TO non_existing_db.t1; RENAME TABLE t1 TO non_existing_db.t1;
ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: 168 "Unknown (generic) error from engine") ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: 168 "Unknown (generic) error from engine")
FOUND 1 /\[ERROR\] InnoDB: Cannot rename file '.*t1\.ibd' to '.*non_existing_db/ in mysqld.1.err FOUND 1 /\[ERROR\] InnoDB: Cannot rename '.*t1\.ibd' to '.*non_existing_db/ in mysqld.1.err
SET GLOBAL innodb_fast_shutdown=2;
# restart
SELECT * FROM t1;
a
100
DROP TABLE t1; DROP TABLE t1;
# #
# MDEV-25509 Atomic DDL: Assertion `err != DB_DUPLICATE_KEY' # MDEV-25509 Atomic DDL: Assertion `err != DB_DUPLICATE_KEY'

View File

@ -57,7 +57,7 @@ ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX
connection default; connection default;
SET DEBUG_SYNC='now WAIT_FOR hung'; SET DEBUG_SYNC='now WAIT_FOR hung';
let $shutdown_timeout=0; let $shutdown_timeout=0;
--let $restart_parameters= --innodb-force-recovery=3 --debug_dbug="+d,recv_ran_out_of_buffer" --let $restart_parameters= --innodb-force-recovery=3
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
disconnect hang; disconnect hang;
let $shutdown_timeout=; let $shutdown_timeout=;

View File

@ -92,3 +92,69 @@ SELECT * FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
DROP TABLE t1; DROP TABLE t1;
SET DEBUG_SYNC='RESET'; SET DEBUG_SYNC='RESET';
--echo #
--echo # MDEV-33593: Auto increment deadlock error causes ASSERT in subsequent save point
--echo #
CREATE TABLE t1(col1 INT PRIMARY KEY AUTO_INCREMENT, col2 INT) ENGINE=InnoDB;
CREATE TABLE t2(col1 INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1(col2) values(100);
--connect(con1, localhost, root,,)
START TRANSACTION;
--echo # T1: Acquiring Row X lock on table t2
INSERT INTO t2 values(100);
--connect(con2, localhost, root,,)
START TRANSACTION;
--echo # T2: Wait for (T1) row lock on t2 after acquiring GAP Lock on t1
UPDATE t1 SET col2 = 20 where col1 = 10;
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t2_waiting';
--send INSERT INTO t2 values(100)
--connection default
SET DEBUG_SYNC='now WAIT_FOR t2_waiting';
--echo # T3: Wait for (T2) II row Lock on t1 after acquiring Auto Increment Lock on t1
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t3_waiting';
--send INSERT INTO t1(col2) SELECT col2 from t1
--connection con1
SAVEPOINT s1;
SET DEBUG_SYNC='now WAIT_FOR t3_waiting';
--echo # T1: Wait for (T3) auto increment lock on t1 causing T1 -> T3 -> T2 -> T1 deadlock
SET debug_dbug = '+d,innodb_deadlock_victim_self';
--error ER_AUTOINC_READ_FAILED
INSERT INTO t1(col2) VALUES(200);
--echo # The transaction should have been rolled back
SELECT * FROM t1;
SELECT * FROM t2;
--echo # Release the previous savepoint using the same name
SAVEPOINT s1;
COMMIT;
--connection con2
--reap
COMMIT;
--connection default
--reap
COMMIT;
--disconnect con1
--disconnect con2
--echo # Cleanup
SELECT * FROM t1;
DROP TABLE t1;
SELECT * FROM t2;
DROP TABLE t2;
SET DEBUG_SYNC='RESET';
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -1,24 +0,0 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
SET @saved_debug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
BEGIN;
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
COMMIT;
SET debug_dbug = @saved_debug;
DROP TABLE t1;
#
# There should be only one message
#
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
--let SEARCH_PATTERN=InnoDB: Difficult to find free blocks
--source include/search_pattern_in_file.inc

View File

@ -96,3 +96,11 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-33462 Disallow LOCK=NONE operation on statistics table
--echo #
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;

View File

@ -230,29 +230,3 @@ CHECK TABLE t2;
DROP TABLE t1,t2; DROP TABLE t1,t2;
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
--echo #
--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
--echo # ADD PRIMARY KEY or OPTIMIZE TABLE
--echo #
CREATE TABLE t1(f1 year default null, f2 year default null,
f3 text, f4 year default null, f5 year default null,
f6 year default null, f7 year default null,
f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
send ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
connect(con1,localhost,root,,,);
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
SET DEBUG_SYNC="now SIGNAL con1_finish";
connection default;
reap;
disconnect con1;
SET DEBUG_SYNC=RESET;
CHECK TABLE t1;
DROP TABLE t1;

View File

@ -551,11 +551,62 @@ SET DEBUG_SYNC="now WAIT_FOR try_insert";
--error ER_LOCK_WAIT_TIMEOUT --error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1 VALUES(1, 2); INSERT INTO t1 VALUES(1, 2);
SET DEBUG_SYNC="now SIGNAL alter_progress"; SET DEBUG_SYNC="now SIGNAL alter_progress";
disconnect con1;
connection default; connection default;
reap; reap;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
--echo # ADD PRIMARY KEY or OPTIMIZE TABLE
--echo #
CREATE TABLE t1(f1 year default null, f2 year default null,
f3 text, f4 year default null, f5 year default null,
f6 year default null, f7 year default null,
f8 year default null)ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
send ALTER TABLE t1 ADD COLUMN f10 YEAR DEFAULT NULL, FORCE, ALGORITHM=INPLACE;
connection con1;
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
SET DEBUG_SYNC="now SIGNAL con1_finish";
connection default;
reap;
CHECK TABLE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-19044 Alter table corrupts while applying the
--echo # modification log
--echo #
CREATE TABLE t1 (
f1 INT,
f2 INT,
f3 char(19) CHARACTER SET utf8mb3,
f4 VARCHAR(500),
f5 TEXT)ENGINE=InnoDB;
INSERT INTO t1 VALUES(3, 1, REPEAT('a', 2), REPEAT("b", 20),'a');
ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INSTANT;
INSERT INTO t1 VALUES(1, 2, REPEAT('InnoDB', 2),
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
INSERT INTO t1 VALUES(1, 2, REPEAT('MYSQL', 2),
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL con1_begin WAIT_FOR con1_update';
send ALTER TABLE t1 MODIFY COLUMN f2 INT NOT NULL, FORCE, ALGORITHM=INPLACE;
connection con1;
SET DEBUG_SYNC='now WAIT_FOR con1_begin';
UPDATE t1 SET f2=204 order by f1 limit 2;
SET DEBUG_SYNC='now SIGNAL con1_update';
connection default;
reap;
disconnect con1;
SET DEBUG_SYNC=reset; SET DEBUG_SYNC=reset;
CHECK TABLE t1;
DROP TABLE t1;
--echo # End of 10.4 tests --echo # End of 10.4 tests

View File

@ -51,6 +51,7 @@ CREATE TABLE t1 (k INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SET k=1; INSERT INTO t1 SET k=1;
START TRANSACTION; START TRANSACTION;
INSERT INTO t1 SET k=2; INSERT INTO t1 SET k=2;
SELECT count(*) > 0 FROM mysql.innodb_index_stats lock in share mode;
--connect (con1,localhost,root,,test) --connect (con1,localhost,root,,test)
SET innodb_lock_wait_timeout=0; SET innodb_lock_wait_timeout=0;
@ -59,5 +60,6 @@ CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
AS SELECT k FROM t1; AS SELECT k FROM t1;
--disconnect con1 --disconnect con1
--connection default --connection default
SET innodb_lock_wait_timeout=default;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE IF EXISTS t2;

View File

@ -0,0 +1,110 @@
--source include/have_innodb.inc
--echo #
--echo # MDEV-26642 Weird SELECT view when a record is
--echo # modified to the same value by two transactions
--echo # MDEV-32898 Phantom rows caused by updates of PRIMARY KEY
--echo #
CREATE TABLE t(a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t VALUES (1,1),(2,2);
BEGIN; SELECT * FROM t LOCK IN SHARE MODE;
--connect con_weird,localhost,root
BEGIN;
SELECT * FROM t;
--connect consistent,localhost,root
SET innodb_snapshot_isolation=ON;
BEGIN;
SELECT * FROM t;
--connection default
UPDATE t SET a=3 WHERE b=2;
COMMIT;
--connection consistent
--error ER_CHECKREAD
UPDATE t SET b=3;
SELECT * FROM t;
COMMIT;
--connection con_weird
UPDATE t SET b=3;
SELECT * FROM t;
COMMIT;
--connection default
SELECT * FROM t;
DROP TABLE t;
--echo #
--echo # MDEV-26643 Inconsistent behaviors of UPDATE under
--echo # READ UNCOMMITTED and READ COMMITTED isolation level
--echo #
CREATE TABLE t(a INT, b INT) ENGINE=InnoDB;
INSERT INTO t VALUES(NULL, 1), (2, 2);
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
BEGIN; UPDATE t SET a = 10;
--connection consistent
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--send UPDATE t SET b = 20 WHERE a
--connection default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = 'Updating'
and info = 'UPDATE t SET b = 20 WHERE a';
--source include/wait_condition.inc
COMMIT;
--connection consistent
--reap
SELECT * FROM t;
--connection default
TRUNCATE TABLE t;
INSERT INTO t VALUES(NULL, 1), (2, 2);
BEGIN; UPDATE t SET a = 10;
--connection consistent
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
--send UPDATE t SET b = 20 WHERE a
--connection default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where info = 'UPDATE t SET b = 20 WHERE a';
--source include/wait_condition.inc
COMMIT;
--connection consistent
--reap
SELECT * FROM t;
--disconnect consistent
--connection default
TRUNCATE TABLE t;
INSERT INTO t VALUES(NULL, 1), (2, 2);
BEGIN; UPDATE t SET a = 10;
--connection con_weird
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
send UPDATE t SET b = 20 WHERE a;
--connection default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = 'Updating'
and info = 'UPDATE t SET b = 20 WHERE a';
--source include/wait_condition.inc
SELECT * FROM t;
COMMIT;
--connection con_weird
--reap
COMMIT;
--disconnect con_weird
--connection default
SELECT * FROM t;
DROP TABLE t;

View File

@ -0,0 +1,91 @@
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_embedded.inc
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
call mtr.add_suppression("InnoDB: Tablespace size stored in header is 768 pages, but the sum of data file sizes is 384 pages");
call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
--source include/shutdown_mysqld.inc
let bugdir= $MYSQLTEST_VARDIR/tmp/log_upgrade;
--mkdir $bugdir
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
# Test case similar to log_upgrade.test
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
my $polynomial = 0x82f63b78; # CRC-32C
die unless open OUT, ">", "$ENV{bugdir}/ibdata1";
binmode OUT;
my $head = pack("Nx[18]", 0);
# Add FSP_SPACE_FLAGS as 49152 (10.1.0...10.1.20), page_size = 32k
my $body = pack("x[8]Nx[4]Nx[2]Nx[32696]", 768, 49152, 97937874);
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
# Dummy pages 1..6.
print OUT chr(0) x (6 * 32768);
# Dictionary header page (page 7).
$head = pack("Nx[18]", 7);
$body = pack("x[32]Nx[8]Nx[32674]", 8, 9);
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
# Empty SYS_TABLES page (page 8).
$head = pack("NNNx[8]n", 8, ~0, ~0, 17855);
$body = pack("nnx[31]Cx[20]", 2, 124, 1);
$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
$body .= pack("x[32632]nn", 116, 101);
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
# Empty SYS_INDEXES page (page 9).
$head = pack("NNNx[8]n", 9, ~0, ~0, 17855);
$body = pack("nnx[31]Cx[20]", 2, 124, 3);
$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
$body .= pack("x[32632]nn", 116, 101);
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
die unless seek(OUT, 768 * 16384 - 1, 0);
print OUT chr(0);
close OUT or die;
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile0";
binmode OUT;
$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478;
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
# checkpoint page 1 and all-zero checkpoint 2
$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c);
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
die unless seek(OUT, 0x1FFFFFFFF, 0);
print OUT chr(0);
close OUT or die;
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
binmode OUT;
die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused!
$_= pack("Nnnx[500]", 0x80000944, 12, 12);
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
die unless seek(OUT, 0x1FFFFFFFF, 0);
print OUT chr(0);
close OUT or die;
EOF
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
--source include/search_pattern_in_file.inc
--let $restart_parameters= $dirs
--remove_files_wildcard $bugdir
--rmdir $bugdir
--let $restart_parameters=
--source include/start_mysqld.inc
--echo # End of 10.5 tests

View File

@ -4,10 +4,6 @@
SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent; SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = 0; SET GLOBAL innodb_stats_persistent = 0;
--disable_query_log
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
--enable_query_log
CREATE TABLE t1 ( CREATE TABLE t1 (
a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false, a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false,
l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689, l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689,

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