diff --git a/.github/workflows/windows-arm64.yml b/.github/workflows/windows-arm64.yml index 78f3628a105..a061849cc25 100644 --- a/.github/workflows/windows-arm64.yml +++ b/.github/workflows/windows-arm64.yml @@ -54,4 +54,4 @@ jobs: $cidir = "$tmp/ci" mkdir $cidir fsutil file setCaseSensitiveInfo $cidir enable - perl bld\mysql-test\mysql-test-run.pl --force --parallel=$parallel --suite=main,innodb --vardir=$cidir/var --mysqld=--lower-case-table-names=0 --mysqld=--loose-innodb-flush-log-at-trx-commit=2 + perl bld\mysql-test\mysql-test-run.pl --force --parallel=$parallel --suite=main,innodb --vardir=$cidir/var --mysqld=--lower-case-table-names=0 --mysqld=--loose-innodb-flush-log-at-trx-commit=2 --mysqld=--debug-no-sync diff --git a/CMakeLists.txt b/CMakeLists.txt index 560e7b87d33..4fd13329022 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,9 +296,13 @@ IF(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -D_GLIBCXX_ASSERTIONS") ENDIF() -OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF) +OPTION(ENABLE_GCOV "Enable gcov (debug, macOS and Linux builds only)" OFF) IF (ENABLE_GCOV) - MY_CHECK_AND_SET_COMPILER_FLAG("-DHAVE_gcov -fprofile-arcs -ftest-coverage -lgcov" DEBUG) + IF (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + MY_CHECK_AND_SET_COMPILER_FLAG("--coverage" DEBUG) + ELSE() + MY_CHECK_AND_SET_COMPILER_FLAG("-DHAVE_gcov -fprofile-arcs -ftest-coverage -lgcov" DEBUG) + ENDIF() ENDIF() OPTION(WITHOUT_PACKED_SORT_KEYS "disable packed sort keys" OFF) diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index cad94a64193..282800a3285 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -286,6 +286,7 @@ FUNCTION(INSTALL_RUNTIME_DEPS) POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" # Windows stuff POST_INCLUDE_REGEXES + "libssl" "libcrypto" # Account for OpenSSL libraries in system32 DIRECTORIES $<$:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin $<$,$>:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin> diff --git a/cmake/libfmt.cmake b/cmake/libfmt.cmake index 47f2e00bae1..0eda394a4dc 100644 --- a/cmake/libfmt.cmake +++ b/cmake/libfmt.cmake @@ -15,8 +15,8 @@ MACRO(BUNDLE_LIBFMT) ExternalProject_Add( libfmt PREFIX "${dir}" - URL "https://github.com/fmtlib/fmt/releases/download/11.1.4/fmt-11.1.4.zip" - URL_MD5 ad6a56b15cddf4aad2a234e7cfc9e8c9 + URL "https://github.com/fmtlib/fmt/releases/download/12.0.0/fmt-12.0.0.zip" + URL_MD5 9bd04e6e8c5b1733e4eefb473604219d INSTALL_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/debian/mariadb-server.links b/debian/mariadb-server.links new file mode 100644 index 00000000000..40b0b80a143 --- /dev/null +++ b/debian/mariadb-server.links @@ -0,0 +1,6 @@ +#!/usr/bin/dh-exec +usr/lib/${DEB_HOST_MULTIARCH}/libmariadb3/plugin/caching_sha2_password.so usr/lib/mysql/plugin/caching_sha2_password.so +usr/lib/${DEB_HOST_MULTIARCH}/libmariadb3/plugin/client_ed25519.so usr/lib/mysql/plugin/client_ed25519.so +usr/lib/${DEB_HOST_MULTIARCH}/libmariadb3/plugin/dialog.so usr/lib/mysql/plugin/dialog.so +usr/lib/${DEB_HOST_MULTIARCH}/libmariadb3/plugin/mysql_clear_password.so usr/lib/mysql/plugin/mysql_clear_password.so +usr/lib/${DEB_HOST_MULTIARCH}/libmariadb3/plugin/sha256_password.so usr/lib/mysql/plugin/sha256_password.so diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index 8d33ae3d63e..c6e30c6312b 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -51,7 +51,6 @@ The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */ #include "page0zip.h" /* page_zip_*() */ #include "trx0undo.h" /* TRX_* */ #include "fil0crypt.h" /* fil_space_verify_crypt_checksum */ - #include #ifndef PRIuMAX @@ -74,6 +73,8 @@ static ulint extent_size; static ulint xdes_size; ulong srv_page_size; uint32_t srv_page_size_shift; +static uint32_t dblwr_1; +static uint32_t dblwr_2; /* Current page number (0 based). */ uint32_t cur_page_num; /* Current space. */ @@ -97,8 +98,10 @@ FILE* log_file = NULL; /* Enabled for log write option. */ static bool is_log_enabled = false; static bool skip_freed_pages; +static uint32_t tablespace_flags= 0; static byte field_ref_zero_buf[UNIV_PAGE_SIZE_MAX]; const byte *field_ref_zero = field_ref_zero_buf; +constexpr uint32_t USE_FSP_FLAGS{UINT32_MAX}; #ifndef _WIN32 /* advisory lock for non-window system. */ @@ -253,12 +256,9 @@ void print_leaf_stats( } /** Init the page size for the tablespace. -@param[in] buf buffer used to read the page */ -static void init_page_size(const byte* buf) +@param[in] flags InnoDB tablespace flags */ +static void init_page_size_from_flags(const uint32_t flags) { - const unsigned flags = mach_read_from_4(buf + FIL_PAGE_DATA - + FSP_SPACE_FLAGS); - if (fil_space_t::full_crc32(flags)) { const uint32_t ssize = FSP_FLAGS_FCRC32_GET_PAGE_SSIZE(flags); srv_page_size_shift = UNIV_ZIP_SIZE_SHIFT_MIN - 1 + ssize; @@ -540,24 +540,15 @@ static bool is_page_corrupted(byte *buf, bool is_encrypted, uint32_t flags) return(is_corrupted); } -/********************************************//* - Check if page is doublewrite buffer or not. - @param [in] page buffer page - - @retval true if page is doublewrite buffer otherwise false. -*/ -static -bool -is_page_doublewritebuffer( - const byte* page) +/** Check if page is doublewrite buffer or not. +@retval true if page is doublewrite buffer otherwise false. */ +static bool is_page_doublewritebuffer() { - if ((cur_page_num >= extent_size) - && (cur_page_num < extent_size * 3)) { - /* page is doublewrite buffer. */ - return (true); - } - - return (false); + if (cur_space != 0) return false; + const uint32_t extent{static_cast( + cur_page_num & ~(extent_size - 1))}; + return cur_page_num > FSP_DICT_HDR_PAGE_NO && + extent && (extent == dblwr_1 || extent == dblwr_2); } /*******************************************************//* @@ -764,7 +755,7 @@ Parse the page and collect/dump the information about page type @param [in] file file for diagnosis. @param [in] is_encrypted tablespace is encrypted */ -void +static void parse_page( const byte* page, byte* xdes, @@ -784,6 +775,12 @@ parse_page( str = skip_page ? "Double_write_buffer" : "-"; page_no = mach_read_from_4(page + FIL_PAGE_OFFSET); if (skip_freed_pages) { + + /** Skip doublewrite pages when -r is enabled */ + if (is_page_doublewritebuffer()) { + return; + } + const byte *des= xdes + XDES_ARR_OFFSET + xdes_size * ((page_no & (physical_page_size - 1)) / extent_size); @@ -978,6 +975,18 @@ parse_page( fprintf(file, "#::" UINT32PF "\t\t|\t\tTransaction system " "page\t\t|\t%s\n", cur_page_num, str); } + + if (cur_space == 0 && + (mach_read_from_4(page + TRX_SYS_DOUBLEWRITE + + TRX_SYS_DOUBLEWRITE_MAGIC) == + TRX_SYS_DOUBLEWRITE_MAGIC_N)) { + dblwr_1 = mach_read_from_4( + page + TRX_SYS_DOUBLEWRITE + + TRX_SYS_DOUBLEWRITE_BLOCK1); + dblwr_2 = mach_read_from_4( + page + TRX_SYS_DOUBLEWRITE + + TRX_SYS_DOUBLEWRITE_BLOCK2); + } break; case FIL_PAGE_TYPE_FSP_HDR: @@ -1220,6 +1229,9 @@ static struct my_option innochecksum_options[] = { {"skip-freed-pages", 'r', "skip freed pages for the tablespace", &skip_freed_pages, &skip_freed_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"tablespace-flags", 0, "InnoDB tablespace flags (default: 4294967295 " + "= read from page 0)", &tablespace_flags, &tablespace_flags, 0, + GET_UINT, REQUIRED_ARG, USE_FSP_FLAGS, 0, USE_FSP_FLAGS, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -1280,6 +1292,14 @@ innochecksum_get_one_option( my_end(0); exit(EXIT_SUCCESS); break; + default: + if (tablespace_flags != USE_FSP_FLAGS && + !fil_space_t::is_valid_flags(tablespace_flags, false) && + !fil_space_t::is_valid_flags(tablespace_flags, true)) { + fprintf(stderr, "Error: Provided --tablespace-flags " + "is not valid."); + return true; + } } return(false); @@ -1410,6 +1430,87 @@ rewrite_checksum( && !write_file(filename, fil_in, buf, flags, pos); } +/** Read and validate page 0, then initialize tablespace flags +and page size. +@param fil_in File pointer +@param buf Buffer to read page into +@return whether the page was read successfully */ +static bool read_and_validate_page0(FILE *fil_in, byte *buf) +{ + /* Read the minimum page size first */ + size_t initial_page_size= UNIV_ZIP_SIZE_MIN; + if (tablespace_flags != USE_FSP_FLAGS) + { + init_page_size_from_flags(tablespace_flags); + initial_page_size= physical_page_size; + } + + /* Read just enough to get the tablespace flags */ + size_t bytes= fread(buf, 1, initial_page_size, fil_in); + + if (bytes != initial_page_size) + { + fprintf(stderr, "Error: Was not able to read the " + "minimum page size of %zu bytes. Bytes read " + "was %zu\n", initial_page_size, bytes); + return false; + } + + /* Read space_id and page offset */ + cur_space= mach_read_from_4(buf + FIL_PAGE_SPACE_ID); + cur_page_num= mach_read_from_4(buf + FIL_PAGE_OFFSET); + + /* Get tablespace flags from the FSP header */ + uint32_t flags= mach_read_from_4(buf + FSP_HEADER_OFFSET + + FSP_SPACE_FLAGS); + + if (tablespace_flags != USE_FSP_FLAGS) + { + if (cur_page_num == 0 && flags != tablespace_flags) + fprintf(stderr, "Error: Mismatch between provided tablespace " + "flags (0x%x) and file flags (0x%x)\n", + tablespace_flags, flags); + } + else + { + if (cur_page_num) + { + fprintf(stderr, "Error: First page of the tablespace file " + "should be 0, but encountered page number %" PRIu32 ". " + "If you are checking multi file system " + "tablespace files, please specify the correct " + "tablespace flags using --tablespace-flags option.\n", + cur_page_num); + return false; + } + /* Initialize page size parameters based on flags */ + init_page_size_from_flags(flags); + /* Read the rest of the page if it's larger than the minimum size */ + if (physical_page_size > UNIV_ZIP_SIZE_MIN) + { + /* Read rest of the page 0 to determine crypt_data */ + ulint bytes= read_file(buf, true, physical_page_size, fil_in); + if (bytes != physical_page_size) + { + fprintf(stderr, "Error: Was not able to read the rest of the " + "page of " ULINTPF " bytes. Bytes read was " ULINTPF "\n", + physical_page_size - UNIV_ZIP_SIZE_MIN, bytes); + return false; + } + } + tablespace_flags= flags; + } + + if (physical_page_size < UNIV_ZIP_SIZE_MIN || + physical_page_size > UNIV_PAGE_SIZE_MAX) + { + fprintf(stderr, "Error: Invalid page size " ULINTPF + " encountered\n", physical_page_size); + return false; + } + return true; +} + int main( int argc, char **argv) @@ -1545,51 +1646,13 @@ int main( } } - /* Read the minimum page size. */ - bytes = fread(buf, 1, UNIV_ZIP_SIZE_MIN, fil_in); - partial_page_read = true; - - if (bytes != UNIV_ZIP_SIZE_MIN) { - fprintf(stderr, "Error: Was not able to read the " - "minimum page size "); - fprintf(stderr, "of %d bytes. Bytes read was " ULINTPF "\n", - UNIV_ZIP_SIZE_MIN, bytes); - + /* Read and validate page 0 */ + if (!read_and_validate_page0(fil_in, buf)) { exit_status = 1; goto my_exit; } - /* enable variable is_system_tablespace when space_id of given - file is zero. Use to skip the checksum verification and rewrite - for doublewrite pages. */ - cur_space = mach_read_from_4(buf + FIL_PAGE_SPACE_ID); - cur_page_num = mach_read_from_4(buf + FIL_PAGE_OFFSET); - - /* Determine page size, zip_size and page compression - from fsp_flags and encryption metadata from page 0 */ - init_page_size(buf); - - uint32_t flags = mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + buf); - - if (physical_page_size == UNIV_ZIP_SIZE_MIN) { - partial_page_read = false; - } else { - /* Read rest of the page 0 to determine crypt_data */ - bytes = read_file(buf, partial_page_read, physical_page_size, fil_in); - if (bytes != physical_page_size) { - fprintf(stderr, "Error: Was not able to read the " - "rest of the page "); - fprintf(stderr, "of " ULINTPF " bytes. Bytes read was " ULINTPF "\n", - physical_page_size - UNIV_ZIP_SIZE_MIN, bytes); - - exit_status = 1; - goto my_exit; - } - partial_page_read = false; - } - - - /* Now that we have full page 0 in buffer, check encryption */ + /* Check if tablespace is encrypted */ bool is_encrypted = check_encryption(filename, buf); /* Verify page 0 contents. Note that we can't allow @@ -1600,7 +1663,8 @@ int main( allow_mismatches = 0; exit_status = verify_checksum(buf, is_encrypted, - &mismatch_count, flags); + &mismatch_count, + tablespace_flags); if (exit_status) { fprintf(stderr, "Error: Page 0 checksum mismatch, can't continue. \n"); @@ -1611,7 +1675,8 @@ int main( if ((exit_status = rewrite_checksum( filename, fil_in, buf, - &pos, is_encrypted, flags))) { + &pos, is_encrypted, + tablespace_flags))) { goto my_exit; } @@ -1807,7 +1872,7 @@ unexpected_eof: first_non_zero: if (is_system_tablespace) { /* enable when page is double write buffer.*/ - skip_page = is_page_doublewritebuffer(buf); + skip_page = is_page_doublewritebuffer(); } else { skip_page = false; } @@ -1828,13 +1893,16 @@ first_non_zero: && !is_page_free(xdes, physical_page_size, cur_page_num) && (exit_status = verify_checksum( buf, is_encrypted, - &mismatch_count, flags))) { + &mismatch_count, + tablespace_flags))) { goto my_exit; } - if ((exit_status = rewrite_checksum( - filename, fil_in, buf, - &pos, is_encrypted, flags))) { + if (!is_page_doublewritebuffer() && + (exit_status = rewrite_checksum( + filename, fil_in, buf, + &pos, is_encrypted, + tablespace_flags))) { goto my_exit; } diff --git a/extra/perror.c b/extra/perror.c index 8f4c92fbfd0..cb6ed28378f 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -353,8 +353,13 @@ int main(int argc,char *argv[]) { found= 1; if (verbose) + { + int hundred= code / 100; printf("MariaDB error code %3d (%s): %s\n" - "Learn more: https://mariadb.com/kb/en/e%3d/\n", code, name, msg, code); + "Learn more: https://mariadb.com/docs/server/reference/" + "error-codes/mariadb-error-codes-%d00-to-%d99/e%3d\n", + code, name, msg, hundred, hundred, code); + } else puts(msg); } diff --git a/libmariadb b/libmariadb index b790c6c149c..46880b00365 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit b790c6c149c9119fb73c416e993af1c7ef256b34 +Subproject commit 46880b003653a000e9588bd73c8b1dd65088c686 diff --git a/mysql-test/main/analyze_stmt_prefetch_count.result b/mysql-test/main/analyze_stmt_prefetch_count.result index f5a5c9bda96..d55b416c32a 100644 --- a/mysql-test/main/analyze_stmt_prefetch_count.result +++ b/mysql-test/main/analyze_stmt_prefetch_count.result @@ -33,9 +33,16 @@ select @pages_accessed > 1000 and @pages_accessed < 1500; @pages_accessed > 1000 and @pages_accessed < 1500 1 set @total_read = (@pages_read_count + @pages_prefetch_read_count); -select @pages_accessed*0.75 < @total_read, @total_read < @pages_accessed*1.25; -@pages_accessed*0.75 < @total_read @total_read < @pages_accessed*1.25 +set @low_ok= @pages_accessed*0.75 < @total_read; +set @high_ok= @total_read < @pages_accessed*1.50; +select @low_ok, @high_ok; +@low_ok @high_ok 1 1 +select +if(@low_ok and @high_ok,0,@pages_accessed) unexpected_accessed, +if(@low_ok and @high_ok,0,@total_read) unexpected_read; +unexpected_accessed unexpected_read +0 0 set @innodb_pages_read1= (select variable_value from information_schema.session_status diff --git a/mysql-test/main/analyze_stmt_prefetch_count.test b/mysql-test/main/analyze_stmt_prefetch_count.test index b5c6aac67b5..3e52830a0d0 100644 --- a/mysql-test/main/analyze_stmt_prefetch_count.test +++ b/mysql-test/main/analyze_stmt_prefetch_count.test @@ -48,8 +48,13 @@ set @pages_prefetch_read_count= cast(json_value(@js,'$.pages_prefetch_read_count select @pages_accessed > 1000 and @pages_accessed < 1500; set @total_read = (@pages_read_count + @pages_prefetch_read_count); +set @low_ok= @pages_accessed*0.75 < @total_read; +set @high_ok= @total_read < @pages_accessed*1.50; -select @pages_accessed*0.75 < @total_read, @total_read < @pages_accessed*1.25; +select @low_ok, @high_ok; +select +if(@low_ok and @high_ok,0,@pages_accessed) unexpected_accessed, +if(@low_ok and @high_ok,0,@total_read) unexpected_read; set @innodb_pages_read1= (select variable_value diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index ec9b042d953..9dcb41ebc11 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -5289,6 +5289,8 @@ SET @obj1='{ "a": 1,"b": 2,"c": 3}'; SELECT JSON_OBJECT_FILTER_KEYS (@obj1,@arr1); JSON_OBJECT_FILTER_KEYS (@obj1,@arr1) NULL +SET character_set_database=default; +SET CHARACTER SET default; # End of 11.2 Test # Beginning of 11.4 Test # @@ -5300,4 +5302,26 @@ NULL SELECT json_array_intersect(@a,@b); json_array_intersect(@a,@b) NULL +# MDEV-36809: json_array_intersect crashs when unused table ref provided +# +select json_array_intersect('[["1", "7"], ["2", "6"], ["4", "5"], ["3", "8"]]', '[["2","6"],["3","8"],["4","5"],["1","7"]]') as result from mysql.user; +result +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +SELECT ( WITH x AS ( WITH x ( x ) AS ( SELECT ( 1.000000 ) ) SELECT x FROM x ) SELECT * FROM x WHERE ( SELECT AVG ( x ) OVER ( ORDER BY JSON_ARRAY_INTERSECT ( '[["1", "7"], ["2", "6"], ["3", "8"]]' , '[["2","6"],["3","8"],["4","5"],["1","7"]]' ) ) FROM x ) ) as result; +result +1.000000 +# +# MDEV-37864: mysql-test/mtr --cursor main.func_json fails +# +select json_array_intersect('[["1", "7"], ["2", "6"], ["4", "5"], ["3", "8"]]', '[["2","6"],["3","8"],["4","5"],["1","7"]]') as result from mysql.user; +result +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] +[["2", "6"], ["3", "8"], ["4", "5"], ["1", "7"]] # End of 11.4 Test diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index d527f7bdd33..1f094360932 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -4177,6 +4177,9 @@ SET CHARACTER SET utf8; SET @obj1='{ "a": 1,"b": 2,"c": 3}'; SELECT JSON_OBJECT_FILTER_KEYS (@obj1,@arr1); +SET character_set_database=default; +SET CHARACTER SET default; + --echo # End of 11.2 Test --echo # Beginning of 11.4 Test @@ -4190,4 +4193,15 @@ SELECT JSON_OBJECT_FILTER_KEYS (@obj1,@arr1); SELECT json_array_intersect(@a,@b); +--echo # MDEV-36809: json_array_intersect crashs when unused table ref provided +--echo # +select json_array_intersect('[["1", "7"], ["2", "6"], ["4", "5"], ["3", "8"]]', '[["2","6"],["3","8"],["4","5"],["1","7"]]') as result from mysql.user; +SELECT ( WITH x AS ( WITH x ( x ) AS ( SELECT ( 1.000000 ) ) SELECT x FROM x ) SELECT * FROM x WHERE ( SELECT AVG ( x ) OVER ( ORDER BY JSON_ARRAY_INTERSECT ( '[["1", "7"], ["2", "6"], ["3", "8"]]' , '[["2","6"],["3","8"],["4","5"],["1","7"]]' ) ) FROM x ) ) as result; + +--echo # +--echo # MDEV-37864: mysql-test/mtr --cursor main.func_json fails +--echo # + +select json_array_intersect('[["1", "7"], ["2", "6"], ["4", "5"], ["3", "8"]]', '[["2","6"],["3","8"],["4","5"],["1","7"]]') as result from mysql.user; + --echo # End of 11.4 Test diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result index 5c89b9aa6b4..f046b2c80c1 100644 --- a/mysql-test/main/func_str.result +++ b/mysql-test/main/func_str.result @@ -5624,8 +5624,18 @@ DROP TABLE t2; DROP TABLE t1; SET sql_mode=DEFAULT; # -# End of 10.11 tests +# MDEV-37740 LOCATE(X,Y,NULL) is not NULL # +select locate(1,2,NULL); +locate(1,2,NULL) +NULL +# +# MDEV-37835 mysqli silently trims each json_arrayagg result to modulo 64KB +# +select group_concat(v) from ( select '$a' as v union all select '$b' as v) t; +group_concat(v) +a...aaaaa,b...bbbbb +# End of 10.11 tests # # MDEV-9069 extend AES_ENCRYPT() and AES_DECRYPT() to support IV and the algorithm # diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test index c8060961c3d..0ebc19164d0 100644 --- a/mysql-test/main/func_str.test +++ b/mysql-test/main/func_str.test @@ -2576,8 +2576,19 @@ DROP TABLE t1; SET sql_mode=DEFAULT; --echo # ---echo # End of 10.11 tests +--echo # MDEV-37740 LOCATE(X,Y,NULL) is not NULL --echo # +select locate(1,2,NULL); + +--echo # +--echo # MDEV-37835 mysqli silently trims each json_arrayagg result to modulo 64KB +--echo # +let $a=`select repeat('a', 65540)`; +let $b=`select repeat('b', 65540)`; +replace_regex /a{65535}/a.../ /b{65535}/b.../; +evalp select group_concat(v) from ( select '$a' as v union all select '$b' as v) t; + +--echo # End of 10.11 tests --echo # --echo # MDEV-9069 extend AES_ENCRYPT() and AES_DECRYPT() to support IV and the algorithm diff --git a/mysql-test/main/gis-precise.result b/mysql-test/main/gis-precise.result index ca1fa666530..242fa2eb5ef 100644 --- a/mysql-test/main/gis-precise.result +++ b/mysql-test/main/gis-precise.result @@ -860,3 +860,11 @@ TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10) SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10); TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10) 55878.5933759170 +# +# MDEV-31499 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult. +# +SELECT ST_NUMGEOMETRIES( +ST_INTERSECTION( +ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3.8571428571428568 2.857142857142857,5.571428571428571 4.571428571428571,9 4,3.8571428571428568 2.857142857142857)),((4.5 4.75,3 5,4.6 7.4,6 6,4.5 4.75))) '), ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 4,3 5,2 5,2 7,5 4,3 4),(5 4,7.4 7,8 7,8 4,5 4))) ') )) as V; +V +3 diff --git a/mysql-test/main/gis-precise.test b/mysql-test/main/gis-precise.test index e135bedc38d..4f84589c999 100644 --- a/mysql-test/main/gis-precise.test +++ b/mysql-test/main/gis-precise.test @@ -476,3 +476,13 @@ set @zenica = ST_GeomFromText('POINT(17.907743 44.203438)'); set @sarajevo = ST_GeomFromText('POINT(18.413076 43.856258)'); SELECT TRUNCATE(ST_Distance_Sphere(@zenica, @sarajevo), 10); SELECT TRUNCATE(ST_Distance_Sphere(@sarajevo, @zenica), 10); + + +--echo # +--echo # MDEV-31499 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult. +--echo # + +SELECT ST_NUMGEOMETRIES( + ST_INTERSECTION( + ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3.8571428571428568 2.857142857142857,5.571428571428571 4.571428571428571,9 4,3.8571428571428568 2.857142857142857)),((4.5 4.75,3 5,4.6 7.4,6 6,4.5 4.75))) '), ST_MULTIPOLYGONFROMTEXT(' MULTIPOLYGON(((3 4,3 5,2 5,2 7,5 4,3 4),(5 4,7.4 7,8 7,8 4,5 4))) ') )) as V; + diff --git a/mysql-test/main/gis-rtree.result b/mysql-test/main/gis-rtree.result index 2263c484041..40b5e49c525 100644 --- a/mysql-test/main/gis-rtree.result +++ b/mysql-test/main/gis-rtree.result @@ -1655,3 +1655,8 @@ DROP TABLE t1; # # End of 10.1 tests # +CREATE TABLE t1 (c POINT NOT NULL,SPATIAL (c)); +INSERT INTO t1 VALUES (ST_GEOMFROMTEXT ('POINT(1 0)')); +UPDATE t1 SET c=''; +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field +DROP TABLE t1; diff --git a/mysql-test/main/gis-rtree.test b/mysql-test/main/gis-rtree.test index 2a87814e09a..bfc4eff41f6 100644 --- a/mysql-test/main/gis-rtree.test +++ b/mysql-test/main/gis-rtree.test @@ -1043,3 +1043,15 @@ DROP TABLE t1; --echo # --echo # End of 10.1 tests --echo # + +# +# Bug #31766 SIGSEGV in maria_rtree_split_page | maria_rtree_add_key +# + +CREATE TABLE t1 (c POINT NOT NULL,SPATIAL (c)); +INSERT INTO t1 VALUES (ST_GEOMFROMTEXT ('POINT(1 0)')); +--error ER_CANT_CREATE_GEOMETRY_OBJECT +UPDATE t1 SET c=''; +DROP TABLE t1; + + diff --git a/mysql-test/main/join_nested.result b/mysql-test/main/join_nested.result index 88d95bc61ec..7a5e56658a4 100644 --- a/mysql-test/main/join_nested.result +++ b/mysql-test/main/join_nested.result @@ -2062,4 +2062,67 @@ LEFT JOIN (t1 a LEFT JOIN t1 b ON t1.i = b.i) ON c.i = t1.i); 1 1 DROP TABLE t1; +# +# MDEV-35206: Assertion in JOIN::dbug_verify_sj_inner_tables +# +SET @save_optimizer_join_limit_pref_ratio= @@optimizer_join_limit_pref_ratio; +SET @save_optimizer_search_depth= @@optimizer_search_depth; +CREATE TABLE t1 (c1 VARCHAR(64) DEFAULT NULL, c2 VARCHAR(8) DEFAULT NULL); +INSERT INTO t1 (c1) values ('one'); +INSERT INTO t1 (c2) values ('2'); +SET optimizer_join_limit_pref_ratio=10; +SET optimizer_search_depth=1; +SELECT +c1 +FROM +t1 +WHERE +c2 IN (SELECT c2 +FROM t1 +WHERE c1 IN (SELECT c1 +FROM t1 +WHERE c1 IN (NULL) +) +) +ORDER BY c1 LIMIT 1; +c1 +DROP TABLE t1; +# +# similar issue with join::cur_embedding_map +# +CREATE TABLE t10 (a int, b int, index(b)); +INSERT INTO t10 SELECT seq, seq FROM seq_1_to_10; +CREATE TABLE t11(a int, b int); +CREATE TABLE t12(a int, b int, index(b)); +INSERT INTO t11 select seq, seq FROM seq_1_to_20; +INSERT INTO t12 select seq, seq FROM seq_1_to_40; +CREATE TABLE t13(a int, b int); +CREATE TABLE t14(a int, b int, index(b)); +INSERT INTO t13 select seq, seq FROM seq_1_to_20; +INSERT INTO t14 select seq, seq FROM seq_1_to_40; +ANALYZE TABLE t10, t11, t12; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status Table is already up to date +test.t11 analyze status Engine-independent statistics collected +test.t11 analyze status OK +test.t12 analyze status Engine-independent statistics collected +test.t12 analyze status Table is already up to date +EXPLAIN SELECT * +FROM +t10 LEFT JOIN +( +t11 JOIN t12 ON t11.b=t12.b +left join (t13 join t14 on t13.b=t14.b) on t13.a=t11.a +) ON t10.a=t11.a +ORDER BY t10.b LIMIT 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t10 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +1 SIMPLE t11 ALL NULL NULL NULL NULL 20 Using where +1 SIMPLE t12 ref b b 5 test.t11.b 1 +1 SIMPLE t13 ALL NULL NULL NULL NULL 20 Using where +1 SIMPLE t14 ref b b 5 test.t13.b 1 +DROP TABLE t10, t11, t12, t13, t14; +SET optimizer_join_limit_pref_ratio= @save_optimizer_join_limit_pref_ratio; +SET optimizer_search_depth= @save_optimizer_search_depth; # end of 10.11 tests diff --git a/mysql-test/main/join_nested.test b/mysql-test/main/join_nested.test index 99ea7bd1faa..1e045af4a1f 100644 --- a/mysql-test/main/join_nested.test +++ b/mysql-test/main/join_nested.test @@ -2,6 +2,7 @@ --disable_warnings DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings +--source include/have_sequence.inc SET @save_optimizer_switch=@@optimizer_switch; SET optimizer_switch=ifnull(@optimizer_switch_for_join_nested_test,'outer_join_with_cache=off'); @@ -1471,4 +1472,69 @@ SELECT 1 FROM t1 WHERE i IN LEFT JOIN (t1 a LEFT JOIN t1 b ON t1.i = b.i) ON c.i = t1.i); DROP TABLE t1; + +--echo # +--echo # MDEV-35206: Assertion in JOIN::dbug_verify_sj_inner_tables +--echo # + +SET @save_optimizer_join_limit_pref_ratio= @@optimizer_join_limit_pref_ratio; +SET @save_optimizer_search_depth= @@optimizer_search_depth; + +CREATE TABLE t1 (c1 VARCHAR(64) DEFAULT NULL, c2 VARCHAR(8) DEFAULT NULL); +INSERT INTO t1 (c1) values ('one'); +INSERT INTO t1 (c2) values ('2'); + +SET optimizer_join_limit_pref_ratio=10; +SET optimizer_search_depth=1; + +SELECT + c1 +FROM + t1 +WHERE + c2 IN (SELECT c2 + FROM t1 + WHERE c1 IN (SELECT c1 + FROM t1 + WHERE c1 IN (NULL) + ) + ) +ORDER BY c1 LIMIT 1; + +DROP TABLE t1; + +--echo # +--echo # similar issue with join::cur_embedding_map +--echo # +CREATE TABLE t10 (a int, b int, index(b)); +INSERT INTO t10 SELECT seq, seq FROM seq_1_to_10; + +CREATE TABLE t11(a int, b int); +CREATE TABLE t12(a int, b int, index(b)); + +INSERT INTO t11 select seq, seq FROM seq_1_to_20; +INSERT INTO t12 select seq, seq FROM seq_1_to_40; + +CREATE TABLE t13(a int, b int); +CREATE TABLE t14(a int, b int, index(b)); + +INSERT INTO t13 select seq, seq FROM seq_1_to_20; +INSERT INTO t14 select seq, seq FROM seq_1_to_40; + +ANALYZE TABLE t10, t11, t12; + +EXPLAIN SELECT * +FROM + t10 LEFT JOIN + ( + t11 JOIN t12 ON t11.b=t12.b + left join (t13 join t14 on t13.b=t14.b) on t13.a=t11.a + ) ON t10.a=t11.a +ORDER BY t10.b LIMIT 1; + +DROP TABLE t10, t11, t12, t13, t14; + +SET optimizer_join_limit_pref_ratio= @save_optimizer_join_limit_pref_ratio; +SET optimizer_search_depth= @save_optimizer_search_depth; + --echo # end of 10.11 tests diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result index 04658dcda10..92efe098d01 100644 --- a/mysql-test/main/join_nested_jcl6.result +++ b/mysql-test/main/join_nested_jcl6.result @@ -2071,6 +2071,69 @@ LEFT JOIN (t1 a LEFT JOIN t1 b ON t1.i = b.i) ON c.i = t1.i); 1 1 DROP TABLE t1; +# +# MDEV-35206: Assertion in JOIN::dbug_verify_sj_inner_tables +# +SET @save_optimizer_join_limit_pref_ratio= @@optimizer_join_limit_pref_ratio; +SET @save_optimizer_search_depth= @@optimizer_search_depth; +CREATE TABLE t1 (c1 VARCHAR(64) DEFAULT NULL, c2 VARCHAR(8) DEFAULT NULL); +INSERT INTO t1 (c1) values ('one'); +INSERT INTO t1 (c2) values ('2'); +SET optimizer_join_limit_pref_ratio=10; +SET optimizer_search_depth=1; +SELECT +c1 +FROM +t1 +WHERE +c2 IN (SELECT c2 +FROM t1 +WHERE c1 IN (SELECT c1 +FROM t1 +WHERE c1 IN (NULL) +) +) +ORDER BY c1 LIMIT 1; +c1 +DROP TABLE t1; +# +# similar issue with join::cur_embedding_map +# +CREATE TABLE t10 (a int, b int, index(b)); +INSERT INTO t10 SELECT seq, seq FROM seq_1_to_10; +CREATE TABLE t11(a int, b int); +CREATE TABLE t12(a int, b int, index(b)); +INSERT INTO t11 select seq, seq FROM seq_1_to_20; +INSERT INTO t12 select seq, seq FROM seq_1_to_40; +CREATE TABLE t13(a int, b int); +CREATE TABLE t14(a int, b int, index(b)); +INSERT INTO t13 select seq, seq FROM seq_1_to_20; +INSERT INTO t14 select seq, seq FROM seq_1_to_40; +ANALYZE TABLE t10, t11, t12; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status Table is already up to date +test.t11 analyze status Engine-independent statistics collected +test.t11 analyze status OK +test.t12 analyze status Engine-independent statistics collected +test.t12 analyze status Table is already up to date +EXPLAIN SELECT * +FROM +t10 LEFT JOIN +( +t11 JOIN t12 ON t11.b=t12.b +left join (t13 join t14 on t13.b=t14.b) on t13.a=t11.a +) ON t10.a=t11.a +ORDER BY t10.b LIMIT 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t10 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort +1 SIMPLE t11 hash_ALL NULL #hash#$hj 5 test.t10.a 20 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t12 ref b b 5 test.t11.b 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t13 hash_ALL NULL #hash#$hj 5 test.t10.a 20 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t14 ref b b 5 test.t13.b 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +DROP TABLE t10, t11, t12, t13, t14; +SET optimizer_join_limit_pref_ratio= @save_optimizer_join_limit_pref_ratio; +SET optimizer_search_depth= @save_optimizer_search_depth; # end of 10.11 tests CREATE TABLE t5 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b)); CREATE TABLE t6 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b)); diff --git a/mysql-test/main/join_outer.result b/mysql-test/main/join_outer.result index 97452bb7a59..1a8ab0ced69 100644 --- a/mysql-test/main/join_outer.result +++ b/mysql-test/main/join_outer.result @@ -2911,4 +2911,22 @@ Z 1 Y 1 X 1 drop view v0, v1, v2, v3; drop table t1, t2, t3; # end of 10.3 tests +# +# MDEV-37653 Unexpected result of prepared statement when use boolean value as parameters +# +create table t0(c0 real); +create table t1 like t0; +insert into t1 values (1); +insert into t0 values (1); +select t1.c0, t0.c0 from t1 left join t0 on 0 where not (t0.c0 is true); +c0 c0 +1 NULL +select t1.c0, t0.c0 from t1 left join t0 on 0 where not (t0.c0 is false); +c0 c0 +1 NULL +select t1.c0, t0.c0 from t1 left join t0 on false where (false or ((t0.c0 is true) in (false))); +c0 c0 +1 NULL +drop table t0, t1; +# end of 10.11 tests SET optimizer_switch=@org_optimizer_switch; diff --git a/mysql-test/main/join_outer.test b/mysql-test/main/join_outer.test index 4f3121955b9..e202e1b193e 100644 --- a/mysql-test/main/join_outer.test +++ b/mysql-test/main/join_outer.test @@ -2434,4 +2434,18 @@ drop table t1, t2, t3; --echo # end of 10.3 tests +--echo # +--echo # MDEV-37653 Unexpected result of prepared statement when use boolean value as parameters +--echo # +create table t0(c0 real); +create table t1 like t0; +insert into t1 values (1); +insert into t0 values (1); +select t1.c0, t0.c0 from t1 left join t0 on 0 where not (t0.c0 is true); +select t1.c0, t0.c0 from t1 left join t0 on 0 where not (t0.c0 is false); +select t1.c0, t0.c0 from t1 left join t0 on false where (false or ((t0.c0 is true) in (false))); +drop table t0, t1; + +--echo # end of 10.11 tests + SET optimizer_switch=@org_optimizer_switch; diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result index 53d510b18ec..392c75e1575 100644 --- a/mysql-test/main/join_outer_jcl6.result +++ b/mysql-test/main/join_outer_jcl6.result @@ -2918,4 +2918,22 @@ Z 1 Y 1 X 1 drop view v0, v1, v2, v3; drop table t1, t2, t3; # end of 10.3 tests +# +# MDEV-37653 Unexpected result of prepared statement when use boolean value as parameters +# +create table t0(c0 real); +create table t1 like t0; +insert into t1 values (1); +insert into t0 values (1); +select t1.c0, t0.c0 from t1 left join t0 on 0 where not (t0.c0 is true); +c0 c0 +1 NULL +select t1.c0, t0.c0 from t1 left join t0 on 0 where not (t0.c0 is false); +c0 c0 +1 NULL +select t1.c0, t0.c0 from t1 left join t0 on false where (false or ((t0.c0 is true) in (false))); +c0 c0 +1 NULL +drop table t0, t1; +# end of 10.11 tests SET optimizer_switch=@org_optimizer_switch; diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result index 20bff770b74..ea1eccc0659 100644 --- a/mysql-test/main/partition.result +++ b/mysql-test/main/partition.result @@ -2889,6 +2889,37 @@ a 1 DROP TABLE t1; # +# MDEV-20498 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1' failed upon REBUILD PARTITION. +# ALTER TABLE DROP COLUMN, ADD COLUMN misplacing rows. +# +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) ( +PARTITION p0 VALUES IN (8), +PARTITION p1 VALUES IN (4,7,0), +PARTITION p2 VALUES IN (9,2,5), +PARTITION p3 VALUES IN (3,1,6)); +INSERT INTO t1 VALUES (8),(5),(4),(0); +ALTER TABLE t1 DROP a, ADD a INT NOT NULL DEFAULT 0, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +ALTER TABLE t1 DROP a, ADD a INT NOT NULL DEFAULT 0; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +# +# MDEV-20498 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1' failed upon REBUILD PARTITION. +# ALTER TABLE REBUILD PARTITION crashed on misplaced rows. +# +CREATE TABLE mdev20498 (a INT) ENGINE=myisam PARTITION BY LIST (a) +(PARTITION p0 VALUES IN (0), PARTITION p1 VALUES IN (1)); +INSERT INTO mdev20498 values (0), (0), (1), (1); +FLUSH TABLES; +CALL mtr.add_suppression("corrupted: row in wrong partition:"); +ALTER TABLE mdev20498 REBUILD PARTITION p0; +ERROR HY000: Found a row in wrong partition (0 != 1) a:1 +ALTER TABLE mdev20498 REBUILD PARTITION p0, p1; +DROP TABLE mdev20498; +# # End of 10.6 tests # # diff --git a/mysql-test/main/partition.test b/mysql-test/main/partition.test index 55ed87d57da..2293aebaf30 100644 --- a/mysql-test/main/partition.test +++ b/mysql-test/main/partition.test @@ -3099,6 +3099,50 @@ INSERT INTO t1 VALUES (1),(2); SELECT * FROM t1 WHERE a LIKE '1'; DROP TABLE t1; +--echo # +--echo # MDEV-20498 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1' failed upon REBUILD PARTITION. +--echo # ALTER TABLE DROP COLUMN, ADD COLUMN misplacing rows. +--echo # + +CREATE TABLE t1 (a INT) + PARTITION BY LIST (a) ( + PARTITION p0 VALUES IN (8), + PARTITION p1 VALUES IN (4,7,0), + PARTITION p2 VALUES IN (9,2,5), + PARTITION p3 VALUES IN (3,1,6)); +INSERT INTO t1 VALUES (8),(5),(4),(0); +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE t1 DROP a, ADD a INT NOT NULL DEFAULT 0, algorithm=inplace; +ALTER TABLE t1 DROP a, ADD a INT NOT NULL DEFAULT 0; +CHECK TABLE t1; +DROP TABLE t1; + +--echo # +--echo # MDEV-20498 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1' failed upon REBUILD PARTITION. +--echo # ALTER TABLE REBUILD PARTITION crashed on misplaced rows. +--echo # + +CREATE TABLE mdev20498 (a INT) ENGINE=myisam PARTITION BY LIST (a) + (PARTITION p0 VALUES IN (0), PARTITION p1 VALUES IN (1)); +INSERT INTO mdev20498 values (0), (0), (1), (1); +FLUSH TABLES; + +let $datadir=`select @@datadir`; +CALL mtr.add_suppression("corrupted: row in wrong partition:"); + +move_file $datadir/test/mdev20498#P#p0.MYD $datadir/test//tmp.MYD; +move_file $datadir/test/mdev20498#P#p1.MYD $datadir/test/mdev20498#P#p0.MYD; +move_file $datadir/test/tmp.MYD $datadir/test/mdev20498#P#p1.MYD; + +move_file $datadir/test/mdev20498#P#p0.MYI $datadir/test/tmp.MYI; +move_file $datadir/test/mdev20498#P#p1.MYI $datadir/test/mdev20498#P#p0.MYI; +move_file $datadir/test/tmp.MYI $datadir/test/mdev20498#P#p1.MYI; + +--error ER_ROW_IN_WRONG_PARTITION +ALTER TABLE mdev20498 REBUILD PARTITION p0; +ALTER TABLE mdev20498 REBUILD PARTITION p0, p1; +DROP TABLE mdev20498; + --echo # --echo # End of 10.6 tests --echo # diff --git a/mysql-test/main/perror-win.result b/mysql-test/main/perror-win.result index 505dce9b6f2..fd78327ac3d 100644 --- a/mysql-test/main/perror-win.result +++ b/mysql-test/main/perror-win.result @@ -3,6 +3,6 @@ Win32 error code 150: System trace information was not specified in your CONFIG. OS error code 23: Too many open files in system Win32 error code 23: Data error (cyclic redundancy check). MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192sT' for key %d -Learn more: https://mariadb.com/kb/en/e1062/ +Learn more: https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1000-to-1099/e1062 Win32 error code 1062: The service has not been started. Illegal error code: 30000 diff --git a/mysql-test/main/perror.result b/mysql-test/main/perror.result index e507787895c..8721df381db 100644 --- a/mysql-test/main/perror.result +++ b/mysql-test/main/perror.result @@ -1,10 +1,10 @@ Illegal error code: 10000 MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192sT' for key %d -Learn more: https://mariadb.com/kb/en/e1062/ +Learn more: https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1000-to-1099/e1062 MariaDB error code 1408 (ER_STARTUP): %s: ready for connections. Version: '%s' socket: '%s' port: %d %s -Learn more: https://mariadb.com/kb/en/e1408/ +Learn more: https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1400-to-1499/e1408 MariaDB error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %sQ" or dump/reload to fix it! -Learn more: https://mariadb.com/kb/en/e1459/ +Learn more: https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1400-to-1499/e1459 MariaDB error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %u) -Learn more: https://mariadb.com/kb/en/e1461/ +Learn more: https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1400-to-1499/e1461 diff --git a/mysql-test/main/public_privileges.result b/mysql-test/main/public_privileges.result index 18a45a1231f..57d57c3f29c 100644 --- a/mysql-test/main/public_privileges.result +++ b/mysql-test/main/public_privileges.result @@ -84,7 +84,7 @@ create database testdb; use testdb; create procedure p1 () select 1; connect testuser,localhost,testuser,,; -select user,db from information_schema.processlist where user='root'; +select user,db from information_schema.processlist where id=$default_id; user db call testdb.p1(); ERROR 42000: execute command denied to user 'testuser'@'%' for routine 'testdb.p1' @@ -93,7 +93,7 @@ GRANT PROCESS ON *.* to PUBLIC; GRANT EXECUTE ON testdb.* to PUBLIC; disconnect testuser; connect testuser,localhost,testuser,,; -select user,db from information_schema.processlist where user='root'; +select user,db from information_schema.processlist where id=$default_id; user db root testdb call testdb.p1(); @@ -104,7 +104,7 @@ disconnect testuser; # check that the privileges are correctly read by acl_load flush privileges; connect testuser,localhost,testuser,,; -select user,db from information_schema.processlist where user='root'; +select user,db from information_schema.processlist where id=$default_id; user db root testdb call testdb.p1(); diff --git a/mysql-test/main/public_privileges.test b/mysql-test/main/public_privileges.test index 9465cc9bfad..17e7228ec6a 100644 --- a/mysql-test/main/public_privileges.test +++ b/mysql-test/main/public_privileges.test @@ -78,10 +78,11 @@ create user testuser; create database testdb; use testdb; create procedure p1 () select 1; +let $default_id= `select connection_id()`; connect (testuser,localhost,testuser,,); -select user,db from information_schema.processlist where user='root'; +evalp select user,db from information_schema.processlist where id=$default_id; --error ER_PROCACCESS_DENIED_ERROR call testdb.p1(); @@ -94,7 +95,7 @@ GRANT EXECUTE ON testdb.* to PUBLIC; disconnect testuser; connect (testuser,localhost,testuser,,); -select user,db from information_schema.processlist where user='root'; +evalp select user,db from information_schema.processlist where id=$default_id; call testdb.p1(); connection default; @@ -105,7 +106,7 @@ flush privileges; connect (testuser,localhost,testuser,,); -select user,db from information_schema.processlist where user='root'; +evalp select user,db from information_schema.processlist where id=$default_id; call testdb.p1(); connection default; diff --git a/mysql-test/main/repair_symlink-5543.test b/mysql-test/main/repair_symlink-5543.test index 002b8d8023b..42ffa82696a 100644 --- a/mysql-test/main/repair_symlink-5543.test +++ b/mysql-test/main/repair_symlink-5543.test @@ -10,9 +10,9 @@ eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR'; insert t1 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD # Some systems fail with errcode 31 (FreeBSD), 40 (Linux), 85 (AIX), -# or 90 (MIPS) when doing openat, +# 62 (macOS), or 90 (MIPS) when doing openat, # while others don't have openat and fail with errcode 20. ---replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /[49]0|31|85/20/ /".*"/""/ +--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /[49]0|31|85|62/20/ /".*"/""/ repair table t1; drop table t1; @@ -20,7 +20,7 @@ drop table t1; eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR'; insert t2 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD ---replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /[49]0|31|85/20/ /".*"/""/ +--replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /[49]0|31|85|62/20/ /".*"/""/ repair table t2; drop table t2; diff --git a/mysql-test/main/show_check.test b/mysql-test/main/show_check.test index b95cebff4f0..e5457a25fb7 100644 --- a/mysql-test/main/show_check.test +++ b/mysql-test/main/show_check.test @@ -348,7 +348,6 @@ drop table t1; --error ER_DBACCESS_DENIED_ERROR drop database mysqltest; disconnect con1; ---source include/wait_until_disconnected.inc connect (con2,localhost,mysqltest_2,,"*NO-ONE*"); connection con2; @@ -361,7 +360,6 @@ drop table mysqltest.t1; --error ER_DBACCESS_DENIED_ERROR drop database mysqltest; disconnect con2; ---source include/wait_until_disconnected.inc connect (con3,localhost,mysqltest_3,,"*NO-ONE*"); connection con3; @@ -371,7 +369,6 @@ show create database mysqltest; drop table mysqltest.t1; drop database mysqltest; disconnect con3; ---source include/wait_until_disconnected.inc connection default; set names binary; @@ -1032,7 +1029,6 @@ connect (con4,localhost,mysqltest_4,,mysqltest); connection con4; show create database mysqltest; disconnect con4; ---source include/wait_until_disconnected.inc connection default; delete from mysql.user where user='mysqltest_4'; delete from mysql.db where user='mysqltest_4'; @@ -1268,7 +1264,6 @@ SHOW ENGINE MYISAM STATUS; --enable_result_log disconnect conn1; ---source include/wait_until_disconnected.inc connection default; DROP USER test_u@localhost; @@ -1292,7 +1287,6 @@ connection con1; SHOW CREATE TABLE t1; disconnect con1; ---source include/wait_until_disconnected.inc connection default; UNLOCK TABLES; @@ -1364,7 +1358,6 @@ connection con1; ALTER TABLE t1 CHARACTER SET = utf8; disconnect con1; ---source include/wait_until_disconnected.inc connection default; COMMIT; @@ -1376,6 +1369,9 @@ DROP TABLE t1; --echo # Bug#57306 SHOW PROCESSLIST does not display string literals well. --echo # +let $count_sessions= 1; +source include/wait_until_count_sessions.inc; + SET NAMES latin1; SELECT GET_LOCK('t', 1000); --connect (con1,localhost,root,,) @@ -1398,7 +1394,6 @@ SELECT RELEASE_LOCK('t'); --connection con1 --reap --disconnect con1 ---source include/wait_until_disconnected.inc --connection default SET NAMES latin1; diff --git a/mysql-test/main/subselect_mat.result b/mysql-test/main/subselect_mat.result index dfa2d58bce5..1fd53ce0ad9 100644 --- a/mysql-test/main/subselect_mat.result +++ b/mysql-test/main/subselect_mat.result @@ -2745,6 +2745,17 @@ ORDER BY l_orderkey, l_linenumber; l_orderkey l_linenumber l_quantity DROP TABLE t1; # end of 10.6 tests +# +# MDEV-30721: Assertion `fixed()' failed in Item_cond_and::val_bool() +# with degenerate JTBM semi-join +# +CREATE TABLE t1 (c INT KEY); +INSERT INTO t1 (c) VALUES (0); +SELECT * FROM t1 WHERE (0,0) IN (SELECT MAX(c),MIN(c) FROM t1); +c +0 +DROP TABLE t1; +# end of 10.11 tests set @subselect_mat_test_optimizer_switch_value=null; set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off'; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; diff --git a/mysql-test/main/subselect_sj_mat.result b/mysql-test/main/subselect_sj_mat.result index 9d4f0564a12..215314e398b 100644 --- a/mysql-test/main/subselect_sj_mat.result +++ b/mysql-test/main/subselect_sj_mat.result @@ -2771,3 +2771,14 @@ ORDER BY l_orderkey, l_linenumber; l_orderkey l_linenumber l_quantity DROP TABLE t1; # end of 10.6 tests +# +# MDEV-30721: Assertion `fixed()' failed in Item_cond_and::val_bool() +# with degenerate JTBM semi-join +# +CREATE TABLE t1 (c INT KEY); +INSERT INTO t1 (c) VALUES (0); +SELECT * FROM t1 WHERE (0,0) IN (SELECT MAX(c),MIN(c) FROM t1); +c +0 +DROP TABLE t1; +# end of 10.11 tests diff --git a/mysql-test/main/subselect_sj_mat.test b/mysql-test/main/subselect_sj_mat.test index 5e07fa64eec..3dcef80b9ff 100644 --- a/mysql-test/main/subselect_sj_mat.test +++ b/mysql-test/main/subselect_sj_mat.test @@ -2463,3 +2463,20 @@ ORDER BY l_orderkey, l_linenumber; DROP TABLE t1; --echo # end of 10.6 tests + +--echo # +--echo # MDEV-30721: Assertion `fixed()' failed in Item_cond_and::val_bool() +--echo # with degenerate JTBM semi-join +--echo # + +CREATE TABLE t1 (c INT KEY); +INSERT INTO t1 (c) VALUES (0); + +# This query triggered an assertion because the Item_cond_and created +# during condition merging in and_new_conditions_to_optimized_cond() +# was evaluated before being fixed. +SELECT * FROM t1 WHERE (0,0) IN (SELECT MAX(c),MIN(c) FROM t1); + +DROP TABLE t1; + +--echo # end of 10.11 tests diff --git a/mysql-test/main/subselect_union_rand.result b/mysql-test/main/subselect_union_rand.result new file mode 100644 index 00000000000..95538522bc9 --- /dev/null +++ b/mysql-test/main/subselect_union_rand.result @@ -0,0 +1,13 @@ +CREATE TABLE t1 ( a double, key (a)) ; +INSERT INTO t1 VALUES (1),(2),(-3); +SELECT t1.a FROM ( SELECT a AS a1 FROM t1 ) dt +JOIN t1 ON a1 LIKE EXISTS ( SELECT a + RAND () FROM t1 UNION SELECT a FROM t1) ; +DROP TABLE t1; +CREATE TABLE t1 ( a VARCHAR(100), b bool) ; +INSERT INTO t1 VALUES ('-101',-87),('-95',59),(NULL,48); +SELECT +(SELECT 1 FROM (SELECT 1 HAVING rand() ) dt1 +UNION +SELECT a FROM t1 WHERE b IN (SELECT a FROM t1) LIMIT 1) +FROM t1; +DROP TABLE t1; diff --git a/mysql-test/main/subselect_union_rand.test b/mysql-test/main/subselect_union_rand.test new file mode 100644 index 00000000000..6e78f9ddcaf --- /dev/null +++ b/mysql-test/main/subselect_union_rand.test @@ -0,0 +1,28 @@ +# +# MDEV-32397 join_read_first, keyread SEGV crash +# +CREATE TABLE t1 ( a double, key (a)) ; +INSERT INTO t1 VALUES (1),(2),(-3); +# We disable the result log because RAND() is unpredictable and seeding RAND +# doesn't make it stable when using the PS protocol. +--disable_result_log +SELECT t1.a FROM ( SELECT a AS a1 FROM t1 ) dt +JOIN t1 ON a1 LIKE EXISTS ( SELECT a + RAND () FROM t1 UNION SELECT a FROM t1) ; +--enable_result_log +DROP TABLE t1; + +# +# MDEV-32403 test_if_quick_select: Segv +# +CREATE TABLE t1 ( a VARCHAR(100), b bool) ; +INSERT INTO t1 VALUES ('-101',-87),('-95',59),(NULL,48); +# We disable the result log because RAND() is unpredictable and seeding RAND +# doesn't make it stable when using the PS protocol. +--disable_result_log +SELECT + (SELECT 1 FROM (SELECT 1 HAVING rand() ) dt1 + UNION + SELECT a FROM t1 WHERE b IN (SELECT a FROM t1) LIMIT 1) +FROM t1; +--enable_result_log +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result b/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result index 1f78f392100..b6439de6cf8 100644 --- a/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result +++ b/mysql-test/suite/binlog/r/binlog_flush_binlogs_delete_domain.result @@ -97,5 +97,13 @@ ERROR HY000: The value of gtid domain being deleted ('4294967296') exceeds its m FLUSH BINARY LOGS DELETE_DOMAIN_ID = (4294967295); Warnings: Warning 1076 The gtid domain being deleted ('4294967295') is not in the current binlog state +RESET MASTER; +SET @@GLOBAL.gtid_domain_id=0; +SET @@SESSION.gtid_domain_id=0; +CREATE USER u; +FLUSH BINARY LOGS; +PURGE BINARY LOGS TO 'master-bin.000002'; +FLUSH BINARY LOGS DELETE_DOMAIN_ID = (0), BINARY LOGS DELETE_DOMAIN_ID = (0); +DROP USER u; DROP TABLE t; RESET MASTER; diff --git a/mysql-test/suite/binlog/t/binlog_bug23533.combinations b/mysql-test/suite/binlog/t/binlog_bug23533.combinations new file mode 100644 index 00000000000..529e5629699 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_bug23533.combinations @@ -0,0 +1,4 @@ +[thread] +--thread-handling=one-thread-per-connection +[pool] +--loose-thread-handling=pool-of-threads diff --git a/mysql-test/suite/binlog/t/binlog_bug23533.test b/mysql-test/suite/binlog/t/binlog_bug23533.test index a77497115e5..81dba16dc2f 100644 --- a/mysql-test/suite/binlog/t/binlog_bug23533.test +++ b/mysql-test/suite/binlog/t/binlog_bug23533.test @@ -7,6 +7,9 @@ --source include/have_log_bin.inc --source include/have_binlog_format_row.inc call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.*"); +if ($MTR_COMBINATION_POOL) { +--source include/have_pool_of_threads.inc +} SET AUTOCOMMIT=0; # Create 1st table diff --git a/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test b/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test index 7d10cded3c9..be80e10956e 100644 --- a/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test +++ b/mysql-test/suite/binlog/t/binlog_flush_binlogs_delete_domain.test @@ -160,6 +160,22 @@ RESET MASTER; --error 0 --eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($d_max) +# +# MDEV-37885 +# Server crash or ASAN errors in rpl_binlog_state::drop_domain +# +RESET MASTER; +SET @@GLOBAL.gtid_domain_id=0; +SET @@SESSION.gtid_domain_id=0; +CREATE USER u; +FLUSH BINARY LOGS; +--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1) +--eval PURGE BINARY LOGS TO '$purge_to_binlog' +--error 0 +FLUSH BINARY LOGS DELETE_DOMAIN_ID = (0), BINARY LOGS DELETE_DOMAIN_ID = (0); +DROP USER u; + + # # Cleanup # diff --git a/mysql-test/suite/events/events_2.result b/mysql-test/suite/events/events_2.result index 64cb0dfb281..58d725f241e 100644 --- a/mysql-test/suite/events/events_2.result +++ b/mysql-test/suite/events/events_2.result @@ -437,3 +437,27 @@ Warnings: Note 1544 Event execution time is in the past. Event has been disabled drop event event_35981; drop database events_test; +# +# MDEV-37744 Table Charset Mismatch (Primary/Replica) via Event +# +set global event_scheduler=1; +create schema andre default charset utf8mb4 collate utf8mb4_general_ci; +use andre; +create event daily_table_creation +on schedule every 1 day starts now() + interval 5 second do +create table andre_table ( +id int(11) not null auto_increment primary key, +col_1 varchar(50) not null +); +show create table andre_table; +Table Create Table +andre_table CREATE TABLE `andre_table` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `col_1` varchar(50) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci +set global event_scheduler=0; +drop event daily_table_creation; +drop schema andre; +use test; +# End of 10.11 tests diff --git a/mysql-test/suite/events/events_2.test b/mysql-test/suite/events/events_2.test index cd0d908b870..9385f5d356d 100644 --- a/mysql-test/suite/events/events_2.test +++ b/mysql-test/suite/events/events_2.test @@ -526,3 +526,26 @@ let $wait_condition= drop database events_test; --enable_service_connection + +--echo # +--echo # MDEV-37744 Table Charset Mismatch (Primary/Replica) via Event +--echo # +set global event_scheduler=1; +create schema andre default charset utf8mb4 collate utf8mb4_general_ci; +use andre; +create event daily_table_creation +on schedule every 1 day starts now() + interval 5 second do + create table andre_table ( + id int(11) not null auto_increment primary key, + col_1 varchar(50) not null + ); + +let $wait_condition= select count(*)= 1 from information_schema.tables where table_name = 'andre_table'; +source include/wait_condition.inc; +show create table andre_table; +set global event_scheduler=0; +drop event daily_table_creation; +drop schema andre; +use test; + +--echo # End of 10.11 tests diff --git a/mysql-test/suite/galera/r/MDEV-30764.result b/mysql-test/suite/galera/r/MDEV-30764.result new file mode 100644 index 00000000000..80ba0d7f776 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-30764.result @@ -0,0 +1,66 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_1; +SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2'; +connection node_2; +SET GLOBAL read_only=1; +SET SESSION wsrep_trx_fragment_size = 64; +set default_storage_engine=SEQUENCE; +SET AUTOCOMMIT = OFF; +CREATE TABLE t1(c1 NUMERIC NOT NULL); +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine") +CREATE TABLE t1 (id INT PRIMARY KEY) engine=innodb; +SET SESSION SQL_MODE='HIGH_NOT_PRECEDENCE'; +INSERT INTO t1 VALUES (1),(2),(3); +SET GLOBAL SQL_MODE='NO_ENGINE_SUBSTITUTION'; +DROP TABLE dummy; +ERROR 42S02: Unknown table 'test.dummy' +INSERT INTO t1 VALUES('a'); +Warnings: +Warning 1366 Incorrect integer value: 'a' for column `test`.`t1`.`id` at row 1 +# In this point there should be one fragment +select count(*) AS EXPECT_1 from mysql.wsrep_streaming_log; +EXPECT_1 +1 +SET @@global.wsrep_cluster_address='gcomm://'; +SET SESSION SQL_MODE='TRADITIONAL '; +# Killing cluster because we have messed with wsrep_cluster_address +connection node_2; +SET SESSION wsrep_sync_wait = 0; +Killing server ... +connection node_1; +SET SESSION wsrep_sync_wait = 0; +Killing server ... +connection node_2; +call mtr.add_suppression("WSREP: BF applier thread"); +call mtr.add_suppression("WSREP: Event"); +call mtr.add_suppression("WSREP: SR trx recovery applying returned 1290"); +call mtr.add_suppression("WSREP: Adopting a transaction"); +call mtr.add_suppression("WSREP: Could not find applier context for"); +call mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster"); +call mtr.add_suppression("WSREP: Failed to vote on request for"); +select count(*) AS EXPECT_0 from mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT * FROM t1; +c1 +connection node_1; +select count(*) AS EXPECT_0 from mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT * FROM t1; +c1 +DROP TABLE t1; +SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false;pc.weight=1'; +connection node_2; +connection node_1; +call mtr.add_suppression("WSREP: Event"); +call mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on"); +call mtr.add_suppression("WSREP: Failed to apply write set: gtid"); +call mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster"); +call mtr.add_suppression("WSREP: Could not find applier context for"); +call mtr.add_suppression("WSREP: Failed to vote on request for"); +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_provider_options_long.result b/mysql-test/suite/galera/r/galera_provider_options_long.result new file mode 100644 index 00000000000..ea85f47e0d7 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_provider_options_long.result @@ -0,0 +1,16 @@ +connection node_2; +connection node_1; +# +# wsrep_provider_options should be already > 2k length +# +AS_EXPECT_1 +1 +# +# Setting single value should pass +# +SET GLOBAL wsrep_provider_options='pc.ignore_sb=false;pc.weight=2'; +# +# This failed before change with ER_WRONG_STRING_LENGTH +# +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/t/MDEV-30764.test b/mysql-test/suite/galera/t/MDEV-30764.test new file mode 100644 index 00000000000..67152ebea12 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-30764.test @@ -0,0 +1,100 @@ +--source include/galera_cluster.inc +--source include/have_sequence.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options ='pc.ignore_sb=true;pc.weight=2'; + +--connection node_2 +--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address` +SET GLOBAL read_only=1; +SET SESSION wsrep_trx_fragment_size = 64; +set default_storage_engine=SEQUENCE; +SET AUTOCOMMIT = OFF; +--error 1005 +CREATE TABLE t1(c1 NUMERIC NOT NULL); +CREATE TABLE t1 (id INT PRIMARY KEY) engine=innodb; +SET SESSION SQL_MODE='HIGH_NOT_PRECEDENCE'; +INSERT INTO t1 VALUES (1),(2),(3); +SET GLOBAL SQL_MODE='NO_ENGINE_SUBSTITUTION'; +--error 1051 +DROP TABLE dummy; +INSERT INTO t1 VALUES('a'); +--echo # In this point there should be one fragment +select count(*) AS EXPECT_1 from mysql.wsrep_streaming_log; +SET @@global.wsrep_cluster_address='gcomm://'; +SET SESSION SQL_MODE='TRADITIONAL '; + +# +# Kill the entire cluster and restart +# +--echo # Killing cluster because we have messed with wsrep_cluster_address +--connection node_2 +SET SESSION wsrep_sync_wait = 0; +--source include/kill_galera.inc + +--connection node_1 +SET SESSION wsrep_sync_wait = 0; +--source include/kill_galera.inc + +--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat +--let $start_mysqld_params =--wsrep-new-cluster +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--source include/start_mysqld.inc +--source include/wait_until_ready.inc + +--connection node_2 +--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +--let $start_mysqld_params = +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--source include/start_mysqld.inc +--source include/wait_until_ready.inc + +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc + +call mtr.add_suppression("WSREP: BF applier thread"); +call mtr.add_suppression("WSREP: Event"); +call mtr.add_suppression("WSREP: SR trx recovery applying returned 1290"); +call mtr.add_suppression("WSREP: Adopting a transaction"); +call mtr.add_suppression("WSREP: Could not find applier context for"); +call mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster"); +call mtr.add_suppression("WSREP: Failed to vote on request for"); + +select count(*) AS EXPECT_0 from mysql.wsrep_streaming_log; + +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc + +SELECT * FROM t1; + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc +select count(*) AS EXPECT_0 from mysql.wsrep_streaming_log; +SELECT * FROM t1; +DROP TABLE t1; +SET GLOBAL wsrep_provider_options ='pc.ignore_sb=false;pc.weight=1'; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc + +--connection node_1 +call mtr.add_suppression("WSREP: Event"); +call mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on"); +call mtr.add_suppression("WSREP: Failed to apply write set: gtid"); +call mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster"); +call mtr.add_suppression("WSREP: Could not find applier context for"); +call mtr.add_suppression("WSREP: Failed to vote on request for"); + +# Restore original auto_increment_offset values. +--source include/auto_increment_offset_restore.inc + +--source include/galera_end.inc diff --git a/mysql-test/suite/galera/t/galera_provider_options_long.cnf b/mysql-test/suite/galera/t/galera_provider_options_long.cnf new file mode 100644 index 00000000000..ee8c6e590f4 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_provider_options_long.cnf @@ -0,0 +1,11 @@ +!include ../galera_2nodes.cnf + +[mysqld] +loose-galera-ssl-upgrade=1 +wsrep-debug=1 + +[mysqld.1] +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' + +[mysqld.2] +wsrep_provider_options='socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' diff --git a/mysql-test/suite/galera/t/galera_provider_options_long.test b/mysql-test/suite/galera/t/galera_provider_options_long.test new file mode 100644 index 00000000000..bc9334447fe --- /dev/null +++ b/mysql-test/suite/galera/t/galera_provider_options_long.test @@ -0,0 +1,28 @@ +--source include/galera_cluster.inc +--source include/have_ssl_communication.inc +--source include/have_openssl.inc + +--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` + +--echo # +--echo # wsrep_provider_options should be already > 2k length +--echo # +--disable_query_log +--eval SELECT LENGTH('$wsrep_provider_options_orig') > 2000 AS_EXPECT_1; +--enable_query_log + +--echo # +--echo # Setting single value should pass +--echo # + +SET GLOBAL wsrep_provider_options='pc.ignore_sb=false;pc.weight=2'; + +--echo # +--echo # This failed before change with ER_WRONG_STRING_LENGTH +--echo # + +--disable_query_log +--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig" +--enable_query_log + +--source include/galera_end.inc diff --git a/mysql-test/suite/innodb/r/innochecksum_flags_and_skip.result b/mysql-test/suite/innodb/r/innochecksum_flags_and_skip.result new file mode 100644 index 00000000000..c71368129fc --- /dev/null +++ b/mysql-test/suite/innodb/r/innochecksum_flags_and_skip.result @@ -0,0 +1,31 @@ +CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; +SET GLOBAL innodb_log_checkpoint_now=ON; +FLUSH TABLE t1 FOR EXPORT; +UNLOCK TABLES; +INSERT INTO t1 SET a=1; +FLUSH TABLE t1 FOR EXPORT; +UNLOCK TABLES; +# Skip InnoDB Doublewrite Buffer +Should not exist when summary excludes dblwr pages +Should exist when summary includes dblwr pages +# restart +CREATE TABLE ibd_1(f1 INT PRIMARY KEY)ENGINE=InnoDB; +INSERT INTO ibd_1 VALUES(1), (2), (3), (4); +SET GLOBAL innodb_file_per_table=0; +CREATE TABLE ibd_2(f1 INT PRIMARY KEY)ENGINE=InnoDB; +INSERT INTO ibd_2 SELECT seq FROM seq_1_to_8451; +# Pass wrong tablespace flag for ibdata2 +FOUND 1 /Error: Page 0 checksum mismatch/ in result.log +# Pass wrong tablespace flag for ibdata1 +FOUND 1 /Error: Mismatch between provided tablespace flags/ in result.log +# Pass invalid tablespace flag for ibdata1 +FOUND 1 /Error: Provided --tablespace-flags is not valid/ in result.log +# innochecksum should be succesfull +NOT FOUND /Fail/ in result.log +# Create a tablespace with page number > 2^31 +# Test innochecksum with the modified ibdata3 +FOUND 1 /Error: First page of the tablespace file should be 0, but encountered page number 2147483649/ in result.log +# Test innochecksum with the modified ibdata3 with tablespace flags +FOUND 1 /Exceeded the maximum allowed checksum mismatch/ in result.log +# restart +DROP TABLE t1, ibd_1, ibd_2; diff --git a/mysql-test/suite/innodb/r/undo_leak_fail.result b/mysql-test/suite/innodb/r/undo_leak_fail.result index 83b976f785c..9ad5c29e6d8 100644 --- a/mysql-test/suite/innodb/r/undo_leak_fail.result +++ b/mysql-test/suite/innodb/r/undo_leak_fail.result @@ -44,9 +44,10 @@ innodb_system 77594624 # restart: --debug_dbug=d,unused_undo_free_fail_1 # Fail to free the segment due to previous shutdown FOUND 1 /InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0.*/ in mysqld.1.err -SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0; -NAME FILE_SIZE -innodb_system 15728640 +SELECT NAME, IF(file_size>=14680064,'ok',file_size) +FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0; +NAME IF(file_size>=14680064,'ok',file_size) +innodb_system ok SET GLOBAL innodb_fast_shutdown= 0; # Fail to free the segment while finding the used segments # restart: --debug_dbug=d,unused_undo_free_fail_2 diff --git a/mysql-test/suite/innodb/t/innochecksum_flags_and_skip.opt b/mysql-test/suite/innodb/t/innochecksum_flags_and_skip.opt new file mode 100644 index 00000000000..5d265d61d14 --- /dev/null +++ b/mysql-test/suite/innodb/t/innochecksum_flags_and_skip.opt @@ -0,0 +1,2 @@ +--innodb_data_file_path=ibdata1:3M;ibdata2:1M:autoextend +--innodb_sys_tablespaces diff --git a/mysql-test/suite/innodb/t/innochecksum_flags_and_skip.test b/mysql-test/suite/innodb/t/innochecksum_flags_and_skip.test new file mode 100644 index 00000000000..f1e55017a65 --- /dev/null +++ b/mysql-test/suite/innodb/t/innochecksum_flags_and_skip.test @@ -0,0 +1,179 @@ +--source include/have_innodb.inc +--source include/not_embedded.inc +--source include/have_debug.inc +--source include/have_sequence.inc +let MYSQLD_DATADIR= `SELECT @@datadir`; +CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; +SET GLOBAL innodb_log_checkpoint_now=ON; +FLUSH TABLE t1 FOR EXPORT; +UNLOCK TABLES; +INSERT INTO t1 SET a=1; +FLUSH TABLE t1 FOR EXPORT; +UNLOCK TABLES; + +let INDEX_ID= `select INDEX_ID FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1")`; + +let FLAG= `SELECT flag FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE NAME="innodb_system"`; + +let $shutdown_timeout=0; +--source include/shutdown_mysqld.inc +let $resultlog=$MYSQLTEST_VARDIR/tmp/result.log; +let $resultlog_1=$MYSQLTEST_VARDIR/tmp/result_1.log; + +exec $INNOCHECKSUM -S -r $MYSQLD_DATADIR/ibdata1 > $resultlog; +--echo # Skip InnoDB Doublewrite Buffer +exec $INNOCHECKSUM -S $MYSQLD_DATADIR/ibdata1 > $resultlog_1; + +perl; +use strict; +use warnings; +use File::Spec::Functions qw(catfile); + +sub check_index_in_file { + my ($filename, $search_id, $file_desc, $expect_found) = @_; + my $found = 0; + open(my $fh, '<', $filename) or die "Could not open file '$filename': $!\n"; + my $line_count = 0; + while (my $line = <$fh>) { + $line_count++; + chomp $line; + # Skip empty lines and header lines + next if $line =~ /^\s*$/; + next if $line =~ /index_id.*#pages/; # Skip header line + # Split the line by whitespace + my @fields = grep { $_ ne '' } split(/\s+/, $line); + next unless @fields; # Skip if no fields + # The first field is the index_id + my $current_id = $fields[0]; + # Check if this is the ID we're looking for + if (defined $current_id && $current_id eq $search_id) { + $found = 1; + last; + } + } + close $fh; + + if ($found != $expect_found) { + print "\n=== UNEXPECTED RESULT - SHOWING FILE CONTENTS ($file_desc) ===\n"; + open($fh, '<', $filename) or die "Cannot reopen file: $!"; + print while <$fh>; + close $fh; + print "=== END OF FILE ===\n\n"; + } +} + +my $search_id = $ENV{'INDEX_ID'}; + +# Define file paths +my $resultlog = catfile($ENV{'MYSQLTEST_VARDIR'}, 'tmp', 'result.log'); +my $resultlog_1 = catfile($ENV{'MYSQLTEST_VARDIR'}, 'tmp', 'result_1.log'); + +# Check both files +print "Should not exist when summary excludes dblwr pages\n"; +check_index_in_file($resultlog, $search_id, 'result.log', 0); + +print "Should exist when summary includes dblwr pages\n"; +check_index_in_file($resultlog_1, $search_id, 'result_1.log', 1); +EOF + +remove_file $resultlog; +remove_file $resultlog_1; + +# We expect deterministic checksum error when we pass +# incorrect wrong flags to innochecksum. Below restart is needed +# to make sure that we flush all the pages. +--source include/start_mysqld.inc +CREATE TABLE ibd_1(f1 INT PRIMARY KEY)ENGINE=InnoDB; +INSERT INTO ibd_1 VALUES(1), (2), (3), (4); + +disable_warnings; +SET GLOBAL innodb_file_per_table=0; +enable_warnings; +CREATE TABLE ibd_2(f1 INT PRIMARY KEY)ENGINE=InnoDB; +INSERT INTO ibd_2 SELECT seq FROM seq_1_to_8451; + +let $shutdown_timeout=; +--source include/shutdown_mysqld.inc +--echo # Pass wrong tablespace flag for ibdata2 +--error 1 +exec $INNOCHECKSUM -S --tablespace_flags=39 $MYSQLD_DATADIR/ibdata2 > $resultlog 2>&1; + +let SEARCH_FILE=$resultlog; +let SEARCH_PATTERN=Error: Page 0 checksum mismatch; +--source include/search_pattern_in_file.inc +remove_file $resultlog; + +--echo # Pass wrong tablespace flag for ibdata1 +--error 1 +exec $INNOCHECKSUM -S --tablespace_flags=39 $MYSQLD_DATADIR/ibdata1 > $resultlog 2>&1; + +let SEARCH_PATTERN=Error: Mismatch between provided tablespace flags; +--source include/search_pattern_in_file.inc +remove_file $resultlog; + +--echo # Pass invalid tablespace flag for ibdata1 +--error 1 +exec $INNOCHECKSUM -S --tablespace_flags=89 $MYSQLD_DATADIR/ibdata1 > $resultlog 2>&1; + +let SEARCH_PATTERN=Error: Provided --tablespace-flags is not valid; +--source include/search_pattern_in_file.inc +remove_file $resultlog; + +--echo # innochecksum should be succesfull +exec $INNOCHECKSUM -S --tablespace_flags=$FLAG $MYSQLD_DATADIR/ibdata2 > $resultlog 2>&1; + +let SEARCH_PATTERN=Fail; +--source include/search_pattern_in_file.inc + +--echo # Create a tablespace with page number > 2^31 +--let $ibdata3 = $MYSQLD_DATADIR/ibdata3 +perl; +do "$ENV{MTR_SUITE_DIR}/include/crc32.pl"; +my $polynomial = 0x82f63b78; # CRC-32C +my $ps = 16384; # Default InnoDB page size +my $page_num = 2147483649; # 2^31 + 1 +my $filename = "$ENV{MYSQLD_DATADIR}/ibdata3"; + +# Create a zero-filled page +my $page = "\0" x $ps; + +# Set page number (FIL_PAGE_OFFSET) +substr($page, 4, 4) = pack('NN', $page_num); +# Set a valid LSN (log sequence number) +my $lsn = 0x12345678; +substr($page, 16, 8) = pack('NN', $lsn & 0xFFFFFFFF, $lsn >> 32); + +# Calculate the checksum +my $checksum = pack('N', + mycrc32(substr($page, 4, 22), 0, $polynomial) ^ + mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial) +); +# Write the checksum at the beginning (FIL_PAGE_SPACE_OR_CHKSUM) +# and at the end (FIL_PAGE_END_LSN_OLD_CHKSUM) of the page +substr($page, 0, 4) = $checksum; +substr($page, $ps - 8, 4) = $checksum; + +# Write the page to file +open(my $fh, '>', $filename) or die "Could not open file $filename: $!"; +binmode $fh; +print $fh $page; +close $fh; +EOF + +--echo # Test innochecksum with the modified ibdata3 +--error 1 +exec $INNOCHECKSUM -S $ibdata3 > $resultlog 2>&1; +let SEARCH_PATTERN=Error: First page of the tablespace file should be 0, but encountered page number 2147483649; +--source include/search_pattern_in_file.inc +remove_file $resultlog; + +--echo # Test innochecksum with the modified ibdata3 with tablespace flags +--error 1 +exec $INNOCHECKSUM -S --tablespace_flags=$FLAG $ibdata3 > $resultlog 2>&1; +let SEARCH_PATTERN=Exceeded the maximum allowed checksum mismatch; +--source include/search_pattern_in_file.inc + +remove_file $ibdata3; +--source include/start_mysqld.inc +DROP TABLE t1, ibd_1, ibd_2; +remove_file $resultlog; diff --git a/mysql-test/suite/innodb/t/undo_leak_fail.test b/mysql-test/suite/innodb/t/undo_leak_fail.test index 30ca437025d..6c9dd86c498 100644 --- a/mysql-test/suite/innodb/t/undo_leak_fail.test +++ b/mysql-test/suite/innodb/t/undo_leak_fail.test @@ -54,7 +54,8 @@ let $shutdown_timeout=; let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; --source include/search_pattern_in_file.inc -SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0; +SELECT NAME, IF(file_size>=14680064,'ok',file_size) +FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0; SET GLOBAL innodb_fast_shutdown= 0; --echo # Fail to free the segment while finding the used segments diff --git a/mysql-test/suite/innodb_fts/r/misc_debug2.result b/mysql-test/suite/innodb_fts/r/misc_debug2.result index 9601e8fc82e..63e8710b3d5 100644 --- a/mysql-test/suite/innodb_fts/r/misc_debug2.result +++ b/mysql-test/suite/innodb_fts/r/misc_debug2.result @@ -1,10 +1,14 @@ call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded."); call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded."); +call mtr.add_suppression("\\[Warning\\] option 'innodb-ft-min-token-size': unsigned value 0 adjusted to 1"); CREATE TABLE mdev21563(f1 VARCHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB; set debug_dbug="+d,fts_instrument_sync_request"; INSERT INTO mdev21563 VALUES('This is a test'); ALTER TABLE mdev21563 DISCARD TABLESPACE; -# restart +# restart: --innodb_ft_min_token_size=0 +SELECT @@global.innodb_ft_min_token_size; +@@global.innodb_ft_min_token_size +1 DROP TABLE mdev21563; # # MDEV-29342 Assertion failure in file que0que.cc line 728 diff --git a/mysql-test/suite/innodb_fts/t/misc_debug2.test b/mysql-test/suite/innodb_fts/t/misc_debug2.test index 946700e3229..5766beb5f50 100644 --- a/mysql-test/suite/innodb_fts/t/misc_debug2.test +++ b/mysql-test/suite/innodb_fts/t/misc_debug2.test @@ -3,12 +3,15 @@ --source include/not_embedded.inc call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded."); call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded."); +call mtr.add_suppression("\\[Warning\\] option 'innodb-ft-min-token-size': unsigned value 0 adjusted to 1"); CREATE TABLE mdev21563(f1 VARCHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB; set debug_dbug="+d,fts_instrument_sync_request"; INSERT INTO mdev21563 VALUES('This is a test'); ALTER TABLE mdev21563 DISCARD TABLESPACE; +--let $restart_parameters=--innodb_ft_min_token_size=0 --source include/restart_mysqld.inc +SELECT @@global.innodb_ft_min_token_size; DROP TABLE mdev21563; --echo # @@ -21,6 +24,7 @@ set debug_dbug="+d,fts_instrument_sync_request"; INSERT INTO t1 VALUES('test'); set debug_dbug=@save_dbug; INSERT INTO t1 VALUES('This is a fts issue'); +let $restart_parameters=; --source include/restart_mysqld.inc set debug_dbug="+d,fts_instrument_sync_request"; UPDATE t1 SET f1="mariadb"; diff --git a/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result b/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result index 2263c484041..40b5e49c525 100644 --- a/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result +++ b/mysql-test/suite/innodb_gis/r/innodb_gis_rtree.result @@ -1655,3 +1655,8 @@ DROP TABLE t1; # # End of 10.1 tests # +CREATE TABLE t1 (c POINT NOT NULL,SPATIAL (c)); +INSERT INTO t1 VALUES (ST_GEOMFROMTEXT ('POINT(1 0)')); +UPDATE t1 SET c=''; +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_2.result b/mysql-test/suite/innodb_zip/r/innochecksum_2.result index e80aad11a5b..7225bfffae1 100644 --- a/mysql-test/suite/innodb_zip/r/innochecksum_2.result +++ b/mysql-test/suite/innodb_zip/r/innochecksum_2.result @@ -14,6 +14,12 @@ INSERT INTO t1 SELECT * from t1; INSERT INTO t1 SELECT * from t1; INSERT INTO t1 SELECT * from t1; INSERT INTO t1 SELECT * from t1; +CREATE TABLE t2 (j LONGBLOB) ENGINE = InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +CREATE TABLE t3 (j LONGBLOB) ENGINE = InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +CREATE TABLE t4(c1 INT PRIMARY KEY,c2 VARCHAR(20), +INDEX(c2(10))) ENGINE=InnoDB; # stop the server Variables (--variable-name=value) @@ -35,6 +41,7 @@ log (No default value) leaf FALSE merge 0 skip-freed-pages FALSE +tablespace-flags 4294967295 [1]:# check the both short and long options for "help" [2]:# Run the innochecksum when file isn't provided. # It will print the innochecksum usage similar to --help option. @@ -69,6 +76,9 @@ See https://mariadb.com/kb/en/library/innochecksum/ for usage hints. pages -r, --skip-freed-pages skip freed pages for the tablespace + --tablespace-flags=# + InnoDB tablespace flags (default: 4294967295 = read from + page 0) Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) @@ -88,10 +98,12 @@ log (No default value) leaf FALSE merge 0 skip-freed-pages FALSE +tablespace-flags 4294967295 [3]:# check the both short and long options for "count" and exit Number of pages:# Number of pages:# [4]:# Print the version of innochecksum and exit innochecksum from #.#.#-MariaDB, client #.# for OS (ARCH) +[5]:# check t1.ibd and t2.ibd summary with and without tablespace_flags # Restart the DB server -DROP TABLE t1; +DROP TABLE t4, t3, t2, t1; diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_3.result b/mysql-test/suite/innodb_zip/r/innochecksum_3.result index 0e5e4d2d7f7..af37f4d5df5 100644 --- a/mysql-test/suite/innodb_zip/r/innochecksum_3.result +++ b/mysql-test/suite/innodb_zip/r/innochecksum_3.result @@ -140,6 +140,7 @@ log (No default value) leaf FALSE merge 0 skip-freed-pages FALSE +tablespace-flags 4294967295 [5]: Page type dump for with shortform for tab1.ibd diff --git a/mysql-test/suite/innodb_zip/t/innochecksum_2.opt b/mysql-test/suite/innodb_zip/t/innochecksum_2.opt index ac26eca328c..af67edaab10 100644 --- a/mysql-test/suite/innodb_zip/t/innochecksum_2.opt +++ b/mysql-test/suite/innodb_zip/t/innochecksum_2.opt @@ -1 +1,2 @@ --skip-innodb-doublewrite +--innodb_sys_tablespaces diff --git a/mysql-test/suite/innodb_zip/t/innochecksum_2.test b/mysql-test/suite/innodb_zip/t/innochecksum_2.test index f6b0e5de252..8101d96eecb 100644 --- a/mysql-test/suite/innodb_zip/t/innochecksum_2.test +++ b/mysql-test/suite/innodb_zip/t/innochecksum_2.test @@ -25,6 +25,23 @@ while ($i > 0) { dec $i; } +CREATE TABLE t2 (j LONGBLOB) ENGINE = InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; + +CREATE TABLE t3 (j LONGBLOB) ENGINE = InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; + +CREATE TABLE t4(c1 INT PRIMARY KEY,c2 VARCHAR(20), + INDEX(c2(10))) ENGINE=InnoDB; + +let FLAG= `SELECT flag FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE NAME="test/t1"`; + +let FLAG2= `SELECT flag FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE NAME="test/t2"`; + +let FLAG3= `SELECT flag FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE NAME="test/t3"`; + +let FLAG4= `SELECT flag FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE NAME="test/t4"`; + --echo # stop the server --source include/shutdown_mysqld.inc @@ -81,9 +98,23 @@ EOF --echo [4]:# Print the version of innochecksum and exit --replace_regex /for \S+/for OS/ /\d+/#/ /#[-_A-Za-z0-9]*-MariaDB,/#-MariaDB,/ /\(.*\)/(ARCH)/ /^.*innochecksum(\.exe)?/innochecksum/ ---exec $INNOCHECKSUM -V $MYSQLD_DATADIR/test/t1.ibd +--exec $INNOCHECKSUM -V +--echo [5]:# check t1.ibd and t2.ibd summary with and without tablespace_flags +let $resultlog=$MYSQLTEST_VARDIR/tmp/result.log; +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t1.ibd -s 3 -e 5 > $resultlog +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t2.ibd -s 3 -e 5 > $resultlog +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t3.ibd -s 3 -e 5 > $resultlog +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t4.ibd -s 3 -e 5 > $resultlog + + +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t1.ibd --tablespace_flags=$FLAG -s 3 -e 5 > $resultlog +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t2.ibd --tablespace_flags=$FLAG2 -s 3 -e 5 > $resultlog +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t3.ibd --tablespace_flags=$FLAG3 -s 3 -e 5 > $resultlog +--exec $INNOCHECKSUM -S $MYSQLD_DATADIR/test/t4.ibd --tablespace_flags=$FLAG4 -s 3 -e 5 > $resultlog + +remove_file $resultlog; --echo # Restart the DB server --source include/start_mysqld.inc -DROP TABLE t1; +DROP TABLE t4, t3, t2, t1; diff --git a/mysql-test/suite/json/r/json_table.result b/mysql-test/suite/json/r/json_table.result index bd977b8267b..484610574a3 100644 --- a/mysql-test/suite/json/r/json_table.result +++ b/mysql-test/suite/json/r/json_table.result @@ -373,7 +373,7 @@ id intcol 3 5678 4 5678 Warnings: -Warning 1366 Incorrect integer value: 'asd' for column ``.`(temporary)`.`intcol` at row 1 +Warning 1366 Incorrect integer value: 'asd' for column `*any*`.`json_table`.`intcol` at row 1 SELECT COUNT(*) FROM JSON_TABLE('[1, 2]', '$[*]' COLUMNS( I INT PATH '$')) tt; COUNT(*) 2 @@ -931,7 +931,7 @@ id intcol 3 5678 4 5678 Warnings: -Warning 1366 Incorrect integer value: 'asd' for column ``.`(temporary)`.`intcol` at row 1 +Warning 1366 Incorrect integer value: 'asd' for column `*any*`.`json_table`.`intcol` at row 1 # # MDEV-25377 JSON_TABLE: Wrong value with implicit conversion. # @@ -941,7 +941,7 @@ converted original 1 1 127 1000 Warnings: -Warning 1366 Incorrect integer value: 'foo' for column ``.`(temporary)`.`converted` at row 1 +Warning 1366 Incorrect integer value: 'foo' for column `*any*`.`json_table`.`converted` at row 1 Warning 1264 Out of range value for column 'converted' at row 3 select * from json_table('{"a":"foo", "b":1, "c":1000}', '$.*' columns(converted tinyint path '$', original text path '$')) as jt order by converted; converted original @@ -949,9 +949,9 @@ converted original 1 1 127 1000 Warnings: -Warning 1366 Incorrect integer value: 'foo' for column ``.`(temporary)`.`converted` at row 1 +Warning 1366 Incorrect integer value: 'foo' for column `*any*`.`json_table`.`converted` at row 1 Warning 1264 Out of range value for column 'converted' at row 1 -Warning 1366 Incorrect integer value: 'foo' for column ``.`(temporary)`.`converted` at row 1 +Warning 1366 Incorrect integer value: 'foo' for column `*any*`.`json_table`.`converted` at row 1 Warning 1264 Out of range value for column 'converted' at row 3 select * from json_table('{"a":"foo", "b":1, "c":1000}', '$.*' columns(converted tinyint path '$', original text path '$')) as jt order by original; converted original @@ -960,7 +960,7 @@ converted original 0 foo Warnings: Warning 1264 Out of range value for column 'converted' at row 2 -Warning 1366 Incorrect integer value: 'foo' for column ``.`(temporary)`.`converted` at row 3 +Warning 1366 Incorrect integer value: 'foo' for column `*any*`.`json_table`.`converted` at row 3 select * from json_table('[{"color": "blue", "price": { "high": 10, "low": 5}}, {"color": "white", "price": "pretty low"}, @@ -1218,6 +1218,22 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp # End of 10.9 tests # # +# MDEV-27898 CREATE VIEW AS SELECT FROM JSON_TABLE column requires global privileges +# +create view v1 as (select * from +json_table('[{"a":"1"}]', '$[*]' columns(a int path '$.a') ) as jt); +create user u1@localhost; +grant ALL on test.* to u1@localhost; +connect con1,localhost,u1,,test; +create view v2 as +(select * from json_table('[{"a":"1"}]', '$[*]' columns(a int path '$.a') ) as jt); +disconnect con1; +connection default; +DROP VIEW v2; +DROP VIEW v1; +DROP USER u1@localhost; +# End of 10.11 tests +# # MDEV-29390: Improve coverage for UPDATE and DELETE statements in MTR test suites # # Multi-update with JSON_TABLE diff --git a/mysql-test/suite/json/r/json_table_mysql.result b/mysql-test/suite/json/r/json_table_mysql.result index b9f39dbeb3c..567482b6f65 100644 --- a/mysql-test/suite/json/r/json_table_mysql.result +++ b/mysql-test/suite/json/r/json_table_mysql.result @@ -62,8 +62,8 @@ id jpath_i jpath_r jsn_path jexst 4 0 0.33 0.33 0 5 0 0 "asd" 0 Warnings: -Warning 1366 Incorrect integer value: 'asd' for column ``.`(temporary)`.`jpath_i` at row 5 -Warning 1366 Incorrect double value: 'asd' for column ``.`(temporary)`.`jpath_r` at row 5 +Warning 1366 Incorrect integer value: 'asd' for column `*any*`.`json_table`.`jpath_i` at row 5 +Warning 1366 Incorrect double value: 'asd' for column `*any*`.`json_table`.`jpath_r` at row 5 select * from json_table( '[{"x":"3"},{"a":2},{"b":1},{"a":0},{"a":[1,2]}]', @@ -410,7 +410,7 @@ SELECT * FROM JSON_TABLE('"asdf"', a 0 Warnings: -Warning 1366 Incorrect integer value: 'asdf' for column ``.`(temporary)`.`a` at row 1 +Warning 1366 Incorrect integer value: 'asdf' for column `*any*`.`json_table`.`a` at row 1 SELECT * FROM JSON_TABLE('[{"a":1},{"a":2}]', '$' COLUMNS (a INT PATH '$[*].a' ERROR ON ERROR)) AS jt; @@ -547,9 +547,9 @@ tm dt i f d Warnings: Warning 1265 Data truncated for column 'tm' at row 1 Warning 1265 Data truncated for column 'dt' at row 1 -Warning 1366 Incorrect integer value: 'asdf' for column ``.`(temporary)`.`i` at row 1 -Warning 1366 Incorrect double value: 'asdf' for column ``.`(temporary)`.`f` at row 1 -Warning 1366 Incorrect decimal value: 'asdf' for column ``.`(temporary)`.`d` at row 1 +Warning 1366 Incorrect integer value: 'asdf' for column `*any*`.`json_table`.`i` at row 1 +Warning 1366 Incorrect double value: 'asdf' for column `*any*`.`json_table`.`f` at row 1 +Warning 1366 Incorrect decimal value: 'asdf' for column `*any*`.`json_table`.`d` at row 1 SELECT * FROM JSON_TABLE('{}', '$' COLUMNS (x INT PATH '$.x' DEFAULT NULL ON EMPTY)) jt; x @@ -865,8 +865,8 @@ col18 0.000 0.000 Warnings: -Warning 1366 Incorrect decimal value: 'asdf' for column ``.`(temporary)`.`col18` at row 1 -Warning 1366 Incorrect decimal value: 'ghjk' for column ``.`(temporary)`.`col18` at row 2 +Warning 1366 Incorrect decimal value: 'asdf' for column `*any*`.`json_table`.`col18` at row 1 +Warning 1366 Incorrect decimal value: 'ghjk' for column `*any*`.`json_table`.`col18` at row 2 CREATE TABLE t1(jd JSON); INSERT INTO t1 VALUES('["asdf"]'),('["ghjk"]'); SELECT * FROM t1, @@ -878,8 +878,8 @@ jd col18 ["asdf"] 0.000 ["ghjk"] 0.000 Warnings: -Warning 1366 Incorrect decimal value: 'asdf' for column ``.`(temporary)`.`col18` at row 1 -Warning 1366 Incorrect decimal value: 'ghjk' for column ``.`(temporary)`.`col18` at row 1 +Warning 1366 Incorrect decimal value: 'asdf' for column `*any*`.`json_table`.`col18` at row 1 +Warning 1366 Incorrect decimal value: 'ghjk' for column `*any*`.`json_table`.`col18` at row 1 DROP TABLE t1; # # Bug#25540027: SIG 11 IN FIND_FIELD_IN_TABLE | SQL/SQL_BASE.CC diff --git a/mysql-test/suite/json/t/json_table.test b/mysql-test/suite/json/t/json_table.test index ba582ee44f2..0614b678048 100644 --- a/mysql-test/suite/json/t/json_table.test +++ b/mysql-test/suite/json/t/json_table.test @@ -1045,6 +1045,29 @@ COLUMNS --echo # End of 10.9 tests --echo # +--echo # +--echo # MDEV-27898 CREATE VIEW AS SELECT FROM JSON_TABLE column requires global privileges +--echo # + +create view v1 as (select * from + json_table('[{"a":"1"}]', '$[*]' columns(a int path '$.a') ) as jt); + +create user u1@localhost; +grant ALL on test.* to u1@localhost; + +--connect (con1,localhost,u1,,test) + +create view v2 as + (select * from json_table('[{"a":"1"}]', '$[*]' columns(a int path '$.a') ) as jt); + +disconnect con1; +connection default; +DROP VIEW v2; +DROP VIEW v1; +DROP USER u1@localhost; + +--echo # End of 10.11 tests + --echo # --echo # MDEV-29390: Improve coverage for UPDATE and DELETE statements in MTR test suites --echo # diff --git a/mysql-test/suite/maria/maria-gis-rtree.result b/mysql-test/suite/maria/maria-gis-rtree.result index 07401db4403..ed13678352a 100644 --- a/mysql-test/suite/maria/maria-gis-rtree.result +++ b/mysql-test/suite/maria/maria-gis-rtree.result @@ -1484,3 +1484,8 @@ COUNT(*) 2 DROP TABLE t1; End of 5.0 tests. +CREATE TABLE t1 (c POINT NOT NULL,SPATIAL (c)); +INSERT INTO t1 VALUES (ST_GEOMFROMTEXT ('POINT(1 0)')); +UPDATE t1 SET c=''; +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field +DROP TABLE t1; diff --git a/mysql-test/suite/maria/maria-gis-rtree.test b/mysql-test/suite/maria/maria-gis-rtree.test index 6c82108ecb0..946eeb61565 100644 --- a/mysql-test/suite/maria/maria-gis-rtree.test +++ b/mysql-test/suite/maria/maria-gis-rtree.test @@ -886,3 +886,13 @@ SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE DROP TABLE t1; --echo End of 5.0 tests. + +# +# Bug #31766 SIGSEGV in maria_rtree_split_page | maria_rtree_add_key +# + +CREATE TABLE t1 (c POINT NOT NULL,SPATIAL (c)); +INSERT INTO t1 VALUES (ST_GEOMFROMTEXT ('POINT(1 0)')); +--error ER_CANT_CREATE_GEOMETRY_OBJECT +UPDATE t1 SET c=''; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/partition.result b/mysql-test/suite/maria/partition.result index 929c6bab22e..7e563a6b75f 100644 --- a/mysql-test/suite/maria/partition.result +++ b/mysql-test/suite/maria/partition.result @@ -2,3 +2,18 @@ CREATE TABLE t (a INT, KEY(a)) ENGINE=Aria PARTITION BY KEY(a) PARTITIONS 2; SELECT * FROM t PARTITION (p1); a DROP TABLE t; +CREATE TABLE t (a INT KEY) ENGINE=Aria PARTITION BY LIST (a) ( +PARTITION p0 VALUES IN (1,2), +PARTITION p1 VALUES IN (3,4) +); +CREATE TABLE t1 (a INT KEY) ENGINE=Aria; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (3); +Swap table t1 and partition p0 of table t. +FLUSH TABLES; +REPAIR TABLE t; +Table Op Msg_type Msg_text +test.t repair warning Moved 1 misplaced rows +test.t repair status OK +DROP TABLE t; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/partition.test b/mysql-test/suite/maria/partition.test index 86f976a05e7..f206b6ca9e1 100644 --- a/mysql-test/suite/maria/partition.test +++ b/mysql-test/suite/maria/partition.test @@ -9,3 +9,37 @@ CREATE TABLE t (a INT, KEY(a)) ENGINE=Aria PARTITION BY KEY(a) PARTITIONS 2; SELECT * FROM t PARTITION (p1); DROP TABLE t; + + +# +# MDEV-33190 +# Errors or assertion failure upon REPAIR on partitioned Aria table with misplaced rows +# + +CREATE TABLE t (a INT KEY) ENGINE=Aria PARTITION BY LIST (a) ( + PARTITION p0 VALUES IN (1,2), + PARTITION p1 VALUES IN (3,4) +); + +CREATE TABLE t1 (a INT KEY) ENGINE=Aria; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (3); + +--echo Swap table t1 and partition p0 of table t. +FLUSH TABLES; +let $datadir=`select @@datadir`; + +move_file $datadir/test/t1.MAD $datadir/test/tmp.MAD; +move_file $datadir/test/t1.MAI $datadir/test/tmp.MAI; + +move_file $datadir/test/t#P#p0.MAD $datadir/test/t1.MAD; +move_file $datadir/test/t#P#p0.MAI $datadir/test/t1.MAI; + +move_file $datadir/test/tmp.MAD $datadir/test/t#P#p0.MAD; +move_file $datadir/test/tmp.MAI $datadir/test/t#P#p0.MAI; + +REPAIR TABLE t; + +DROP TABLE t; +DROP TABLE t1; + diff --git a/mysql-test/suite/merge/merge.result b/mysql-test/suite/merge/merge.result index be8eae52cd9..bb149944895 100644 --- a/mysql-test/suite/merge/merge.result +++ b/mysql-test/suite/merge/merge.result @@ -3928,6 +3928,46 @@ drop table tm, t; # End of 10.8 tests # # +# MDEV-35816 ASAN use-after-poison in st_select_lex::print +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5); +SET SESSION optimizer_trace = 'enabled=on'; +PREPARE stmt FROM 'SELECT STRAIGHT_JOIN * FROM t1 WHERE a IN (WITH cte AS (SELECT a FROM t1) SELECT * FROM cte)'; +EXECUTE stmt; +a +1 +2 +3 +4 +5 +EXECUTE stmt; +a +1 +2 +3 +4 +5 +PREPARE nested FROM 'SELECT STRAIGHT_JOIN * FROM t1 WHERE a IN (WITH cte AS (WITH cte2 AS (SELECT a FROM t1) SELECT * from cte2) SELECT * FROM cte)'; +EXECUTE nested; +a +1 +2 +3 +4 +5 +EXECUTE nested; +a +1 +2 +3 +4 +5 +DROP TABLE t1; +# +# End of 10.11 tests +# +# # MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost # CREATE TABLE t1 (a TIMESTAMP, KEY(a)) ENGINE=MRG_MyISAM; @@ -3992,4 +4032,3 @@ UPDATE v1 SET a=0; DROP VIEW v1; DROP TABLE t1; # End of 11.1 tests -ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci; diff --git a/mysql-test/suite/merge/merge.test b/mysql-test/suite/merge/merge.test index 5f04e80b4f9..deae06fe1c1 100644 --- a/mysql-test/suite/merge/merge.test +++ b/mysql-test/suite/merge/merge.test @@ -2890,6 +2890,24 @@ drop table tm, t; --echo # End of 10.8 tests --echo # +--echo # +--echo # MDEV-35816 ASAN use-after-poison in st_select_lex::print +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5); +SET SESSION optimizer_trace = 'enabled=on'; +PREPARE stmt FROM 'SELECT STRAIGHT_JOIN * FROM t1 WHERE a IN (WITH cte AS (SELECT a FROM t1) SELECT * FROM cte)'; +EXECUTE stmt; +EXECUTE stmt; +PREPARE nested FROM 'SELECT STRAIGHT_JOIN * FROM t1 WHERE a IN (WITH cte AS (WITH cte2 AS (SELECT a FROM t1) SELECT * from cte2) SELECT * FROM cte)'; +EXECUTE nested; +EXECUTE nested; +DROP TABLE t1; + +--echo # +--echo # End of 10.11 tests +--echo # + --echo # --echo # MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost --echo # @@ -2949,5 +2967,3 @@ DROP VIEW v1; DROP TABLE t1; --echo # End of 11.1 tests - ---source include/test_db_charset_restore.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_backup_worker_retry.result b/mysql-test/suite/rpl/r/rpl_parallel_backup_worker_retry.result new file mode 100644 index 00000000000..a07f8dd68fb --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_backup_worker_retry.result @@ -0,0 +1,49 @@ +include/master-slave.inc +[connection master] +# +# MDEV-37453 Parallel Replication Crash During Backup +# +connection master; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE = innodb; +INSERT INTO t1 VALUES (1, 0); +INSERT INTO t1 VALUES (2, 0); +connection slave; +include/stop_slave.inc +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +SET @old_parallel_threads = @@GLOBAL.slave_parallel_threads; +SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode; +SET @@global.slave_parallel_threads= 2; +SET @@global.slave_parallel_mode = 'optimistic'; +connection master; +begin /* trx1 */; +delete from t1 where a = 1; +update t1 set b = 1 where a = 2; +commit; +begin /* trx2 */; +delete from t1 where a = 2; +commit; +connect aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; +BEGIN; +DELETE FROM t1 WHERE a = 1; +connection slave; +include/start_slave.inc +connection aux_slave; +connect backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; +BACKUP STAGE START; +BACKUP STAGE BLOCK_COMMIT; +connection aux_slave; +ROLLBACK; +connection aux_slave; +connection backup_slave; +BACKUP STAGE END; +connection slave; +include/diff_tables.inc [master:t1,slave:t1] +connection slave; +include/stop_slave.inc +SET @@global.slave_parallel_threads= @old_parallel_threads; +SET @@global.slave_parallel_mode = @old_parallel_mode; +include/start_slave.inc +connection server_1; +DROP TABLE t1; +include/rpl_end.inc +# End of the tests diff --git a/mysql-test/suite/rpl/t/rpl_parallel_backup_worker_retry.test b/mysql-test/suite/rpl/t/rpl_parallel_backup_worker_retry.test new file mode 100644 index 00000000000..f3b6f84e833 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_backup_worker_retry.test @@ -0,0 +1,99 @@ +--source include/have_innodb.inc +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc + +--echo # +--echo # MDEV-37453 Parallel Replication Crash During Backup +--echo # + +# Retrying after parallel conflict transition must be able to do that +# cleanly despite possible "hard" Backup MDL lock in the way. +# The retrying transaction will complete successfully. +# The plot: +# Two transactions are run by two parallel workers. The 2nd (in binlog order) +# transaction depends on the 1st. +# 1. Block the 1st and let the 2nd reach +# Waiting-for-Prior-Transaction-to-Commit (WfPTtC). +# 2. At this point issue BACKUP commands of which BLOCK_COMMIT will +# later force the 2nd transaction to wait for the BACKUP MDL lock. +# 3. Release locks to the 1st transaction which would kick the 2nd out +# of waiting-for-prior-commit only to return negative from the +# BACKUP MDL acquisition attempt (found itself killed). +# 4. Finally, prove of safety: the 2nd transaction retries successfully. + +--connection master +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE = innodb; +INSERT INTO t1 VALUES (1, 0); +INSERT INTO t1 VALUES (2, 0); +--sync_slave_with_master +--source include/stop_slave.inc +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +SET @old_parallel_threads = @@GLOBAL.slave_parallel_threads; +SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode; +SET @@global.slave_parallel_threads= 2; +SET @@global.slave_parallel_mode = 'optimistic'; + +--connection master +begin /* trx1 */; + delete from t1 where a = 1; + update t1 set b = 1 where a = 2; +commit; +begin /* trx2 */; + delete from t1 where a = 2; +commit; + +--save_master_pos + +--connect (aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,) +BEGIN; +# block the 1st worker and wait for the 2nd ready to commit + DELETE FROM t1 WHERE a = 1; + +--connection slave +--source include/start_slave.inc + +--connection aux_slave +--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit" +--source include/wait_condition.inc + +# While the 1st worker is locked out run backup +--connect (backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,) +BACKUP STAGE START; +BACKUP STAGE BLOCK_COMMIT; + +# release the 1st work +--connection aux_slave +let $status_var= Slave_retried_transactions; +let $status_var_value= query_get_value(SHOW STATUS LIKE '$status_var', Value, 1); +--sleep 1 +ROLLBACK; + +# that will kick the 2nd out of the current WfPTtC into next retry one +--connection aux_slave +--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit" +--source include/wait_condition.inc + +let $status_var_comparsion= >; +--source include/wait_for_status_var.inc + +--connection backup_slave +BACKUP STAGE END; + +--connection slave +--sync_with_master + +--let $diff_tables= master:t1,slave:t1 +--source include/diff_tables.inc + +# Clean up. +--connection slave +--source include/stop_slave.inc +SET @@global.slave_parallel_threads= @old_parallel_threads; +SET @@global.slave_parallel_mode = @old_parallel_mode; +--source include/start_slave.inc + +--connection server_1 +DROP TABLE t1; + +--source include/rpl_end.inc +--echo # End of the tests diff --git a/mysql-test/suite/sys_vars/r/mdev_15935.result b/mysql-test/suite/sys_vars/r/mdev_15935.result index 551cd539db7..7feca48ab10 100644 --- a/mysql-test/suite/sys_vars/r/mdev_15935.result +++ b/mysql-test/suite/sys_vars/r/mdev_15935.result @@ -1,10 +1,10 @@ # # test cleanup of sys_var classes # -set global init_connect="................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."; -ERROR HY000: String '......................................................................' is too long for init_connect (should be no longer than 2000) -set global ft_boolean_syntax="................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."; -ERROR HY000: String '......................................................................' is too long for ft_boolean_syntax (should be no longer than 2000) +set global init_connect="................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."; +ERROR HY000: String '......................................................................' is too long for init_connect (should be no longer than 4096) +set global ft_boolean_syntax="................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."; +ERROR HY000: String '......................................................................' is too long for ft_boolean_syntax (should be no longer than 4096) # # end of test mdev_15935 # diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index f9becde1109..42c795a4d9a 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -794,7 +794,7 @@ DEFAULT_VALUE 3 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT InnoDB Fulltext search minimum token size in characters -NUMERIC_MIN_VALUE 0 +NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 16 NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL diff --git a/mysql-test/suite/sys_vars/r/thread_cache_size_func.result b/mysql-test/suite/sys_vars/r/thread_cache_size_func.result index 9cdacffaff1..c4b71197e43 100644 --- a/mysql-test/suite/sys_vars/r/thread_cache_size_func.result +++ b/mysql-test/suite/sys_vars/r/thread_cache_size_func.result @@ -1,25 +1,24 @@ SET @global_thread_cache_size = @@GLOBAL.thread_cache_size; -FLUSH STATUS; '# Test1#' SET @@GLOBAL.thread_cache_size=3; -SHOW STATUS LIKE 'Threads_cached'; -Variable_name Value -Threads_cached 0 -0 Expected +FLUSH THREADS; +select variable_value<=@@global.thread_cache_size from information_schema.global_status where variable_name="Threads_cached"; +variable_value<=@@global.thread_cache_size +1 CONNECT conn1,localhost,root,,; CONNECT conn2,localhost,root,,; CONNECT conn3,localhost,root,,; CONNECT conn4,localhost,root,,; connection default; -SHOW STATUS LIKE 'Threads_cached'; -Variable_name Value -Threads_cached 0 -0 Expected +select variable_value<=@@global.thread_cache_size from information_schema.global_status where variable_name="Threads_cached"; +variable_value<=@@global.thread_cache_size +1 disconnect conn1; disconnect conn2; disconnect conn3; disconnect conn4; SET @@GLOBAL.thread_cache_size= 1; +FLUSH THREADS; CONNECT conn1,localhost,root,,; CONNECT conn2,localhost,root,,; connection default; diff --git a/mysql-test/suite/sys_vars/t/mdev_15935.test b/mysql-test/suite/sys_vars/t/mdev_15935.test index 856a97e879c..ec5818fc0e2 100644 --- a/mysql-test/suite/sys_vars/t/mdev_15935.test +++ b/mysql-test/suite/sys_vars/t/mdev_15935.test @@ -2,7 +2,7 @@ --echo # test cleanup of sys_var classes --echo # ---let $long_string=`select repeat('.', 2001)` +--let $long_string=`select repeat('.', 4097)` --error ER_WRONG_STRING_LENGTH eval set global init_connect="$long_string"; --error ER_WRONG_STRING_LENGTH diff --git a/mysql-test/suite/sys_vars/t/thread_cache_size_func.test b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test index 9f4a45ec48c..d66d6cb2814 100644 --- a/mysql-test/suite/sys_vars/t/thread_cache_size_func.test +++ b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test @@ -31,12 +31,10 @@ --source include/one_thread_per_connection.inc SET @global_thread_cache_size = @@GLOBAL.thread_cache_size; -FLUSH STATUS; - -- ECHO '# Test1#' SET @@GLOBAL.thread_cache_size=3; -SHOW STATUS LIKE 'Threads_cached'; ---echo 0 Expected +FLUSH THREADS; +select variable_value<=@@global.thread_cache_size from information_schema.global_status where variable_name="Threads_cached"; ################################## # Make 4 connections # @@ -53,8 +51,7 @@ CONNECTION default; let $wait_condition= SELECT COUNT(*)= 5 FROM INFORMATION_SCHEMA.PROCESSLIST; --source include/wait_condition.inc -SHOW STATUS LIKE 'Threads_cached'; ---echo 0 Expected +select variable_value<=@@global.thread_cache_size from information_schema.global_status where variable_name="Threads_cached"; #################################### #Disconnecting all the connections # @@ -81,6 +78,7 @@ let $wait_condition= SELECT variable_value = 3 FROM INFORMATION_SCHEMA.global_st # Decreasing cache size to 1 # SET @@GLOBAL.thread_cache_size= 1; +FLUSH THREADS; CONNECT (conn1,localhost,root,,); CONNECT (conn2,localhost,root,,); diff --git a/mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result index 90d22d87f59..77c36da1af6 100644 --- a/mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result +++ b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result @@ -12,7 +12,7 @@ SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIK 'wsrep_provider_repl_proto_max', 'wsrep_provider_gmcast_listen_addr'); COUNT(*) -83 +84 SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider_%' AND VARIABLE_NAME NOT IN ( 'wsrep_provider', @@ -507,6 +507,21 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED GLOBAL_VALUE_PATH NULL +VARIABLE_NAME WSREP_PROVIDER_GCS_CHECK_APPL_PROTO +SESSION_VALUE NULL +GLOBAL_VALUE ON +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE ON +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Wsrep provider option +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST OFF,ON +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED +GLOBAL_VALUE_PATH NULL VARIABLE_NAME WSREP_PROVIDER_GCS_FC_DEBUG SESSION_VALUE NULL GLOBAL_VALUE 0 diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test index 78198051f34..1e0b6a49efc 100644 --- a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test +++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test @@ -1,7 +1,7 @@ --source include/have_wsrep.inc --source include/have_innodb.inc ---let $galera_version=26.4.21 +--let $galera_version=26.4.24 source include/check_galera_version.inc; SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%' AND VARIABLE_NAME NOT IN ( diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet4_plugin.result b/plugin/type_inet/mysql-test/type_inet/type_inet4_plugin.result index 291d4c2d05b..d494502123e 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet4_plugin.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet4_plugin.result @@ -24,8 +24,8 @@ PLUGIN_TYPE DATA TYPE PLUGIN_AUTHOR MariaDB Corporation PLUGIN_DESCRIPTION Data type INET4 PLUGIN_LICENSE GPL -PLUGIN_MATURITY Gamma -PLUGIN_AUTH_VERSION 1.0 +PLUGIN_MATURITY Stable +PLUGIN_AUTH_VERSION 1.0.1 # # End of 10.10 tests # diff --git a/plugin/type_inet/plugin.cc b/plugin/type_inet/plugin.cc index 38dad45a4f5..c530a7c2448 100644 --- a/plugin/type_inet/plugin.cc +++ b/plugin/type_inet/plugin.cc @@ -188,8 +188,8 @@ maria_declare_plugin(type_inet) 0x0100, // Numeric version 0xAABB means AA.BB version NULL, // Status variables NULL, // System variables - "1.0", // String version representation - MariaDB_PLUGIN_MATURITY_GAMMA // Maturity(see include/mysql/plugin.h)*/ + "1.0.1", // String version representation + MariaDB_PLUGIN_MATURITY_STABLE// Maturity(see include/mysql/plugin.h)*/ }, { MariaDB_DATA_TYPE_PLUGIN, // the plugin type (see include/mysql/plugin.h) diff --git a/scripts/mytop.sh b/scripts/mytop.sh index e5d926ef616..bf4e72eb92c 100644 --- a/scripts/mytop.sh +++ b/scripts/mytop.sh @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# $Id: mytop,v 1.99-maria6 2019/10/22 14:53:51 jweisbuch Exp $ +# $Id: mytop,v 1.99-maria8 2025/07/16 17:59:26 jweisbuch Exp $ =pod @@ -21,7 +21,7 @@ use Socket; use List::Util qw(min max); use File::Basename; -$main::VERSION = "1.99-maria6"; +$main::VERSION = "1.99-maria8"; my $path_for_script = dirname($0); $| = 1; @@ -256,7 +256,11 @@ if (eval {DBI->install_driver("MariaDB")}) { if ($config{socket} and -S $config{socket}) { - $dsn .= "${prefix}_socket=$config{socket}"; + $dsn .= "${prefix}_socket=$config{socket}"; +} +elsif($config{host} eq "localhost") +{ + $dsn .= "host=$config{host}"; } else { diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index 2077b502314..63ab899012e 100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -1267,6 +1267,13 @@ check_sockets_utils() lsof_available=0 sockstat_available=0 ss_available=0 + raw_socket_check=0 + + if [ -n "$(commandex selinuxenabled)" ] && selinuxenabled; then + raw_socket_check=1 + wsrep_log_info "/proc/net/tcp{,6} is being used directly to avoid excessive selinux AVC notices" + return 0 + fi socket_utility="$(commandex ss)" if [ -n "$socket_utility" ]; then @@ -1335,7 +1342,11 @@ check_port() local rc=2 # ENOENT - if [ $ss_available -ne 0 ]; then + if [ $raw_socket_check -ne 0 ]; then + for key in $(awk -v p="$port" 'BEGIN { hex_port = sprintf(":%04X", p) } $2 ~ hex_port && $4 == "0A" { print $10 }' /proc/net/tcp /proc/net/tcp6); do + return 0 + done + elif [ $ss_available -ne 0 ]; then $socket_utility $ss_opts -t "( sport = :$port )" 2>/dev/null | \ grep -q -E "[[:space:]]users:[[:space:]]?\\(.*\\(\"($utils)[^[:space:]]*\"[^)]*,pid=$pid(,[^)]*)?\\)" && rc=0 elif [ $sockstat_available -ne 0 ]; then diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 361cef4a9fc..5b7efbf3b60 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -105,7 +105,9 @@ check_pid_and_port() local final if ! check_port $pid "$port" "$utils"; then - if [ $ss_available -ne 0 -o $sockstat_available -ne 0 ]; then + if [ $raw_socket_check -ne 0 ]; then + return 1 + elif [ $ss_available -ne 0 -o $sockstat_available -ne 0 ]; then if [ $ss_available -ne 0 ]; then port_info=$($socket_utility $ss_opts -t "( sport = :$port )" 2>/dev/null | \ grep -E '[[:space:]]users:[[:space:]]?\(' | \ @@ -163,7 +165,10 @@ check_pid_and_port() fi fi - check_pid "$pid_file" && [ $CHECK_PID -eq $pid ] + if [ $raw_socket_check -ne 0 ]; then + return 0 + fi + check_pid "$pid_file" && [ "$CHECK_PID" -eq "$pid" ] } get_binlog diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index 4238cd90e02..f6e1f6b4ffc 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1371,30 +1371,13 @@ Event_job_data::execute(THD *thd, bool drop) wsrep_open(thd); wsrep_before_command(thd); #endif /* WITH_WSREP */ - /* - MySQL parser currently assumes that current database is either - present in THD or all names in all statements are fully specified. - And yet not fully specified names inside stored programs must be - be supported, even if the current database is not set: - CREATE PROCEDURE db1.p1() BEGIN CREATE TABLE t1; END// - -- in this example t1 should be always created in db1 and the statement - must parse even if there is no current database. - - To support this feature and still address the parser limitation, - we need to set the current database here. - We don't have to call mysql_change_db, since the checks performed - in it are unnecessary for the purpose of parsing, and - mysql_change_db will be invoked anyway later, to activate the - procedure database before it's executed. - */ - thd->set_db(&dbname); lex_start(thd); #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (event_sctx.change_security_context(thd, - &definer_user, &definer_host, - &dbname, &save_sctx)) + if (event_sctx.change_security_context(thd, &definer_user, &definer_host, + &dbname, &save_sctx) || + mysql_change_db(thd, &dbname, false)) { sql_print_error("Event Scheduler: " "[%s].[%s.%s] execution failed, " diff --git a/sql/gcalc_tools.cc b/sql/gcalc_tools.cc index 49d9a4ac58b..ae6076e992a 100644 --- a/sql/gcalc_tools.cc +++ b/sql/gcalc_tools.cc @@ -926,6 +926,7 @@ int Gcalc_operation_reducer::count_slice(Gcalc_scan_iterator *si) { add_poly_border(1, cur_t, prev_state, events); prev_state^= 1; + prev_range= prev_state ? cur_t : 0; } if (!events->is_bottom()) { diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index dcff7b03ddd..be37c095f7d 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2253,6 +2253,13 @@ int ha_partition::copy_partitions(ulonglong * const copied, } else { + if (m_new_file[new_part]->m_lock_type != F_WRLCK) + { + m_last_part= reorg_part; + m_err_rec= table->record[0]; + result= HA_ERR_ROW_IN_WRONG_PARTITION; + goto error; + } /* Copy record to new handler */ (*copied)++; DBUG_ASSERT(!m_new_file[new_part]->row_logging); @@ -10415,11 +10422,12 @@ void ha_partition::print_error(int error, myf errflag) } else if (error == HA_ERR_ROW_IN_WRONG_PARTITION) { - /* Should only happen on DELETE or UPDATE! */ + /* Should only happen on DELETE, UPDATE or REBUILD PARTITION! */ DBUG_ASSERT(thd_sql_command(thd) == SQLCOM_DELETE || thd_sql_command(thd) == SQLCOM_DELETE_MULTI || thd_sql_command(thd) == SQLCOM_UPDATE || - thd_sql_command(thd) == SQLCOM_UPDATE_MULTI); + thd_sql_command(thd) == SQLCOM_UPDATE_MULTI || + thd_sql_command(thd) == SQLCOM_ALTER_TABLE); DBUG_ASSERT(m_err_rec); if (m_err_rec) { @@ -12245,10 +12253,13 @@ int ha_partition::direct_delete_rows(ha_rows *delete_rows_result) file->pre_direct_delete_rows() : file->ha_direct_delete_rows(&delete_rows)))) { - if (m_pre_calling) - file->ha_pre_rnd_end(); - else - file->ha_rnd_end(); + if (rnd_seq) + { + if (m_pre_calling) + file->ha_pre_rnd_end(); + else + file->ha_rnd_end(); + } DBUG_RETURN(error); } delete_rows_result+= delete_rows; diff --git a/sql/handler.cc b/sql/handler.cc index 217f5a85bb4..49186b39376 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2126,15 +2126,17 @@ err: thd->rgi_slave->is_parallel_exec); } end: - if (mdl_backup.ticket) + // reset the pointer to the ticket when it's stack instantiated + if (thd->backup_commit_lock == &mdl_backup) { /* We do not always immediately release transactional locks after ha_commit_trans() (see uses of ha_enable_transaction()), thus we release the commit blocker lock as soon as it's not needed. - */ - thd->mdl_context.release_lock(mdl_backup.ticket); + */ + if (mdl_backup.ticket) + thd->mdl_context.release_lock(mdl_backup.ticket); thd->backup_commit_lock= 0; } #ifdef WITH_WSREP diff --git a/sql/item.h b/sql/item.h index c533006d386..3da4876e053 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4938,7 +4938,7 @@ public: } int save_in_field(Field *field, bool no_conversions) override; const Type_handler *type_handler() const override - { return &type_handler_varchar; } + { return Type_handler::string_type_handler(max_length); } Item *clone_item(THD *thd) const override; Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override { diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 58c18d066c3..6dc306fbbb3 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -264,6 +264,8 @@ public: bool fix_length_and_dec(THD *thd) override; void print(String *str, enum_query_type query_type) override; enum precedence precedence() const override { return CMP_PRECEDENCE; } + table_map not_null_tables() const override + { return is_top_level_item() ? not_null_tables_cache : 0; } bool count_sargable_conds(void *arg) override; SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override; SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field, diff --git a/sql/item_func.cc b/sql/item_func.cc index cc253aebec6..71089969640 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3245,7 +3245,10 @@ longlong Item_func_locate::val_int() start0= start= args[2]->val_int(); if ((start <= 0) || (start > a->length())) + { + null_value= args[2]->is_null(); return 0; + } start0--; start--; /* start is now sufficiently valid to pass to charpos function */ diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 0e59d50a188..dbc6c423153 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -5241,14 +5241,14 @@ bool Item_func_json_key_value::fix_length_and_dec(THD *thd) } -static bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited, +static bool create_hash(json_engine_t *value, HASH *items, bool &item_hash_inited, MEM_ROOT *hash_root) { int level= value->stack_p; if (my_hash_init(PSI_INSTRUMENT_ME, items, value->s.cs, 0, 0, 0, get_key_name, NULL, 0)) return true; - hash_inited= true; + item_hash_inited= true; while (json_scan_next(value) == 0 && value->stack_p >= level) { @@ -5317,6 +5317,11 @@ static bool get_current_value(json_engine_t *js, const uchar *&value_start, return false; } +static my_bool restore_entry(void *element, void *arg) +{ + HASH *items = (HASH*) arg; + return my_hash_insert(items, (const uchar*) element); +} /* If the outermost layer of JSON is an array, @@ -5329,14 +5334,16 @@ static bool get_current_value(json_engine_t *js, const uchar *&value_start, FALSE - if two array documents have intersection TRUE - If two array documents do not have intersection */ -static bool get_intersect_between_arrays(String *str, json_engine_t *value, - HASH items) +bool Item_func_json_array_intersect:: + get_intersect_between_arrays(String *str, json_engine_t *value, + HASH *items, HASH *seen) { bool res= true, has_value= false; int level= value->stack_p; - String temp_str(0); + temp_str.length(0); temp_str.append('['); + while (json_scan_next(value) == 0 && value->stack_p >= level) { const uchar *value_start= NULL; @@ -5372,14 +5379,14 @@ static bool get_intersect_between_arrays(String *str, json_engine_t *value, of times the value appears in the hash table. */ uchar * found= NULL; - if ((found= my_hash_search(&items, + if ((found= my_hash_search(items, (const uchar *) new_entry, strlen(new_entry)))) { has_value= true; temp_str.append( (const char*) value_start, value_len); temp_str.append(','); - if (my_hash_delete(&items, found)) + if (my_hash_delete(items, found) || my_hash_insert(seen, (const uchar *)found)) { free(new_entry); goto error; @@ -5398,6 +5405,8 @@ static bool get_intersect_between_arrays(String *str, json_engine_t *value, } error: + my_hash_iterate(seen, restore_entry, items); + my_hash_reset(seen); return res; } @@ -5416,12 +5425,14 @@ String* Item_func_json_array_intersect::val_str(String *str) { if (args[0]->null_value) goto null_return; - if (hash_inited) + if (item_hash_inited) my_hash_free(&items); + if (seen_hash_inited) + my_hash_free(&seen); if (root_inited) free_root(&hash_root, MYF(0)); root_inited= false; - hash_inited= false; + item_hash_inited= false; prepare_json_and_create_hash(&je1, js1); } @@ -5437,7 +5448,7 @@ String* Item_func_json_array_intersect::val_str(String *str) if (json_read_value(&je2) || je2.value_type != JSON_VALUE_ARRAY) goto error_return; - if (get_intersect_between_arrays(str, &je2, items)) + if (get_intersect_between_arrays(str, &je2, &items, &seen)) goto error_return; if (str->length()) @@ -5464,7 +5475,7 @@ null_return: return NULL; } -void Item_func_json_array_intersect::prepare_json_and_create_hash(json_engine_t *je1, String *js) +bool Item_func_json_array_intersect::prepare_json_and_create_hash(json_engine_t *je1, String *js) { json_scan_start(je1, js->charset(), (const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); @@ -5472,20 +5483,27 @@ void Item_func_json_array_intersect::prepare_json_and_create_hash(json_engine_t Scan value uses the hash table to get the intersection of two arrays. */ + if (my_hash_init(PSI_INSTRUMENT_ME, &seen, je1->s.cs, 0, 0, 0, + get_key_name, NULL, 0)) + return true; + seen_hash_inited= true; + if (!root_inited) init_alloc_root(PSI_NOT_INSTRUMENTED, &hash_root, 1024, 0, MYF(0)); root_inited= true; if (json_read_value(je1) || je1->value_type != JSON_VALUE_ARRAY || - create_hash(je1, &items, hash_inited, &hash_root)) + create_hash(je1, &items, item_hash_inited, &hash_root)) { if (je1->s.error) report_json_error(js, je1, 0); null_value= 1; } - max_length= (args[0]->max_length < args[1]->max_length) ? - args[0]->max_length : args[1]->max_length; + max_length= 2*(args[0]->max_length < args[1]->max_length ? + args[0]->max_length : args[1]->max_length); + + return false; } bool Item_func_json_array_intersect::fix_length_and_dec(THD *thd) @@ -5508,8 +5526,10 @@ bool Item_func_json_array_intersect::fix_length_and_dec(THD *thd) js1= args[0]->val_json(&tmp_js1); - if (js1) - prepare_json_and_create_hash(&je1, js1); + if (js1 && prepare_json_and_create_hash(&je1, js1)) + { + return TRUE; + } end: set_maybe_null(); diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index 14080b2b242..3d48cf95dd7 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -881,14 +881,15 @@ public: class Item_func_json_array_intersect: public Item_str_func { protected: - String tmp_js1, tmp_js2; - bool hash_inited, root_inited; - HASH items; + String tmp_js1, tmp_js2, temp_str; + bool item_hash_inited, seen_hash_inited, root_inited; + HASH items, seen; MEM_ROOT hash_root; bool parse_for_each_row; public: Item_func_json_array_intersect(THD *thd, Item *a, Item *b): - Item_str_func(thd, a, b) { hash_inited= root_inited= parse_for_each_row= false; } + Item_str_func(thd, a, b) + { item_hash_inited= seen_hash_inited= root_inited= parse_for_each_row= false; } String *val_str(String *) override; bool fix_length_and_dec(THD *thd) override; LEX_CSTRING func_name_cstring() const override @@ -901,12 +902,16 @@ public: void cleanup() override { Item_str_func::cleanup(); - if (hash_inited) + if (item_hash_inited) my_hash_free(&items); + if (seen_hash_inited) + my_hash_free(&seen); if (root_inited) free_root(&hash_root, MYF(0)); } - void prepare_json_and_create_hash(json_engine_t *je1, String *js); + bool prepare_json_and_create_hash(json_engine_t *je1, String *js); + bool get_intersect_between_arrays(String *str, json_engine_t *value, + HASH *items, HASH *seen); }; class Item_func_json_object_filter_keys: public Item_str_func diff --git a/sql/json_table.cc b/sql/json_table.cc index 96bb6e6c6b0..f51fd800b06 100644 --- a/sql/json_table.cc +++ b/sql/json_table.cc @@ -716,6 +716,8 @@ TABLE *Create_json_table::start(THD *thd, if (!(table= Create_tmp_table::start(thd, param, table_alias))) DBUG_RETURN(0); share= table->s; + share->db= any_db; + share->table_name= { STRING_WITH_LEN("json_table") }; share->not_usable_by_query_cache= FALSE; share->db_plugin= NULL; if (!(table->file= new (&table->mem_root) ha_json_table(share, jt))) diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index a5a6ace2b84..f22d1a43017 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -5354,7 +5354,11 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) slave_rows_error_report(ERROR_LEVEL, thd->is_error() ? 0 : error, rgi, thd, table, get_type_str(), RPL_LOG_NAME, log_pos); - if (thd->slave_thread) + if (thd->slave_thread +#ifdef WITH_WSREP + || (WSREP(thd) && wsrep_thd_is_applying(thd)) +#endif /* WITH_WSREP */ + ) free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC)); } diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index b2093625dc1..7c65f2ddcc8 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -6335,7 +6335,7 @@ Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond, } } - if (!cond) + if (!cond || cond->fix_fields_if_needed(thd, &cond)) return NULL; if (*cond_eq) @@ -6368,9 +6368,6 @@ Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond, if (cond && is_simplified_cond) cond= cond->remove_eq_conds(thd, cond_value, true); - if (cond && cond->fix_fields_if_needed(thd, NULL)) - return NULL; - return cond; } diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index 05bd6408fde..7ba30c51232 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -2420,7 +2420,7 @@ rpl_binlog_state::drop_domain(DYNAMIC_ARRAY *ids, // compose a sequence of unique pointers to domain object for (k= 0; k < domain_unique.elements; k++) { - if ((rpl_binlog_state::element*) dynamic_array_ptr(&domain_unique, k) + if (*(rpl_binlog_state::element**) dynamic_array_ptr(&domain_unique, k) == elem) break; // domain_id's elem has been already in } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 59a554a6482..1868c9c123a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -13229,6 +13229,13 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, DBUG_VOID_RETURN; } + /* JSON_TABLE and other db detached table */ + if (db == any_db.str) + { + grant->privilege= SELECT_ACL; + DBUG_VOID_RETURN; + } + /* global privileges */ grant->privilege= sctx->master_access; @@ -14436,22 +14443,9 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param, res= send_server_handshake_packet(mpvio, (char*) packet, packet_len); else if (mpvio->status == MPVIO_EXT::RESTART) res= send_plugin_request_packet(mpvio, packet, packet_len); - else if (packet_len > 0 && (*packet < 2 || *packet > 253)) - { - /* - we cannot allow plugin data packet to start from 0, 255 or 254 - - as the client will treat it as an OK, ERROR or "change plugin" packet. - We'll escape these bytes with \1. Consequently, we - have to escape \1 byte too. - */ + else /* plugin data, prefixed with 1 */ res= net_write_command(&mpvio->auth_info.thd->net, 1, (uchar*)"", 0, packet, packet_len); - } - else - { - res= my_net_write(&mpvio->auth_info.thd->net, packet, packet_len) || - net_flush(&mpvio->auth_info.thd->net); - } mpvio->cached_client_reply.plugin= ""_LEX_CSTRING; mpvio->status= MPVIO_EXT::FAILURE; // the status is no longer RESTART mpvio->packets_written++; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d76acf9640a..cdf8ef9e468 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -6541,6 +6541,8 @@ start_new_trans::start_new_trans(THD *thd) thd->server_status&= ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY); thd->server_status|= SERVER_STATUS_AUTOCOMMIT; + org_rgi_slave= thd->rgi_slave; + thd->rgi_slave= NULL; } @@ -6557,6 +6559,7 @@ void start_new_trans::restore_old_transaction() MYSQL_COMMIT_TRANSACTION(org_thd->m_transaction_psi); org_thd->m_transaction_psi= m_transaction_psi; org_thd->variables.wsrep_on= wsrep_on; + org_thd->rgi_slave= org_rgi_slave; org_thd= 0; } diff --git a/sql/sql_class.h b/sql/sql_class.h index 3a0cc891d8e..58cd438bc0a 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -6176,6 +6176,11 @@ class start_new_trans uint in_sub_stmt; uint server_status; my_bool wsrep_on; + /* + THD:rgi_slave may hold a part of the replicated "old" transaction's + execution context. Therefore it has to be reset/restored too. + */ + rpl_group_info* org_rgi_slave; public: start_new_trans(THD *thd); @@ -7919,27 +7924,23 @@ public: If command creates or drops a database */ #define CF_DB_CHANGE (1U << 23) - -#ifdef WITH_WSREP -/** - DDL statement that may be subject to error filtering. -*/ -#define CF_WSREP_MAY_IGNORE_ERRORS (1U << 24) -/** - Basic DML statements that create writeset. -*/ -#define CF_WSREP_BASIC_DML (1u << 25) - -#endif /* WITH_WSREP */ - - -/* Bits in server_command_flags */ - /** Statement that deletes existing rows (DELETE, DELETE_MULTI) */ #define CF_DELETES_DATA (1U << 24) +#ifdef WITH_WSREP +/** + DDL statement that may be subject to error filtering. +*/ +#define CF_WSREP_MAY_IGNORE_ERRORS (1U << 25) +/** + Basic DML statements that create writeset. +*/ +#define CF_WSREP_BASIC_DML (1u << 26) +#endif /* WITH_WSREP */ + +/* Bits in server_command_flags */ /** Skip the increase of the global query id counter. Commonly set for commands that are stateless (won't cause any change on the server diff --git a/sql/sql_error.cc b/sql/sql_error.cc index e218d4c917b..3f61d6b3c9c 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -360,7 +360,7 @@ Diagnostics_area::set_ok_status(ulonglong affected_rows, with an OK packet. */ if (unlikely(is_error() || is_disabled())) - return; + DBUG_VOID_RETURN; /* When running a bulk operation, m_status will be DA_OK for the first operation and set to DA_OK_BULK for all following operations. diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 663e11371f4..dcf4ccb1a28 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2989,6 +2989,41 @@ void st_select_lex_node::init_query_common() uncacheable= 0; } + +/* + We need to remember this unit for cleanup after it is stranded during CTE + merge (see mysql_derived_merge). Walk to the root unit of this query tree + (the root unit lifetime extends for the entire query) and insert myself + into the front of the stranded_clean_list: + before: root -> B -> A + after: root -> this -> B -> A + During cleanup, the stranded units are cleaned in FIFO order. + */ +void st_select_lex_unit::remember_my_cleanup() +{ + // Walk to the root unit (which lives until the end of the query) ... + st_select_lex_node *root= this; + while (root->master) + root= root->master; + + // ... and add myself to the front of the stranded_clean_list. + st_select_lex_unit *unit= static_cast(root); + st_select_lex_unit *prior_head= unit->stranded_clean_list; + unit->stranded_clean_list= this; + stranded_clean_list= prior_head; +} + + +void st_select_lex_unit::cleanup_stranded_units() +{ + if (!stranded_clean_list) + return; + + stranded_clean_list->cleanup(); + stranded_clean_list= nullptr; +} + + void st_select_lex_unit::init_query() { init_query_common(); @@ -3415,6 +3450,7 @@ void st_select_lex_unit::exclude_level() } // Mark it excluded prev= NULL; + remember_my_cleanup(); } @@ -5097,6 +5133,20 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only) if (empty_union_result) subquery_predicate->no_rows_in_result(); + /* + If any one SELECT in the subquery has UNCACHEABLE_RAND, then all + SELECTs should be marked as uncacheable. + */ + bool has_rand= false; + for (SELECT_LEX *sl= un->first_select(); sl && !has_rand; + sl= sl->next_select()) + has_rand= sl->uncacheable & UNCACHEABLE_RAND; + if (has_rand) + { + for (SELECT_LEX *sl= un->first_select(); sl; sl= sl->next_select()) + sl->uncacheable |= UNCACHEABLE_UNITED; + } + if (is_correlated_unit) { /* diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 3f630fa1b8e..553f3532259 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -711,6 +711,28 @@ bool print_explain_for_slow_log(LEX *lex, THD *thd, String *str); class st_select_lex_unit: public st_select_lex_node { +private: + /* + When a CTE is merged to the parent SELECT, its unit is excluded + which separates it from the tree of units for this query. It + needs to be cleaned up but not at the time it is excluded, since + its queries are merged to the unit above it. Remember all such + units via the stranded_clean_list and clean them at the end of + the query. This list is maintained only at the root unit node + of the query tree. + */ + st_select_lex_unit *stranded_clean_list{nullptr}; + + // Add myself to the stranded_clean_list. + void remember_my_cleanup(); + + /* + Walk the stranded_clean_list and cleanup units. This must only + be called for the st_select_lex_unit type because it assumes + that those are the only nodes in the stranded_clean_list. + */ + void cleanup_stranded_units(); + protected: TABLE_LIST result_table_list; select_unit *union_result; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 6d7d96a41ae..5e882611b41 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4859,6 +4859,21 @@ static void check_datadir_altered_for_innodb(THD *thd, } +static bool check_name_in_fields(const Field * const *fields, Lex_ident_column &name) +{ + if (!fields) + return FALSE; + + for (; *fields; fields++) + { + if ((*fields)->field_name.streq(name)) + return TRUE; + } + + return FALSE; +} + + /* Prepare for ALTER TABLE of partition structure @@ -4908,6 +4923,31 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, DBUG_RETURN(TRUE); } + if (table->part_info && alter_info->partition_flags == 0 && + (alter_info->flags & ALTER_PARSER_DROP_COLUMN)) + { + List_iterator drop_it(alter_info->drop_list); + Alter_drop *drop; + + while ((drop= drop_it++)) + { + if (drop->type != Alter_drop::COLUMN) + continue; + + if (check_name_in_fields(table->part_info->part_field_array, + drop->name) || + check_name_in_fields(table->part_info->subpart_field_array, + drop->name)) + { + /* + The ALTER drops column used in partitioning expression. + That cannot be done INPLACE. + */ + *partition_changed= TRUE; + } + } + } + partition_info *alt_part_info= thd->lex->part_info; /* This variable is TRUE in very special case when we add only DEFAULT diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 4e6d9e51daf..81bcf678547 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1668,6 +1668,8 @@ int plugin_init(int *argc, char **argv, int flags) tmp.name= tmp_plugin_name; tmp.state= 0; tmp.load_option= mandatory ? PLUGIN_FORCE : PLUGIN_ON; + DBUG_ASSERT(!mandatory || + plugin_maturity_map[plugin->maturity] >= SERVER_MATURITY_LEVEL); for (i=0; i < array_elements(override_plugin_load_policy); i++) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5610360f131..ba7eacd2046 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -371,6 +371,7 @@ bool join_limit_shortcut_is_applicable(const JOIN *join); POSITION *join_limit_shortcut_finalize_plan(JOIN *join, double *cost); static bool find_indexes_matching_order(JOIN *, TABLE *, ORDER *, key_map *); +static void init_join_plan_search_state(JOIN *join); #ifndef DBUG_OFF @@ -10134,12 +10135,9 @@ choose_plan(JOIN *join, table_map join_tables, TABLE_LIST *emb_sjm_nest) DBUG_ENTER("choose_plan"); join->limit_optimization_mode= false; - join->cur_embedding_map= 0; join->extra_heuristic_pruning= false; join->prune_level= join->thd->variables.optimizer_prune_level; - reset_nj_counters(join, join->join_list); - if ((join->emb_sjm_nest= emb_sjm_nest)) { /* We're optimizing semi-join materialization nest, so put the @@ -10184,13 +10182,6 @@ choose_plan(JOIN *join, table_map join_tables, TABLE_LIST *emb_sjm_nest) if (!emb_sjm_nest) choose_initial_table_order(join); - /* - Note: constant tables are already in the join prefix. We don't - put them into the cur_sj_inner_tables, though. - */ - - join->cur_sj_inner_tables= 0; - if (straight_join) { optimize_straight_join(join, join_tables); @@ -10522,6 +10513,8 @@ optimize_straight_join(JOIN *join, table_map remaining_tables) POSITION loose_scan_pos; THD *thd= join->thd; + init_join_plan_search_state(join); + for (JOIN_TAB **pos= join->best_ref + idx ; (s= *pos) ; pos++) { POSITION *position= join->positions + idx; @@ -10721,6 +10714,8 @@ greedy_search(JOIN *join, DBUG_ENTER("greedy_search"); DBUG_ASSERT(!(remaining_tables & join->const_table_map)); + init_join_plan_search_state(join); + /* number of tables that remain to be optimized */ usable_tables= (join->emb_sjm_nest ? (join->emb_sjm_nest->sj_inner_tables & @@ -20160,6 +20155,7 @@ static bool check_interleaving_with_nj(JOIN_TAB *next_tab) if (!next_emb->sj_on_expr) { next_emb->nested_join->counter++; + DBUG_ASSERT(next_emb->nested_join->counter <= next_emb->nested_join->n_tables); if (next_emb->nested_join->counter == 1) { /* @@ -34338,6 +34334,12 @@ bool JOIN::transform_all_conds_and_on_exprs_in_join_list( return false; } +static void init_join_plan_search_state(JOIN *join) +{ + join->cur_sj_inner_tables= 0; + join->cur_embedding_map= 0; + reset_nj_counters(join, join->join_list); +} static void MYSQL_DML_START(THD *thd) { diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 23fd6ec66c2..09034c7dbb0 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -2738,6 +2738,8 @@ err: bool st_select_lex_unit::cleanup() { + cleanup_stranded_units(); + bool error= 0; DBUG_ENTER("st_select_lex_unit::cleanup"); diff --git a/sql/sys_vars.inl b/sql/sys_vars.inl index 02d42d1065d..8c1a6f2f1a8 100644 --- a/sql/sys_vars.inl +++ b/sql/sys_vars.inl @@ -510,7 +510,7 @@ public: */ class Sys_var_charptr: public sys_var { - const size_t max_length= 2000; + const size_t max_length= 4096; public: Sys_var_charptr(const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, size_t size, diff --git a/sql/wsrep_plugin.cc b/sql/wsrep_plugin.cc index 644dc921f70..b6446afe4aa 100644 --- a/sql/wsrep_plugin.cc +++ b/sql/wsrep_plugin.cc @@ -322,8 +322,8 @@ maria_declare_plugin(wsrep_provider) NULL, /* Status variables */ /* System variables, this will be assigned by wsrep plugin below. */ NULL, - "1.0", /* Version (string) */ - MariaDB_PLUGIN_MATURITY_ALPHA /* Maturity */ + "1.0.1", /* Version (string) */ + MariaDB_PLUGIN_MATURITY_STABLE /* Maturity */ } maria_declare_plugin_end; diff --git a/sql/wsrep_server_service.cc b/sql/wsrep_server_service.cc index e0fffa84457..ca25a41d132 100644 --- a/sql/wsrep_server_service.cc +++ b/sql/wsrep_server_service.cc @@ -39,6 +39,7 @@ static void init_service_thd(THD* thd, void* thread_stack) thd->thread_stack= thread_stack; thd->real_id= pthread_self(); thd->prior_thr_create_utime= thd->start_utime= microsecond_interval_timer(); + thd->security_ctx->skip_grants(); thd->mark_connection_idle(); thd->reset_for_next_command(true); server_threads.insert(thd); // as wsrep_innobase_kill_one_trx() uses find_thread_by_id() diff --git a/storage/columnstore/columnstore b/storage/columnstore/columnstore index f33e9ce86c7..22454e6eef5 160000 --- a/storage/columnstore/columnstore +++ b/storage/columnstore/columnstore @@ -1 +1 @@ -Subproject commit f33e9ce86c73f606dbef2d50cac8b92e393344ef +Subproject commit 22454e6eef5ba17c573f7602203e997c9331748d diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 64ec18180c8..b072aec330a 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -2257,26 +2257,27 @@ btr_cur_ins_lock_and_undo( /** Prefetch siblings of the leaf for the pessimistic operation. @param block leaf page -@param index index of the page */ +@param index index of the page +@param trx transaction */ static void btr_cur_prefetch_siblings(const buf_block_t *block, - const dict_index_t *index) + const dict_index_t *index, + trx_t *trx) noexcept { ut_ad(page_is_leaf(block->page.frame)); const page_t *page= block->page.frame; - uint32_t prev= mach_read_from_4(my_assume_aligned<4>(page + FIL_PAGE_PREV)); uint32_t next= mach_read_from_4(my_assume_aligned<4>(page + FIL_PAGE_NEXT)); - fil_space_t *space= index->table->space; + page_id_t id{space->id, + mach_read_from_4(my_assume_aligned<4>(page + FIL_PAGE_PREV))}; - if (prev == FIL_NULL); - else if (space->acquire()) - buf_read_page_background(space, page_id_t(space->id, prev), - block->zip_size()); - if (next == FIL_NULL); - else if (space->acquire()) - buf_read_page_background(space, page_id_t(space->id, next), - block->zip_size()); + if (id.page_no() != FIL_NULL && space->acquire()) + buf_read_page_background(id, space, trx); + + id.set_page_no(next); + + if (next != FIL_NULL && space->acquire()) + buf_read_page_background(id, space, trx); } /*************************************************************//** @@ -2394,7 +2395,7 @@ fail: /* prefetch siblings of the leaf for the pessimistic operation, if the page is leaf. */ if (leaf) { - btr_cur_prefetch_siblings(block, index); + btr_cur_prefetch_siblings(block, index, mtr->trx); } fail_err: @@ -3522,7 +3523,7 @@ any_extern: /* prefetch siblings of the leaf for the pessimistic operation. */ - btr_cur_prefetch_siblings(block, index); + btr_cur_prefetch_siblings(block, index, mtr->trx); return(DB_OVERFLOW); } @@ -3694,7 +3695,7 @@ corrupted: func_exit: /* prefetch siblings of the leaf for the pessimistic operation. */ - btr_cur_prefetch_siblings(block, index); + btr_cur_prefetch_siblings(block, index, mtr->trx); } return(err); @@ -4370,7 +4371,7 @@ btr_cur_optimistic_delete( mtr)) { /* prefetch siblings of the leaf for the pessimistic operation. */ - btr_cur_prefetch_siblings(block, cursor->index()); + btr_cur_prefetch_siblings(block, cursor->index(), mtr->trx); err = DB_FAIL; goto func_exit; } diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 1de9c7d832d..30e59858213 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -338,12 +338,6 @@ void buf_inc_get() noexcept buf_inc_get(trx); } -static ATTRIBUTE_NOINLINE void buf_inc_read(trx_t *trx) noexcept -{ - if (ha_handler_stats *stats= trx->active_handler_stats) - stats->pages_read_count++; -} - # ifdef SUX_LOCK_GENERIC void page_hash_latch::read_lock_wait() noexcept { @@ -634,7 +628,8 @@ bool buf_is_zeroes(span buf) noexcept @param fsp_flags contents of FIL_SPACE_FLAGS @return whether the page is corrupted */ buf_page_is_corrupted_reason -buf_page_is_corrupted(bool check_lsn, const byte *read_buf, uint32_t fsp_flags) noexcept +buf_page_is_corrupted(bool check_lsn, const byte *read_buf, uint32_t fsp_flags) + noexcept { if (fil_space_t::full_crc32(fsp_flags)) { bool compressed = false, corrupted = false; @@ -2317,20 +2312,20 @@ buf_page_t *buf_page_get_zip(const page_id_t page_id) noexcept if (!bpage) { hash_lock.unlock_shared(); - switch (dberr_t err= buf_read_page(page_id, chain, false)) { - case DB_SUCCESS: - case DB_SUCCESS_LOCKED_REC: - if (trx) buf_inc_read(trx); - continue; - case DB_TABLESPACE_DELETED: - return nullptr; - default: - sql_print_error("InnoDB: Reading compressed page " - "[page id: space=" UINT32PF ", page number=" UINT32PF - "] failed with error: %s", - page_id.space(), page_id.page_no(), ut_strerr(err)); + dberr_t err; + bpage= reinterpret_cast + (buf_read_page(page_id, &err, chain, false)); + if (!bpage) + { + if (err != DB_TABLESPACE_DELETED) + sql_print_error("InnoDB: Reading compressed page " + "[page id: space=" UINT32PF ", page number=" UINT32PF + "] failed with error: %s", + page_id.space(), page_id.page_no(), ut_strerr(err)); return nullptr; } + hash_lock.lock_shared(); + bpage->unfix(); } ut_ad(bpage->in_file()); @@ -2339,7 +2334,11 @@ buf_page_t *buf_page_get_zip(const page_id_t page_id) noexcept const bool got_s_latch= bpage->lock.s_lock_try(); hash_lock.unlock_shared(); if (UNIV_LIKELY(got_s_latch)) + { + ut_ad(!bpage->is_read_fixed()); break; + } + /* We may fail to acquire bpage->lock because a read is holding an exclusive latch on this block and either in progress or invoking buf_pool_t::corrupted_evict(). @@ -2554,17 +2553,18 @@ buf_block_t *buf_pool_t::page_fix(const page_id_t id, { hash_lock.lock_shared(); buf_page_t *b= page_hash.get(id, chain); + uint32_t state_1; if (b) { - uint32_t state= b->fix() + 1; + state_1= b->fix(); hash_lock.unlock_shared(); - if (UNIV_UNLIKELY(state < buf_page_t::UNFIXED)) + if (UNIV_UNLIKELY(state_1 < buf_page_t::UNFIXED)) { - ut_ad(state > buf_page_t::FREED); + ut_ad(state_1 >= buf_page_t::FREED); if (c == FIX_ALSO_FREED && b->id() == id) { - ut_ad(state == buf_page_t::FREED + 1); + ut_ad(state_1 == buf_page_t::FREED); return reinterpret_cast(b); } /* The page was marked as freed or corrupted. */ @@ -2575,7 +2575,7 @@ buf_block_t *buf_pool_t::page_fix(const page_id_t id, return nullptr; } - if (state >= buf_page_t::READ_FIX && state < buf_page_t::WRITE_FIX) + if (state_1 >= buf_page_t::READ_FIX && state_1 < buf_page_t::WRITE_FIX) { if (c == FIX_NOWAIT) { @@ -2586,7 +2586,7 @@ buf_block_t *buf_pool_t::page_fix(const page_id_t id, if (UNIV_LIKELY(b->frame != nullptr)) ut_ad(b->frame==reinterpret_cast(b)->frame_address()); - else if (state < buf_page_t::READ_FIX) + else if (state_1 < buf_page_t::READ_FIX) goto unzip; else { @@ -2595,10 +2595,8 @@ buf_block_t *buf_pool_t::page_fix(const page_id_t id, std::this_thread::sleep_for(std::chrono::microseconds(100)); continue; } - b->lock.s_lock(); - state= b->state(); - ut_ad(state < buf_page_t::READ_FIX || state >= buf_page_t::WRITE_FIX); + b->read_wait(trx); b->lock.s_unlock(); } @@ -2616,7 +2614,6 @@ buf_block_t *buf_pool_t::page_fix(const page_id_t id, goto corrupted; b= &block->page; - state= b->state(); b->lock.x_unlock(); } @@ -2627,17 +2624,21 @@ buf_block_t *buf_pool_t::page_fix(const page_id_t id, if (c == FIX_NOWAIT) return reinterpret_cast(-1); - - switch (dberr_t local_err= buf_read_page(id, chain)) { - default: - if (err) - *err= local_err; + buf_block_t *block= buf_read_page(id, err, chain); + if (!block) return nullptr; - case DB_SUCCESS: - case DB_SUCCESS_LOCKED_REC: - if (trx) buf_inc_read(trx); - buf_read_ahead_random(id); + buf_read_ahead_random(id); + if (err) + { + ut_ad(*err == DB_SUCCESS || *err == DB_SUCCESS_LOCKED_REC); + *err= DB_SUCCESS; } + if (UNIV_UNLIKELY(!block->page.frame)) + { + b= &block->page; + goto unzip; + } + return block; } } @@ -2788,47 +2789,25 @@ loop: switch (mode) { case BUF_GET_IF_IN_POOL: case BUF_PEEK_IF_IN_POOL: - return nullptr; - } - - /* The call path is buf_read_page() -> - buf_read_page_low() (fil_space_t::io()) -> - buf_page_t::read_complete() -> - buf_decrypt_after_read(). Here fil_space_t* is used - and we decrypt -> buf_page_check_corrupt() where page - checksums are compared. Decryption, decompression as - well as error handling takes place at a lower level. - Here we only need to know whether the page really is - corrupted, or if an encrypted page with a valid - checksum cannot be decypted. */ - - switch (dberr_t local_err = buf_read_page(page_id, chain)) { - case DB_SUCCESS: - case DB_SUCCESS_LOCKED_REC: - if (trx) buf_inc_read(trx); - buf_read_ahead_random(page_id); break; default: - if (mode != BUF_GET_POSSIBLY_FREED - && retries++ < BUF_PAGE_READ_MAX_RETRIES) { - DBUG_EXECUTE_IF("intermittent_read_failure", - retries = BUF_PAGE_READ_MAX_RETRIES;); + block = buf_read_page(page_id, err, chain); + if (!block) { + break; + } else if (err) { + *err = DB_SUCCESS; } - /* fall through */ - case DB_PAGE_CORRUPTED: - if (err) { - *err = local_err; - } - return nullptr; + + ut_d(if (!(++buf_dbg_counter % 5771)) buf_pool.validate()); + buf_read_ahead_random(page_id); + state = block->page.state(); + goto not_read_fixed; } - ut_d(if (!(++buf_dbg_counter % 5771)) buf_pool.validate()); - goto loop; + return nullptr; got_block: state++; - ut_ad(state > buf_page_t::FREED); - if (state > buf_page_t::READ_FIX && state < buf_page_t::WRITE_FIX) { if (mode == BUF_PEEK_IF_IN_POOL) { ignore_block: @@ -2849,15 +2828,15 @@ ignore_unfixed: in buf_page_t::read_complete() or buf_pool_t::corrupted_evict(), or after buf_zip_decompress() in this function. */ - block->page.lock.s_lock(); + block->page.read_wait(trx); state = block->page.state(); - ut_ad(state < buf_page_t::READ_FIX - || state >= buf_page_t::WRITE_FIX); - const page_id_t id{block->page.id()}; - block->page.lock.s_unlock(); if (UNIV_UNLIKELY(state < buf_page_t::UNFIXED)) { + const page_id_t id{block->page.id()}; + block->page.unfix(); + block->page.lock.s_unlock(); + if (UNIV_UNLIKELY(id == page_id)) { /* The page read was completed, and another thread marked the page as free @@ -2877,13 +2856,49 @@ ignore_unfixed: return nullptr; } - ut_ad(id == page_id); - } else if (mode != BUF_PEEK_IF_IN_POOL) { - } else if (UNIV_UNLIKELY(!block->page.frame)) { - /* The BUF_PEEK_IF_IN_POOL mode is mainly used for dropping an - adaptive hash index. There cannot be an - adaptive hash index for a compressed-only page. */ - goto ignore_block; + + ut_ad(block->page.id() == page_id); + + if (UNIV_LIKELY(state > buf_page_t::UNFIXED + && block->page.frame)) { + switch (rw_latch) { + bool nowait; + case RW_NO_LATCH: + break; + default: + nowait = block->page.lock.s_x_upgrade(); + if (rw_latch == RW_SX_LATCH) { + block->page.lock.x_u_downgrade(); + } else { + ut_ad(rw_latch == RW_X_LATCH); + } + if (!nowait) { + goto latch_waited; + } else { + ut_ad(state < buf_page_t::READ_FIX); + } + /* fall through */ + case RW_S_LATCH: + mtr->memo_push(block, + mtr_memo_type_t(rw_latch)); + goto latched; + } + } + + block->page.lock.s_unlock(); + } else { +not_read_fixed: + ut_ad(state > buf_page_t::FREED); + ut_ad(state < buf_page_t::READ_FIX + || state > buf_page_t::WRITE_FIX); + if (UNIV_UNLIKELY(!block->page.frame + && mode == BUF_PEEK_IF_IN_POOL)) { + /* The BUF_PEEK_IF_IN_POOL mode is mainly used + for dropping an adaptive hash index. There + cannot be an adaptive hash index for a + compressed-only page. */ + goto ignore_block; + } } ut_ad(mode == BUF_GET_IF_IN_POOL || mode == BUF_PEEK_IF_IN_POOL @@ -2948,6 +2963,7 @@ wait_for_unzip: } } +latch_waited: mtr->memo_push(block, mtr_memo_type_t(rw_latch)); state = block->page.state(); @@ -2956,6 +2972,7 @@ wait_for_unzip: goto ignore_unfixed; } +latched: ut_ad(state < buf_page_t::READ_FIX || state > buf_page_t::WRITE_FIX); ut_ad(block->page.frame == block->frame_address()); ut_ad(page_id_t(page_get_space_id(block->page.frame), @@ -3194,8 +3211,15 @@ retry: else state= bpage->state(); - ut_ad(state >= buf_page_t::FREED); + ut_ad(state > buf_page_t::FREED); ut_ad(state < buf_page_t::READ_FIX); + /* In addition to our buffer-fix, there may be another that is + held by a concurrent IORequest::read_complete() that had + released the bpage->lock in bpage->read_complete(...) but not + yet invoked bpage->unfix(). This should only be due to an + asynchronous read-ahead for a page that was actually marked as + freed in the underlying data file. */ + ut_ad(bpage->buf_fix_count(state) <= 2); if (state < buf_page_t::UNFIXED) bpage->set_reinit(buf_page_t::FREED); @@ -3215,10 +3239,18 @@ retry: else { page_hash_latch &hash_lock= buf_pool.page_hash.lock_get(chain); - /* It does not make sense to use transactional_lock_guard here, - because buf_relocate() would likely make the memory transaction - too large. */ - hash_lock.lock(); + for (;;) + { + hash_lock.lock(); + state= bpage->state(); + if ((state & ~buf_page_t::LRU_MASK) == 1) + break; + /* Wait for a concurrent IORequest::read_complete() to + invoke bpage->unfix(), for an unnecessary read-ahead of + a freed page. */ + ut_ad((state & ~buf_page_t::LRU_MASK) == 2); + hash_lock.unlock(); + } mysql_mutex_lock(&buf_pool.flush_list_mutex); buf_relocate(bpage, &free_block->page); @@ -3515,17 +3547,26 @@ static dberr_t buf_page_check_corrupt(buf_page_t *bpage, /** Complete a read of a page. @param node data file +@param recovery recv_recovery_is_on() @return whether the operation succeeded +@retval DB_SUCCESS if the read succeeded; caller must unfix() @retval DB_PAGE_CORRUPTED if the checksum or the page ID is incorrect @retval DB_DECRYPTION_FAILED if the page cannot be decrypted */ -dberr_t buf_page_t::read_complete(const fil_node_t &node) noexcept +dberr_t buf_page_t::read_complete(const fil_node_t &node, + bool recovery) noexcept { const page_id_t expected_id{id()}; - ut_ad(is_read_fixed()); + { + /* The block must be read-fixed and buffer-fixed. */ + ut_d(const auto s= state()); + ut_ad(s > READ_FIX); + ut_ad(s < WRITE_FIX); + } ut_ad(!buf_dblwr.is_inside(id())); ut_ad(id().space() == node.space->id); ut_ad(zip_size() == node.space->zip_size()); ut_ad(!!zip.ssize == !!zip.data); + ut_ad(recovery == recv_sys.recovery_on); const byte *read_frame= zip.data ? zip.data : frame; ut_ad(read_frame); @@ -3593,29 +3634,22 @@ dberr_t buf_page_t::read_complete(const fil_node_t &node) noexcept err= buf_page_check_corrupt(this, node); if (UNIV_UNLIKELY(err != DB_SUCCESS)) { -database_corrupted: + database_corrupted: if (belongs_to_unzip_LRU()) -database_corrupted_compressed: + database_corrupted_compressed: memset_aligned(frame, 0, srv_page_size); - if (!srv_force_recovery) - goto release_page; - - if (err == DB_PAGE_CORRUPTED || err == DB_DECRYPTION_FAILED) + release_page: + if (recovery && node.space->full_crc32() && node.space->crypt_data && + recv_sys.dblwr.find_deferred_page(node, id().page_no(), + const_cast(read_frame))) + /* Recovered from the doublewrite buffer */ + err= DB_SUCCESS; + else { -release_page: - if (node.space->full_crc32() && node.space->crypt_data && - recv_recovery_is_on() && - recv_sys.dblwr.find_deferred_page(node, id().page_no(), - const_cast(read_frame))) - { - /* Recover from doublewrite buffer */ - err= DB_SUCCESS; - goto success_page; - } - - if (recv_sys.free_corrupted_page(expected_id, node)); + if (recovery && recv_sys.free_corrupted_page(expected_id, node)); else if (err == DB_FAIL) + /* We already output a more specific message. */ err= DB_PAGE_CORRUPTED; else { @@ -3632,28 +3666,24 @@ release_page: FORCE_RECOVERY_MSG); } - buf_pool.corrupted_evict(this, buf_page_t::READ_FIX); + buf_pool.corrupted_evict(this, buf_page_t::READ_FIX + 1); return err; } } -success_page: - const bool recovery= frame && recv_recovery_is_on(); - - if (recovery && !recv_recover_page(node.space, this)) + if (!recovery || !frame) + { + ut_d(auto f=) zip.fix.fetch_sub(READ_FIX - UNFIXED); + ut_ad(f > READ_FIX); + ut_ad(f < WRITE_FIX); + } + else if (!recv_recover_page(node.space, this)) return DB_PAGE_CORRUPTED; if (UNIV_UNLIKELY(MONITOR_IS_ON(MONITOR_MODULE_BUF_PAGE))) buf_page_monitor(*this, true); DBUG_PRINT("ib_buf", ("read page %u:%u", id().space(), id().page_no())); - if (!recovery) - { - ut_d(auto f=) zip.fix.fetch_sub(READ_FIX - UNFIXED); - ut_ad(f >= READ_FIX); - ut_ad(f < WRITE_FIX); - } - lock.x_unlock(true); return DB_SUCCESS; diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index d13e0d0c82c..1003e9a5235 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -585,7 +585,6 @@ buf_load() so all pages from a given tablespace are consecutive. */ uint32_t cur_space_id = dump[0].space(); fil_space_t* space = fil_space_t::get(cur_space_id); - ulint zip_size = space ? space->zip_size() : 0; PSI_stage_progress* pfs_stage_progress __attribute__((unused)) = mysql_set_stage(srv_stage_buffer_pool_load.m_key); @@ -608,12 +607,6 @@ buf_load() cur_space_id = this_space_id; space = fil_space_t::get(cur_space_id); - - if (!space) { - continue; - } - - zip_size = space->zip_size(); } /* JAN: TODO: As we use background page read below, @@ -632,7 +625,7 @@ buf_load() } space->reacquire(); - buf_read_page_background(space, dump[i], zip_size); + buf_read_page_background(dump[i], space, nullptr); if (buf_load_abort_flag) { if (space) { diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index 21b2c32affc..59bb3c5c232 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -70,21 +70,26 @@ and the lock released later. @param chain buf_pool.page_hash cell for page_id @param block preallocated buffer block (set to nullptr if consumed) @return pointer to the block -@retval nullptr in case of an error */ +@retval nullptr in case of an error +@retval pointer to block | 1 if the page already exists in buf_pool */ static buf_page_t *buf_page_init_for_read(const page_id_t page_id, ulint zip_size, buf_pool_t::hash_chain &chain, buf_block_t *&block) noexcept { buf_page_t *bpage= !zip_size || (zip_size & 1) ? &block->page : nullptr; + constexpr uint32_t READ_BUF_FIX{buf_page_t::READ_FIX + 1}; page_hash_latch &hash_lock= buf_pool.page_hash.lock_get(chain); hash_lock.lock(); - if (buf_pool.page_hash.get(page_id, chain)) + buf_page_t *hash_page= buf_pool.page_hash.get(page_id, chain); + if (hash_page) { -page_exists: - hash_lock.unlock(); + page_exists: /* The page is already in the buffer pool. */ - return nullptr; + ut_d(const uint32_t state=) hash_page->fix(); + ut_ad(state >= buf_page_t::FREED); + hash_lock.unlock(); + return reinterpret_cast(uintptr_t(hash_page) | 1); } if (UNIV_UNLIKELY(mysql_mutex_trylock(&buf_pool.mutex))) @@ -92,7 +97,8 @@ page_exists: hash_lock.unlock(); mysql_mutex_lock(&buf_pool.mutex); hash_lock.lock(); - if (buf_pool.page_hash.get(page_id, chain)) + hash_page= buf_pool.page_hash.get(page_id, chain); + if (hash_page) { mysql_mutex_unlock(&buf_pool.mutex); goto page_exists; @@ -105,7 +111,7 @@ page_exists: { block= nullptr; reinterpret_cast(bpage)-> - initialise(page_id, zip_size & ~1, buf_page_t::READ_FIX); + initialise(page_id, zip_size & ~1, READ_BUF_FIX); /* x_unlock() will be invoked in buf_page_t::read_complete() by the io-handler thread. */ bpage->lock.x_lock(true); @@ -147,11 +153,15 @@ page_exists: check the page_hash again, as it may have been modified. */ if (UNIV_UNLIKELY(lru)) { - if (UNIV_LIKELY_NULL(buf_pool.page_hash.get(page_id, chain))) + hash_page= buf_pool.page_hash.get(page_id, chain); + if (UNIV_LIKELY_NULL(hash_page)) { /* The block was added by some other thread. */ + ut_d(const uint32_t state=) hash_page->fix(); + ut_ad(state >= buf_page_t::FREED); buf_buddy_free(data, zip_size); - goto func_exit; + mysql_mutex_unlock(&buf_pool.mutex); + return reinterpret_cast(uintptr_t(hash_page) | 1); } } @@ -166,7 +176,7 @@ page_exists: a false match. Therefore, we can safely initialize bpage before acquiring hash_lock. */ bpage->lock.init(); - bpage->init(buf_page_t::READ_FIX, page_id); + bpage->init(READ_BUF_FIX, page_id); bpage->lock.x_lock(true); hash_lock.lock(); @@ -179,10 +189,8 @@ page_exists: } buf_pool.stat.n_pages_read++; -func_exit: - mysql_mutex_unlock(&buf_pool.mutex); ut_ad(!bpage || bpage->in_file()); - + mysql_mutex_unlock(&buf_pool.mutex); return bpage; } @@ -195,6 +203,33 @@ inline ulonglong mariadb_measure() noexcept #endif } +void buf_page_t::read_wait(trx_t *trx) noexcept +{ + ulonglong start= 0, *stats= nullptr; + if (trx) + { + tpool::tpool_wait_begin(); + thd_wait_begin(trx->mysql_thd, THD_WAIT_DISKIO); + if (ha_handler_stats *active= trx->active_handler_stats) + { + active->pages_read_count++; + stats= &active->pages_read_time; + start= mariadb_measure(); + } + } + lock.s_lock_nospin(); + ut_d(const uint32_t latched_state{state()}); + ut_ad(latched_state > FREED); + ut_ad(latched_state < READ_FIX || latched_state > WRITE_FIX); + if (trx) + { + tpool::tpool_wait_end(); + thd_wait_end(trx->mysql_thd); + if (stats) + *stats+= mariadb_measure() - start; + } +} + /** Low-level function which reads a page asynchronously from a file to the buffer buf_pool if it is not already there, in which case does nothing. Sets the io_fix flag and sets an exclusive lock on the buffer frame. The @@ -203,77 +238,126 @@ flag is cleared and the x-lock released by an i/o-handler thread. @param[in] page_id page id @param[in] zip_size 0 or ROW_FORMAT=COMPRESSED page size bitwise-ORed with 1 to allocate an uncompressed frame +@param[out] err nullptr for asynchronous; error code for synchronous: + DB_SUCCESS if the page was successfully read, + DB_SUCCESS_LOCKED_REC if the exists in the pool, + DB_PAGE_CORRUPTED on page checksum mismatch, + DB_DECRYPTION_FAILED if page post encryption checksum + matches but after decryption normal page checksum + does not match @param[in,out] chain buf_pool.page_hash cell for page_id @param[in,out] space tablespace @param[in,out] block preallocated buffer block @param[in] thd current_thd if sync -@param[in] sync whether synchronous aio is desired -@return error code -@retval DB_SUCCESS if the page was read -@retval DB_SUCCESS_LOCKED_REC if the page exists in the buffer pool already */ +@return buffer-fixed block (*err may be set to DB_SUCCESS_LOCKED_REC) +@retval -1 if err==nullptr and an asynchronous read was submitted +@retval -2 if err==nullptr and the page exists in the buffer pool +@retval nullptr if the page was not successfully read (*err will be set) */ static -dberr_t +buf_page_t* buf_read_page_low( const page_id_t page_id, ulint zip_size, + dberr_t* err, buf_pool_t::hash_chain& chain, fil_space_t* space, buf_block_t*& block, - THD* thd = nullptr, - bool sync = false) noexcept + THD* thd = nullptr) noexcept { - buf_page_t* bpage; + if (buf_dblwr.is_inside(page_id)) + { + fail: + space->release(); + if (err) + *err= DB_PAGE_CORRUPTED; + return nullptr; + } - if (buf_dblwr.is_inside(page_id)) { - space->release(); - return DB_PAGE_CORRUPTED; - } + buf_page_t *bpage= buf_page_init_for_read(page_id, zip_size, chain, block); + if (UNIV_UNLIKELY(!bpage)) + goto fail; + const bool exist(uintptr_t(bpage) & 1); + bpage= reinterpret_cast(uintptr_t(bpage) & ~uintptr_t{1}); + trx_t *const trx= thd ? thd_to_trx(thd) : nullptr; + if (exist) + { + if (!err) + { + bpage->unfix(); + bpage= reinterpret_cast(-2); + } + else + { + uint32_t state{bpage->state()}; + ut_d(page_id_t id{bpage->id()}); + ut_ad(state > buf_page_t::FREED); + if (state < buf_page_t::UNFIXED) + { + corrupted: + ut_ad(id == page_id || id == page_id_t{~0ULL}); + bpage->unfix(); + bpage= nullptr; + *err= DB_PAGE_CORRUPTED; + } + else if (!bpage->is_read_fixed(state)) + *err= DB_SUCCESS_LOCKED_REC; + else + { + bpage->read_wait(trx); + state= bpage->state(); + ut_d(id= bpage->id()); + bpage->lock.s_unlock(); + if (state < buf_page_t::UNFIXED) + goto corrupted; + } + } - bpage = buf_page_init_for_read(page_id, zip_size, chain, block); + space->release(); + return bpage; + } - if (!bpage) { - space->release(); - return DB_SUCCESS_LOCKED_REC; - } + ut_ad(bpage->in_file()); - ut_ad(bpage->in_file()); - ulonglong mariadb_timer = 0; - trx_t *const trx= thd ? thd_to_trx(thd) : nullptr; + void* dst= zip_size > 1 ? bpage->zip.data : bpage->frame; + const size_t len= zip_size & ~1 ? zip_size & ~1 : srv_page_size; - thd_wait_begin(thd, THD_WAIT_DISKIO); + if (err != nullptr) + { + thd_wait_begin(thd, THD_WAIT_DISKIO); + ha_handler_stats *const stats= trx ? trx->active_handler_stats : nullptr; + const ulonglong start= stats ? mariadb_measure() : 0; + auto fio= space->io(IORequest(IORequest::READ_SYNC), + os_offset_t{page_id.page_no()} * len, len, dst, bpage); + *err= fio.err; + thd_wait_end(thd); + if (stats) + { + stats->pages_read_count++; + if (start) + stats->pages_read_time+= mariadb_measure() - start; + } + if (UNIV_LIKELY(*err == DB_SUCCESS)) + { + *err= bpage->read_complete(*fio.node, recv_sys.recovery_on); + if (*err) + bpage= nullptr; + space->release(); - if (trx && trx->active_handler_stats) { - mariadb_timer = mariadb_measure(); - } + /* FIXME: Remove this, and accumulate stats->pages_read_count to + global statistics somewhere! */ + buf_LRU_stat_inc_io(); + return bpage; + } + } + else if (UNIV_LIKELY(DB_SUCCESS == + space->io(IORequest(IORequest::READ_ASYNC), + os_offset_t{page_id.page_no()} * len, len, + dst, bpage).err)) + return reinterpret_cast(-1); - DBUG_LOG("ib_buf", - "read page " << page_id << " zip_size=" << zip_size - << (sync ? " sync" : " async")); - - void* dst = zip_size > 1 ? bpage->zip.data : bpage->frame; - const ulint len = zip_size & ~1 ? zip_size & ~1 : srv_page_size; - - auto fio = space->io(IORequest(sync - ? IORequest::READ_SYNC - : IORequest::READ_ASYNC), - os_offset_t{page_id.page_no()} * len, len, - dst, bpage); - - if (UNIV_UNLIKELY(fio.err != DB_SUCCESS)) { - recv_sys.free_corrupted_page(page_id, *space->chain.start); - buf_pool.corrupted_evict(bpage, buf_page_t::READ_FIX); - } else if (sync) { - thd_wait_end(thd); - /* The i/o was already completed in space->io() */ - fio.err = bpage->read_complete(*fio.node); - space->release(); - if (mariadb_timer) { - trx->active_handler_stats->pages_read_time - += mariadb_measure() - mariadb_timer; - } - } - - return fio.err; + recv_sys.free_corrupted_page(page_id, *space->chain.start); + buf_pool.corrupted_evict(bpage, buf_page_t::READ_FIX + 1); + return nullptr; } /** Acquire a buffer block. */ @@ -282,8 +366,9 @@ static buf_block_t *buf_read_acquire() return buf_LRU_get_free_block(have_no_mutex_soft); } -/** Free a buffer block if needed. */ -static void buf_read_release(buf_block_t *block) +/** Free a buffer block if needed. +@param block block to be freed */ +static void buf_read_release(buf_block_t *block) noexcept { if (block) { @@ -293,22 +378,34 @@ static void buf_read_release(buf_block_t *block) } } -/** Report a completed read-ahead batch. -@param space tablespace -@param count number of pages submitted for reading */ -static ATTRIBUTE_NOINLINE -void buf_read_ahead_report(const fil_space_t &space, size_t count) noexcept +ATTRIBUTE_NOINLINE +/** Free a buffer block if needed, and update the read-ahead count. +@param block block to be freed +@param count number of blocks that were read ahead +@return count*/ +static size_t buf_read_release_count(buf_block_t *block, size_t count) noexcept { - if (THD *thd= current_thd) - if (trx_t *trx= thd_to_trx(thd)) - if (ha_handler_stats *stats= trx->active_handler_stats) - stats->pages_prefetched+= count; - mysql_mutex_lock(&buf_pool.mutex); - /* Read ahead is considered one I/O operation for the purpose of - LRU policy decision. */ - buf_LRU_stat_inc_io(); - buf_pool.stat.n_ra_pages_read_rnd+= count; - mysql_mutex_unlock(&buf_pool.mutex); + if (block || count) + { + mysql_mutex_lock(&buf_pool.mutex); + if (block) + buf_LRU_block_free_non_file_page(block); + if (count) + { + /* Read ahead is considered one I/O operation for the purpose of + LRU policy decision. */ + buf_LRU_stat_inc_io(); + buf_pool.stat.n_ra_pages_read+= count; + } + mysql_mutex_unlock(&buf_pool.mutex); + } + + if (count) + if (THD *thd= current_thd) + if (trx_t *trx= thd_to_trx(thd)) + if (ha_handler_stats *stats= trx->active_handler_stats) + stats->pages_prefetched+= count; + return count; } /** Applies a random read-ahead in buf_pool if there are at least a threshold @@ -381,13 +478,15 @@ read_ahead: goto allocate_block; } + /* Read all the suitable blocks within the area */ for (page_id_t i= low; i < high; ++i) { if (space->is_stopping()) break; buf_pool_t::hash_chain &chain= buf_pool.page_hash.cell_get(i.fold()); space->reacquire(); - if (buf_read_page_low(i, zip_size, chain, space, block) == DB_SUCCESS) + if (reinterpret_cast(-1) == + buf_read_page_low(i, zip_size, nullptr, chain, space, block, nullptr)) { count++; ut_ad(!block); @@ -397,18 +496,18 @@ read_ahead: } } - if (count) - buf_read_ahead_report(*space, count); - space->release(); - buf_read_release(block); - return count; + + return buf_read_release_count(block, count); } -dberr_t buf_read_page(const page_id_t page_id, - buf_pool_t::hash_chain &chain, bool unzip) noexcept +buf_block_t *buf_read_page(const page_id_t page_id, dberr_t *err, + buf_pool_t::hash_chain &chain, bool unzip) noexcept { fil_space_t *space= fil_space_t::get(page_id.space()); + dberr_t local_err; + if (!err) + err= &local_err; if (UNIV_UNLIKELY(!space)) { sql_print_information("InnoDB: trying to read page " @@ -416,7 +515,8 @@ dberr_t buf_read_page(const page_id_t page_id, ", page number=" UINT32PF "]" " in nonexisting or being-dropped tablespace", page_id.space(), page_id.page_no()); - return DB_TABLESPACE_DELETED; + *err= DB_TABLESPACE_DELETED; + return nullptr; } /* Our caller should already have ensured that the page does not @@ -428,7 +528,6 @@ dberr_t buf_read_page(const page_id_t page_id, { allocate_block: mysql_mutex_lock(&buf_pool.mutex); - buf_LRU_stat_inc_io(); block= buf_LRU_get_free_block(have_mutex); mysql_mutex_unlock(&buf_pool.mutex); } @@ -438,55 +537,47 @@ dberr_t buf_read_page(const page_id_t page_id, goto allocate_block; } - dberr_t err= buf_read_page_low(page_id, zip_size, chain, space, block, - current_thd, true); + buf_page_t *b= buf_read_page_low(page_id, zip_size, err, chain, space, + block, current_thd); buf_read_release(block); - return err; + return reinterpret_cast(b); } -/** High-level function which reads a page asynchronously from a file to the -buffer buf_pool if it is not already there. Sets the io_fix flag and sets -an exclusive lock on the buffer frame. The flag is cleared and the x-lock -released by the i/o-handler thread. -@param[in,out] space tablespace -@param[in] page_id page id -@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 */ -void buf_read_page_background(fil_space_t *space, const page_id_t page_id, - ulint zip_size) noexcept +void buf_read_page_background(const page_id_t page_id, fil_space_t *space, + trx_t *trx) noexcept { + ut_ad(!recv_recovery_is_on()); buf_pool_t::hash_chain &chain= buf_pool.page_hash.cell_get(page_id.fold()); if (buf_pool.page_hash_contains(page_id, chain)) - { skip: space->release(); - return; - } - - buf_block_t *block= nullptr; - if (UNIV_LIKELY(!zip_size)) - { - allocate_block: - if (UNIV_UNLIKELY(!(block= buf_read_acquire()))) - goto skip; - } - else if (recv_recovery_is_on()) - { - zip_size|= 1; - goto allocate_block; - } - - if (buf_read_page_low(page_id, zip_size, chain, space, block) == - DB_SUCCESS) - ut_ad(!block); else - buf_read_release(block); - - /* We do not increment number of I/O operations used for LRU policy - here (buf_LRU_stat_inc_io()). We use this in heuristics to decide - about evicting uncompressed version of ROW_FORMAT=COMPRESSED pages - from the buffer pool. Since this function is called from buffer pool - load these IOs are deliberate and are not part of normal workload we - can ignore these in our heuristics. */ + { + buf_block_t *b= nullptr; + ulint zip_size{space->zip_size()}; + if (UNIV_LIKELY(!zip_size) && UNIV_UNLIKELY(!(b= buf_read_acquire()))) + goto skip; + buf_read_page_low(page_id, zip_size, nullptr, chain, space, b, nullptr); + if (b || trx) + { + mysql_mutex_lock(&buf_pool.mutex); + if (b) + buf_LRU_block_free_non_file_page(b); + if (UNIV_LIKELY(trx != nullptr)) + { + buf_LRU_stat_inc_io(); + buf_pool.stat.n_ra_pages_read++; + } + mysql_mutex_unlock(&buf_pool.mutex); + } + if (!trx); + else if (ha_handler_stats *stats= trx->active_handler_stats) + stats->pages_prefetched++; + /* buf_load() invokes this with trx=nullptr. In that case, we will + not update any statistics; these deliberate page reads are not + part of a normal workload and therefore should not affect the + unzip_LRU heuristics. */ + } } /** Applies linear read-ahead if in the buf_pool the page is a border page of @@ -668,8 +759,9 @@ failed: break; buf_pool_t::hash_chain &chain= buf_pool.page_hash.cell_get(new_low.fold()); space->reacquire(); - if (buf_read_page_low(new_low, zip_size, chain, space, block) == - DB_SUCCESS) + if (reinterpret_cast(-1) == + buf_read_page_low(new_low, zip_size, nullptr, + chain, space, block, nullptr)) { count++; ut_ad(!block); @@ -679,12 +771,8 @@ failed: } } - if (count) - buf_read_ahead_report(*space, count); - space->release(); - buf_read_release(block); - return count; + return buf_read_release_count(block, count); } /** Schedule a page for recovery. @@ -703,29 +791,23 @@ void buf_read_recover(fil_space_t *space, const page_id_t page_id, if (init_lsn) { - if (buf_page_t *bpage= - buf_page_init_for_read(page_id, zip_size, chain, block)) - { - ut_ad(bpage->in_file()); + buf_page_t *bpage= buf_page_init_for_read(page_id, zip_size, chain, block); + if (UNIV_UNLIKELY(!bpage)) + goto fail; + const bool exist(uintptr_t(bpage) & 1); + bpage= reinterpret_cast(uintptr_t(bpage) & ~uintptr_t{1}); + bpage->unfix(); + + if (!exist) os_fake_read(IORequest{bpage, (buf_tmp_buffer_t*) &recs, UT_LIST_GET_FIRST(space->chain), IORequest::READ_ASYNC}, init_lsn); - return; - } - } - else if (dberr_t err= - buf_read_page_low(page_id, zip_size, chain, space, block)) - { - if (err != DB_SUCCESS_LOCKED_REC) - sql_print_error("InnoDB: Recovery failed to read page " - UINT32PF " from %s", - page_id.page_no(), space->chain.start->name); - } - else - { - ut_ad(!block); - return; } + else if (!buf_read_page_low(page_id, zip_size, nullptr, chain, space, block, + nullptr)) + fail: + sql_print_error("InnoDB: Recovery failed to read page %" PRIu32 " from %s", + page_id.page_no(), space->chain.start->name); - buf_LRU_block_free_non_file_page(block); + buf_read_release(block); } diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 821e1aab2e6..5ad1c75af22 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -2928,25 +2928,31 @@ void IORequest::read_complete(int io_error) const noexcept ut_ad(node); ut_ad(is_read()); ut_ad(bpage); + ut_d(auto s= bpage->state()); + ut_ad(s > buf_page_t::READ_FIX); + ut_ad(s <= buf_page_t::WRITE_FIX); const page_id_t id(bpage->id()); + const bool in_recovery{recv_sys.recovery_on}; if (UNIV_UNLIKELY(io_error != 0)) { sql_print_error("InnoDB: Read error %d of page " UINT32PF " in file %s", io_error, id.page_no(), node->name); recv_sys.free_corrupted_page(id, *node); - buf_pool.corrupted_evict(bpage, buf_page_t::READ_FIX); + buf_pool.corrupted_evict(bpage, buf_page_t::READ_FIX + 1); corrupted: - if (recv_recovery_is_on() && !srv_force_recovery) + if (in_recovery && !srv_force_recovery) { mysql_mutex_lock(&recv_sys.mutex); recv_sys.set_corrupt_fs(); mysql_mutex_unlock(&recv_sys.mutex); } } - else if (bpage->read_complete(*node)) + else if (bpage->read_complete(*node, in_recovery)) goto corrupted; + else + bpage->unfix(); node->space->release(); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 05b7755a6d5..e19b4cecfcf 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19371,7 +19371,7 @@ static MYSQL_SYSVAR_SIZE_T(ft_result_cache_limit, fts_result_cache_limit, static MYSQL_SYSVAR_ULONG(ft_min_token_size, fts_min_token_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "InnoDB Fulltext search minimum token size in characters", - NULL, NULL, 3, 0, 16, 0); + NULL, NULL, 3, 1, 16, 0); static MYSQL_SYSVAR_ULONG(ft_max_token_size, fts_max_token_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 3cef20f3b14..231df868166 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -39,6 +39,7 @@ Created 11/5/1995 Heikki Tuuri #include "log0log.h" #include "srv0srv.h" #include "transactional_lock_guard.h" +#include "ha_handler_stats.h" #include struct trx_t; @@ -712,10 +713,16 @@ public: /** Complete a read of a page. @param node data file + @param recovery recv_recovery_is_on() @return whether the operation succeeded + @retval DB_SUCCESS if the read succeeded; caller must unfix() @retval DB_PAGE_CORRUPTED if the checksum or the page ID is incorrect @retval DB_DECRYPTION_FAILED if the page cannot be decrypted */ - dberr_t read_complete(const fil_node_t &node) noexcept; + dberr_t read_complete(const fil_node_t &node, bool recovery) noexcept; + + /** Wait for read_complete() by invoking lock.s_lock_nospin(). + @param trx transaction (for updating trx->active_handler_stats) */ + void read_wait(trx_t *trx) noexcept; /** Release a write fix after a page write was completed. @param persistent whether the page belongs to a persistent tablespace @@ -1762,7 +1769,7 @@ inline void buf_page_t::set_state(uint32_t s) noexcept mysql_mutex_assert_owner(&buf_pool.mutex); ut_ad(s <= REMOVE_HASH || s >= UNFIXED); ut_ad(s < WRITE_FIX); - ut_ad(s <= READ_FIX || zip.fix == READ_FIX); + ut_ad(s <= READ_FIX + 1 || zip.fix == READ_FIX + 1); zip.fix= s; } diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h index b11feed36ce..bc50a7d52a2 100644 --- a/storage/innobase/include/buf0rea.h +++ b/storage/innobase/include/buf0rea.h @@ -32,27 +32,26 @@ Created 11/5/1995 Heikki Tuuri will be invoked on read completion. @param page_id page identifier @param chain buf_pool.page_hash cell for page_id +@param err error code: DB_SUCCESS if the page was successfully read, +DB_SUCCESS_LOCKED_REC if the page was not read, +DB_PAGE_CORRUPTED on page checksum mismatch, +DB_DECRYPTION_FAILED if page post encryption checksum matches but +after decryption normal page checksum does not match, +DB_TABLESPACE_DELETED if tablespace .ibd file is missing @param unzip whether to decompress ROW_FORMAT=COMPRESSED pages -@retval DB_SUCCESS if the page was read and is not corrupted -@retval DB_SUCCESS_LOCKED_REC if the page was not read -@retval DB_PAGE_CORRUPTED if page based on checksum check is corrupted, -@retval DB_DECRYPTION_FAILED if page post encryption checksum matches but -after decryption normal page checksum does not match. -@retval DB_TABLESPACE_DELETED if tablespace .ibd file is missing */ -dberr_t buf_read_page(const page_id_t page_id, - buf_pool_t::hash_chain &chain, bool unzip= true) +@return buffer-fixed block (*err may be set to DB_SUCCESS_LOCKED_REC) +@retval nullptr if the page is not available (*err will be set) */ +buf_block_t *buf_read_page(const page_id_t page_id, dberr_t *err, + buf_pool_t::hash_chain &chain, bool unzip= true) noexcept; -/** High-level function which reads a page asynchronously from a file to the -buffer buf_pool if it is not already there. Sets the io_fix flag and sets -an exclusive lock on the buffer frame. The flag is cleared and the x-lock -released by the i/o-handler thread. -@param[in,out] space tablespace -@param[in] page_id page id -@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 */ -void buf_read_page_background(fil_space_t *space, const page_id_t page_id, - ulint zip_size) noexcept - MY_ATTRIBUTE((nonnull)); +/** Read a page asynchronously into buf_pool if it is not already there. +@param page_id page identifier +@param space tablespace +@param trx transaction */ +void buf_read_page_background(const page_id_t page_id, fil_space_t *space, + trx_t *trx) noexcept + MY_ATTRIBUTE((nonnull(2))); /** Applies a random read-ahead in buf_pool if there are at least a threshold value of accessed pages from the random read-ahead area. Does not read any diff --git a/storage/innobase/include/fsp0types.h b/storage/innobase/include/fsp0types.h index 757ead55d03..b808941411f 100644 --- a/storage/innobase/include/fsp0types.h +++ b/storage/innobase/include/fsp0types.h @@ -149,6 +149,7 @@ enum fsp_reserve_t { FSP_CLEANING, /* reservation done during purge operations */ FSP_BLOB /* reservation being done for BLOB insertion */ }; +#endif /* UNIV_INNOCHECKSUM */ /* Number of pages described in a single descriptor page: currently each page description takes less than 1 byte; a descriptor page is repeated every @@ -181,6 +182,7 @@ every XDES_DESCRIBED_PER_PAGE pages in every tablespace. */ /*--------------------------------------*/ /* @} */ +#ifndef UNIV_INNOCHECKSUM /** Check if tablespace is system temporary. @param[in] space_id verify is checksum is enabled for given space. @return true if tablespace is system temporary. */ diff --git a/storage/innobase/include/srw_lock.h b/storage/innobase/include/srw_lock.h index 1181d646c07..cf771eda3cf 100644 --- a/storage/innobase/include/srw_lock.h +++ b/storage/innobase/include/srw_lock.h @@ -212,9 +212,12 @@ class ssux_lock_impl void wr_wait(uint32_t lk) noexcept; /** Wake up wait() on the last rd_unlock() */ void wake() noexcept; - /** Acquire a read lock */ - void rd_wait() noexcept; public: + /** Acquire a read lock, with a spin loop */ + void rd_lock_spin() noexcept; + /** Acquire a read lock, without a spin loop */ + void rd_lock_nospin() noexcept; + void init() noexcept { writer.init(); @@ -271,7 +274,7 @@ public: return false; } - void rd_lock() noexcept { if (!rd_lock_try()) rd_wait(); } + inline void rd_lock() noexcept; void u_lock() noexcept { writer.wr_lock(); @@ -355,6 +358,11 @@ public: void unlock() noexcept { wr_unlock(); } }; +template<> inline void ssux_lock_impl::rd_lock() noexcept +{ rd_lock_nospin(); } +template<> inline void ssux_lock_impl::rd_lock() noexcept +{ if (!rd_lock_try()) rd_lock_spin(); } + #if defined _WIN32 || defined SUX_LOCK_GENERIC /** Slim read-write lock */ template diff --git a/storage/innobase/include/sux_lock.h b/storage/innobase/include/sux_lock.h index a5b09693107..7ef750ff8ae 100644 --- a/storage/innobase/include/sux_lock.h +++ b/storage/innobase/include/sux_lock.h @@ -185,6 +185,8 @@ public: /** Acquire a shared lock */ inline void s_lock(); inline void s_lock(const char *file, unsigned line); + /** Acquire a shared lock, skipping any spin loop */ + inline void s_lock_nospin() noexcept; /** Acquire an update lock */ inline void u_lock(); inline void u_lock(const char *file, unsigned line); @@ -387,6 +389,13 @@ template<> inline void index_lock::operator=(const sux_lock&) memset((void*) this, 0, sizeof *this); } +template<> inline void block_lock::s_lock_nospin() noexcept +{ + ut_ad(!have_any()); + lock.rd_lock_nospin(); + ut_d(s_lock_register()); +} + template inline void sux_lock::s_lock() { ut_ad(!have_x()); diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h index 29fdca665e6..95f01f1cb0d 100644 --- a/storage/innobase/include/trx0purge.h +++ b/storage/innobase/include/trx0purge.h @@ -459,6 +459,9 @@ public: /** @return purge_sys.view or purge_sys.end_view */ inline const ReadViewBase &view() const; + + /** @return whether this is part of CHECK TABLE ... EXTENDED */ + bool is_extended() const noexcept { return latch < END_VIEW; } }; struct end_view_guard diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index c1bbf143a51..06f49e214de 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -24,6 +24,7 @@ Transaction system Created 3/26/1996 Heikki Tuuri *******************************************************/ +#ifndef UNIV_INNOCHECKSUM #pragma once #include "buf0buf.h" #include "fil0fil.h" @@ -279,6 +280,7 @@ FIXED WSREP XID info offsets for 4k page size 10.0.32-galera #define TRX_SYS_WSREP_XID_BQUAL_LEN 12 #define TRX_SYS_WSREP_XID_DATA 16 #endif /* WITH_WSREP*/ +#endif /* !UNIV_INNOCHECKSUM */ /** Doublewrite buffer */ /* @{ */ @@ -327,7 +329,7 @@ constexpr uint32_t TRX_SYS_DOUBLEWRITE_MAGIC_N= 536853855; /** Contents of TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED */ constexpr uint32_t TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N= 1783657386; /* @} */ - +#ifndef UNIV_INNOCHECKSUM trx_t* current_trx(); struct rw_trx_hash_element_t @@ -1330,3 +1332,4 @@ private: /** The transaction system */ extern trx_sys_t trx_sys; +#endif /* !UNIV_INNOCHECKSUM */ diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 2f41bf6d2c1..5d998c8da66 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -27,9 +27,8 @@ Created 3/26/1996 Heikki Tuuri #ifndef trx0undo_h #define trx0undo_h -#ifndef UNIV_INNOCHECKSUM #include "trx0sys.h" - +#ifndef UNIV_INNOCHECKSUM /** The LSB of the "is insert" flag in DB_ROLL_PTR */ #define ROLL_PTR_INSERT_FLAG_POS 55 /** The LSB of the 7-bit trx_rseg_t::id in DB_ROLL_PTR */ diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc index 60837a76330..1c3194a189b 100644 --- a/storage/innobase/log/log0crypt.cc +++ b/storage/innobase/log/log0crypt.cc @@ -670,8 +670,11 @@ ATTRIBUTE_NOINLINE size_t mtr_t::encrypt() noexcept { while (buf + rlen > end) { - rlen-= uint32_t(end - buf); - c.append(buf, end - buf); + if (size_t size= end - buf) + { + rlen-= uint32_t(size); + c.append(buf, size); + } ++i; ut_ad(i != m_log.end()); buf= i->start(); @@ -690,7 +693,7 @@ ATTRIBUTE_NOINLINE size_t mtr_t::encrypt() noexcept } buf= const_cast(mtr_t::parse_length(buf, &rlen)); - ut_ad(buf < end); + ut_ad(buf <= end); } } diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index d25ec328ff6..7f7af75abb0 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -4005,10 +4005,8 @@ static void log_sort_flush_list() noexcept for (size_t i= 0; i < idx; i++) { buf_page_t *b= list[i]; - const lsn_t lsn{b->oldest_modification()}; - if (lsn == 1) - continue; - DBUG_ASSERT(lsn > 2); + ut_d(const lsn_t lsn{b->oldest_modification()}); + ut_ad(lsn == 1 || lsn > 2); UT_LIST_ADD_LAST(buf_pool.flush_list, b); } diff --git a/storage/innobase/sync/srw_lock.cc b/storage/innobase/sync/srw_lock.cc index 4e41f87a703..e7cf2a89a88 100644 --- a/storage/innobase/sync/srw_lock.cc +++ b/storage/innobase/sync/srw_lock.cc @@ -378,12 +378,12 @@ template void ssux_lock_impl::wr_wait(uint32_t) noexcept; template void ssux_lock_impl::wr_wait(uint32_t) noexcept; template -void ssux_lock_impl::rd_wait() noexcept +void ssux_lock_impl::rd_lock_spin() noexcept { - const unsigned delay= srw_pause_delay(); - if (spinloop) { + const unsigned delay= srw_pause_delay(); + for (auto spin= srv_n_spin_wait_rounds; spin; spin--) { srw_pause(delay); @@ -392,14 +392,21 @@ void ssux_lock_impl::rd_wait() noexcept } } - /* Subscribe to writer.wake() or write.wake_all() calls by + rd_lock_nospin(); +} + +template +void ssux_lock_impl::rd_lock_nospin() noexcept +{ + const unsigned delay= srw_pause_delay(); + /* Subscribe to writer.wake() or write.wake_all() calls of concurrently executing rd_wait() or writer.wr_unlock(). */ uint32_t wl= writer.WAITER + writer.lock.fetch_add(writer.WAITER, std::memory_order_acquire); for (;;) { - if (UNIV_LIKELY(writer.HOLDER & wl)) + if (writer.HOLDER & wl) writer.wait(wl); uint32_t lk= rd_lock_try_low(); if (!lk) @@ -429,8 +436,9 @@ void ssux_lock_impl::rd_wait() noexcept writer.wake_all(); } -template void ssux_lock_impl::rd_wait() noexcept; -template void ssux_lock_impl::rd_wait() noexcept; +template void ssux_lock_impl::rd_lock_spin() noexcept; +template void ssux_lock_impl::rd_lock_nospin() noexcept; +template void ssux_lock_impl::rd_lock_nospin() noexcept; #if defined _WIN32 || defined SUX_LOCK_GENERIC template<> void srw_lock_::rd_wait() noexcept diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index d32e0ed2045..31ebfbf8ac2 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -2227,6 +2227,21 @@ static dberr_t trx_undo_prev_version(const rec_t *rec, dict_index_t *index, byte* buf; if (row_upd_changes_field_size_or_external(index, offsets, update)) { + /* When CHECK TABLE ... EXTENDED checks for orphan + records in secondary indexes, it normally covers some + history that is already being purged. This is safe as + long as the undo log records have not been freed yet. + + However, BLOBs are only safe to access as long as the + purge_sys.view does not permit them to be freed. The + check.latch will freeze the purge_sys.view by blocking + purge_sys.clone_oldest_view() at the start of + trx_purge() or by blocking purge_sys.batch_cleanup() + at the end of trx_purge(). */ + if (check.is_extended() && purge_sys.is_purgeable(trx_id)) { + return DB_SUCCESS; + } + /* We should confirm the existence of disowned external data, if the previous version record is delete marked. If the trx_id of the previous record is seen by purge view, we should treat diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 9cb098b38a5..62c41c6be17 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1268,9 +1268,7 @@ static void trx_flush_log_if_needed(lsn_t lsn, trx_t *trx) if (log_sys.get_flushed_lsn(std::memory_order_relaxed) >= lsn) return; - const bool flush= - (!my_disable_sync && - (srv_flush_log_at_trx_commit & 1)); + const bool flush= srv_flush_log_at_trx_commit & 1; if (!log_sys.is_mmap()) { completion_callback cb; @@ -1969,7 +1967,7 @@ trx_prepare( We must not be holding any mutexes or latches here. */ if (auto f = srv_flush_log_at_trx_commit) { - log_write_up_to(lsn, (f & 1) && !my_disable_sync); + log_write_up_to(lsn, f & 1); } if (!UT_LIST_GET_LEN(trx->lock.trx_locks) diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 24af4ac7cdd..409d803fab2 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -1757,6 +1757,13 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize) /* Set trid (needed if the table was moved from another system) */ share->state.create_trid= trnman_get_min_safe_trid(); } + + /* + Leaving not-zero value here leads to crash in the following + maria_delete() particularly when we execute REPAIR TABLE partitioned_t;. + */ + file->cur_row.trid= 0; + mysql_mutex_lock(&share->intern_lock); if (!error) { diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c index d7624f3299b..7e05d49c1fa 100644 --- a/storage/maria/ma_update.c +++ b/storage/maria/ma_update.c @@ -16,6 +16,7 @@ #include "ma_fulltext.h" #include "ma_rt_index.h" #include "trnman.h" +#include /** Update an old row in a MARIA table @@ -113,10 +114,19 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, { MARIA_KEY new_key, old_key; - (*keyinfo->make_key)(info,&new_key, i, new_key_buff, newrec, - pos, info->trn->trid); - (*keyinfo->make_key)(info,&old_key, i, old_key_buff, - oldrec, pos, info->cur_row.trid); + if (!(*keyinfo->make_key)(info,&new_key, i, new_key_buff, newrec, + pos, info->trn->trid)) + goto err; + + if (!(*keyinfo->make_key)(info,&old_key, i, old_key_buff, + oldrec, pos, info->cur_row.trid)) + { + /* + Can't make a key from the record from the table already. + Sholdn't happen normally. Table is corrupted. + */ + goto err; + } /* The above changed info->lastkey2. Inform maria_rnext_same(). */ info->update&= ~HA_STATE_RNEXT_SAME; @@ -204,7 +214,7 @@ err: save_errno= HA_ERR_INTERNAL_ERROR; /* Should never happen */ if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_OUT_OF_MEM || - my_errno == HA_ERR_RECORD_FILE_FULL) + my_errno == HA_ERR_RECORD_FILE_FULL || my_errno == HA_ERR_NULL_IN_SPATIAL) { info->errkey= (int) i; flag=0; diff --git a/storage/rocksdb/myrocks_hotbackup.py b/storage/rocksdb/myrocks_hotbackup.py index 42c25c95c1c..5fe83d68b64 100755 --- a/storage/rocksdb/myrocks_hotbackup.py +++ b/storage/rocksdb/myrocks_hotbackup.py @@ -268,7 +268,7 @@ class RocksDBBackup(): start_time= time.time() last_progress_time= start_time progress_size= 0 - for fname, size in self.target_sst.iteritems(): + for fname, size in self.target_sst.items(): self.do_backup_sst(fname, size) progress_size= progress_size + size elapsed_seconds = time.time() - start_time @@ -319,11 +319,13 @@ class MySQLUtil: if socket: dbh = MySQLdb.Connect(user=user, passwd=password, + charset='utf8', unix_socket=socket) else: dbh = MySQLdb.Connect(user=user, passwd=password, port=port, + charset='utf8', host="127.0.0.1") return dbh @@ -645,8 +647,8 @@ def move_back(): print_move_back_usage() sys.exit() create_moveback_dir(opts.datadir) - create_moveback_dir(opts.rocksdb_datadir) create_moveback_dir(opts.rocksdb_waldir) + create_moveback_dir(opts.rocksdb_datadir) os.chdir(opts.backupdir) for f in os.listdir(opts.backupdir): diff --git a/storage/spider/mysql-test/spider/bg/include/deinit_child2_1.inc b/storage/spider/mysql-test/spider/bg/include/deinit_child2_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/deinit_child2_2.inc b/storage/spider/mysql-test/spider/bg/include/deinit_child2_2.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/deinit_child2_3.inc b/storage/spider/mysql-test/spider/bg/include/deinit_child2_3.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/deinit_child3_1.inc b/storage/spider/mysql-test/spider/bg/include/deinit_child3_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/deinit_child3_2.inc b/storage/spider/mysql-test/spider/bg/include/deinit_child3_2.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/deinit_child3_3.inc b/storage/spider/mysql-test/spider/bg/include/deinit_child3_3.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/deinit_slave1_1.inc b/storage/spider/mysql-test/spider/bg/include/deinit_slave1_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/ha_deinit_child2_1.inc b/storage/spider/mysql-test/spider/bg/include/ha_deinit_child2_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/ha_deinit_child2_2.inc b/storage/spider/mysql-test/spider/bg/include/ha_deinit_child2_2.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/ha_deinit_child2_3.inc b/storage/spider/mysql-test/spider/bg/include/ha_deinit_child2_3.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/ha_deinit_master_1.inc b/storage/spider/mysql-test/spider/bg/include/ha_deinit_master_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/ha_init_child2_1.inc b/storage/spider/mysql-test/spider/bg/include/ha_init_child2_1.inc deleted file mode 100644 index 2684829408d..00000000000 --- a/storage/spider/mysql-test/spider/bg/include/ha_init_child2_1.inc +++ /dev/null @@ -1,8 +0,0 @@ -let $CHILD2_1_HA_AS_DROP_TABLES= - $CHILD2_1_DROP_TABLES; -let $CHILD2_1_HA_AS_CREATE_TABLES= - $CHILD2_1_CREATE_TABLES; -let $CHILD2_1_HA_AS_DROP_TABLES2= - $CHILD2_1_DROP_TABLES2; -let $CHILD2_1_HA_AS_CREATE_TABLES2= - $CHILD2_1_CREATE_TABLES2; diff --git a/storage/spider/mysql-test/spider/bg/include/ha_init_child2_2.inc b/storage/spider/mysql-test/spider/bg/include/ha_init_child2_2.inc deleted file mode 100644 index 205eaa6fe35..00000000000 --- a/storage/spider/mysql-test/spider/bg/include/ha_init_child2_2.inc +++ /dev/null @@ -1,4 +0,0 @@ -let $CHILD2_2_HA_DROP_TABLES= - $CHILD2_2_DROP_TABLES; -let $CHILD2_2_HA_CREATE_TABLES= - $CHILD2_2_CREATE_TABLES; diff --git a/storage/spider/mysql-test/spider/bg/include/ha_init_child2_3.inc b/storage/spider/mysql-test/spider/bg/include/ha_init_child2_3.inc deleted file mode 100644 index 55cb858372c..00000000000 --- a/storage/spider/mysql-test/spider/bg/include/ha_init_child2_3.inc +++ /dev/null @@ -1,4 +0,0 @@ -let $CHILD2_3_HA_DROP_TABLES= - $CHILD2_3_DROP_TABLES; -let $CHILD2_3_HA_CREATE_TABLES= - $CHILD2_3_CREATE_TABLES; diff --git a/storage/spider/mysql-test/spider/bg/include/ha_init_child3_1.inc b/storage/spider/mysql-test/spider/bg/include/ha_init_child3_1.inc index 3ac4f97b1e0..8e8cecb0acb 100644 --- a/storage/spider/mysql-test/spider/bg/include/ha_init_child3_1.inc +++ b/storage/spider/mysql-test/spider/bg/include/ha_init_child3_1.inc @@ -11,130 +11,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $CHILD3_1_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $CHILD3_1_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $CHILD3_1_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $CHILD3_1_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $CHILD3_1_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; - -let $CHILD3_1_DROP_TABLES_HA_2_1= - DROP TABLE IF EXISTS ta_l; -if ($VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_1_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_1_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_1_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_1_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $CHILD3_1_DROP_TABLES_HA_P_2_1= - DROP TABLE IF EXISTS ta_l2; -let $CHILD3_1_CREATE_TABLES_HA_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $CHILD3_1_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $CHILD3_1_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); diff --git a/storage/spider/mysql-test/spider/bg/include/ha_init_child3_2.inc b/storage/spider/mysql-test/spider/bg/include/ha_init_child3_2.inc index cf47099f439..dcf51f36ff4 100644 --- a/storage/spider/mysql-test/spider/bg/include/ha_init_child3_2.inc +++ b/storage/spider/mysql-test/spider/bg/include/ha_init_child3_2.inc @@ -11,130 +11,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $CHILD3_2_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $CHILD3_2_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $CHILD3_2_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $CHILD3_2_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $CHILD3_2_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; - -let $CHILD3_2_DROP_TABLES_HA_2_1= - DROP TABLE IF EXISTS ta_l; -if ($VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_2_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_2_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_2_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_2_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $CHILD3_2_DROP_TABLES_HA_P_2_1= - DROP TABLE IF EXISTS ta_l2; -let $CHILD3_2_CREATE_TABLES_HA_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $CHILD3_2_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $CHILD3_2_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); diff --git a/storage/spider/mysql-test/spider/bg/include/ha_init_child3_3.inc b/storage/spider/mysql-test/spider/bg/include/ha_init_child3_3.inc index 094d26b62c6..7530d40e0c6 100644 --- a/storage/spider/mysql-test/spider/bg/include/ha_init_child3_3.inc +++ b/storage/spider/mysql-test/spider/bg/include/ha_init_child3_3.inc @@ -11,130 +11,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $CHILD3_3_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $CHILD3_3_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $CHILD3_3_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $CHILD3_3_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $CHILD3_3_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; - -let $CHILD3_3_DROP_TABLES_HA_2_1= - DROP TABLE IF EXISTS ta_l; -if ($VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_3_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_3_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_3_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_3_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $CHILD3_3_DROP_TABLES_HA_P_2_1= - DROP TABLE IF EXISTS ta_l2; -let $CHILD3_3_CREATE_TABLES_HA_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $CHILD3_3_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $CHILD3_3_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); diff --git a/storage/spider/mysql-test/spider/bg/include/ha_init_master_1.inc b/storage/spider/mysql-test/spider/bg/include/ha_init_master_1.inc index 78797d80ce7..46a47f916f0 100644 --- a/storage/spider/mysql-test/spider/bg/include/ha_init_master_1.inc +++ b/storage/spider/mysql-test/spider/bg/include/ha_init_master_1.inc @@ -8,98 +8,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $MASTER_1_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $MASTER_1_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $MASTER_1_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $MASTER_1_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $MASTER_1_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; -let $MASTER_1_COPY_TABLES_2_1= - SELECT spider_copy_tables('ta_l', '0', '1'); - -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_HA_2_1= - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $MASTER_1_COMMENT_HA_AS_2_1= - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_HA_2_1= - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $MASTER_1_COMMENT_HA_AS_2_1= - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $MASTER_1_COMMENT_HA_P_2_1= - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $MASTER_1_COMMENT_HA_AS_P_2_1= - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $MASTER_1_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $MASTER_1_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $MASTER_1_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); -let $MASTER_1_COPY_TABLES_P_2_1= - SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); -let $MASTER_1_CHECK_HA_STATUS= - SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -let $MASTER_1_CHANGE_HA_MON= - SELECT spider_flush_table_mon_cache(); diff --git a/storage/spider/mysql-test/spider/bg/include/init_child2_1.inc b/storage/spider/mysql-test/spider/bg/include/init_child2_1.inc deleted file mode 100644 index 611ce6012a8..00000000000 --- a/storage/spider/mysql-test/spider/bg/include/init_child2_1.inc +++ /dev/null @@ -1,175 +0,0 @@ -let $CHILD2_1_DROP_TABLES= - DROP TABLE IF EXISTS ta_r; -let $CHILD2_1_CREATE_TABLES= - CREATE TABLE ta_r ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a), - KEY idx1(b) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; -let $CHILD2_1_DROP_TABLES2= - DROP TABLE IF EXISTS ta_r2; -let $CHILD2_1_CREATE_TABLES2= - CREATE TABLE ta_r2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES2= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; -let $CHILD2_1_DROP_TABLES3= - DROP TABLE IF EXISTS ta_r_no_idx; -let $CHILD2_1_CREATE_TABLES3= - CREATE TABLE ta_r_no_idx ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10' - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES3= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a; -let $CHILD2_1_DROP_TABLES4= - DROP TABLE IF EXISTS ta_r_auto_inc; -let $CHILD2_1_CREATE_TABLES4= - CREATE TABLE ta_r_auto_inc ( - a INT AUTO_INCREMENT, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES4= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc - ORDER BY a; -let $CHILD2_1_DROP_TABLES5= - DROP TABLE IF EXISTS ta_r_int; -let $CHILD2_1_CREATE_TABLES5= - CREATE TABLE ta_r_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES5= - SELECT a, b, c FROM ta_r_int ORDER BY a; -let $CHILD2_1_DROP_TABLES6= - DROP TABLE IF EXISTS ta_r_3; -let $CHILD2_1_CREATE_TABLES6= - CREATE TABLE ta_r_3 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10' - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES6= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_3 ORDER BY a; -let $CHILD2_1_DROP_FT_TABLES= - DROP TABLE IF EXISTS ft_r; -let $CHILD2_1_CREATE_FT_TABLES= - CREATE TABLE ft_r ( - a INT DEFAULT 0, - b TEXT, - c TEXT, - d TEXT, - PRIMARY KEY(a), - FULLTEXT INDEX ft_idx1(b), - FULLTEXT INDEX ft_idx2(c) - ) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET; -let $CHILD2_1_SELECT_FT_TABLES= - SELECT a, b, c, d FROM ft_r ORDER BY a; -let $CHILD2_1_DROP_FT_TABLES2= - DROP TABLE IF EXISTS ft_r2; -let $CHILD2_1_CREATE_FT_TABLES2= - CREATE TABLE ft_r2 ( - a INT DEFAULT 0, - b TEXT, - c TEXT, - d TEXT, - PRIMARY KEY(a), - FULLTEXT INDEX ft_idx1(b), - FULLTEXT INDEX ft_idx2(c) - ) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET; -let $CHILD2_1_SELECT_FT_TABLES2= - SELECT a, b, c, d FROM ft_r2 ORDER BY a; -let $CHILD2_1_DROP_GM_TABLES= - DROP TABLE IF EXISTS gm_r; -let $CHILD2_1_CREATE_GM_TABLES= - CREATE TABLE gm_r ( - a INT DEFAULT 0, - b GEOMETRY NOT NULL, - c GEOMETRY NOT NULL, - PRIMARY KEY(a), - SPATIAL INDEX sp_idx1(b), - SPATIAL INDEX sp_idx2(c) - ) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET; -let $CHILD2_1_SELECT_GM_TABLES= - SELECT a, b, c FROM gm_r ORDER BY a; -let $CHILD2_1_DROP_GM_TABLES2= - DROP TABLE IF EXISTS gm_r2; -let $CHILD2_1_CREATE_GM_TABLES2= - CREATE TABLE gm_r2 ( - a INT DEFAULT 0, - b GEOMETRY NOT NULL, - c GEOMETRY NOT NULL, - PRIMARY KEY(a), - SPATIAL INDEX sp_idx1(b), - SPATIAL INDEX sp_idx2(c) - ) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET; -let $CHILD2_1_SELECT_GM_TABLES2= - SELECT a, b, c FROM gm_r2 ORDER BY a; -let $CHILD2_1_DROP_LOCK_TABLES1= - DROP TABLE IF EXISTS t1_1; -let $CHILD2_1_CREATE_LOCK_TABLES1= - CREATE TABLE t1_1 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_DROP_LOCK_TABLES2= - DROP TABLE IF EXISTS t2_2; -let $CHILD2_1_CREATE_LOCK_TABLES2= - CREATE TABLE t2_2 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_DROP_INCREMENT_TABLES1= - DROP TABLE IF EXISTS t1_1; -let $CHILD2_1_CREATE_INCREMENT_TABLES1= - CREATE TABLE t1_1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_INCREMENT_TABLES1= - SELECT id FROM t1_1 ORDER BY id; -let $CHILD2_1_DROP_TEXT_PK_TABLES1= - DROP TABLE IF EXISTS t1; -let $CHILD2_1_CREATE_TEXT_PK_TABLES1= - CREATE TABLE t1 ( - a VARCHAR(255), - PRIMARY KEY (a) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET2; -let $CHILD2_1_SELECT_TEXT_PK_TABLES1= - SELECT a FROM t1 ORDER BY a; -let $CHILD2_1_DROP_TEXT_KEY_TABLES1= - DROP TABLE IF EXISTS t1; -let $CHILD2_1_CREATE_TEXT_KEY_TABLES1= - CREATE TABLE t1 ( - a VARCHAR(255), - b VARCHAR(255), - c VARCHAR(255), - KEY idx1(a,b), - KEY idx2(b), - PRIMARY KEY(c) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TEXT_KEY_TABLES1= - SELECT a, b FROM t1 ORDER BY a, b; -let $CHILD2_1_AUTO_INCREMENT_INCREMENT1= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; -let $CHILD2_1_AUTO_INCREMENT_INCREMENT2= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; -let $CHILD2_1_AUTO_INCREMENT_OFFSET1= - SET GLOBAL AUTO_INCREMENT_OFFSET = 1; -let $CHILD2_1_AUTO_INCREMENT_OFFSET2= - SET GLOBAL AUTO_INCREMENT_OFFSET = 2; diff --git a/storage/spider/mysql-test/spider/bg/include/init_child2_2.inc b/storage/spider/mysql-test/spider/bg/include/init_child2_2.inc deleted file mode 100644 index 9f0b5e2fe5a..00000000000 --- a/storage/spider/mysql-test/spider/bg/include/init_child2_2.inc +++ /dev/null @@ -1,80 +0,0 @@ -let $CHILD2_2_DROP_TABLES= - DROP TABLE IF EXISTS ta_r3; -let $CHILD2_2_CREATE_TABLES= - CREATE TABLE ta_r3 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_DROP_TABLES5= - DROP TABLE IF EXISTS ta_r_int; -let $CHILD2_2_CREATE_TABLES5= - CREATE TABLE ta_r_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_SELECT_TABLES= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; -let $CHILD2_2_DROP_FT_TABLES= - DROP TABLE IF EXISTS ft_r3; -let $CHILD2_2_CREATE_FT_TABLES= - CREATE TABLE ft_r3 ( - a INT DEFAULT 0, - b TEXT, - c TEXT, - d TEXT, - PRIMARY KEY(a), - FULLTEXT INDEX ft_idx1(b), - FULLTEXT INDEX ft_idx2(c) - ) $CHILD2_2_FT_ENGINE $CHILD2_2_FT_CHARSET; -let $CHILD2_2_SELECT_FT_TABLES= - SELECT a, b, c, d FROM ft_r3 ORDER BY a; -let $CHILD2_2_DROP_GM_TABLES= - DROP TABLE IF EXISTS gm_r3; -let $CHILD2_2_CREATE_GM_TABLES= - CREATE TABLE gm_r3 ( - a INT DEFAULT 0, - b GEOMETRY NOT NULL, - c GEOMETRY NOT NULL, - PRIMARY KEY(a), - SPATIAL INDEX sp_idx1(b), - SPATIAL INDEX sp_idx2(c) - ) $CHILD2_2_GM_ENGINE $CHILD2_2_GM_CHARSET; -let $CHILD2_2_SELECT_GM_TABLES= - SELECT a, b, c FROM gm_r3 ORDER BY a; -let $CHILD2_2_DROP_LOCK_TABLES1= - DROP TABLE IF EXISTS t1_2; -let $CHILD2_2_CREATE_LOCK_TABLES1= - CREATE TABLE t1_2 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_DROP_LOCK_TABLES2= - DROP TABLE IF EXISTS t2_1; -let $CHILD2_2_CREATE_LOCK_TABLES2= - CREATE TABLE t2_1 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_DROP_INCREMENT_TABLES1= - DROP TABLE IF EXISTS t1_2; -let $CHILD2_2_CREATE_INCREMENT_TABLES1= - CREATE TABLE t1_2 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_SELECT_INCREMENT_TABLES1= - SELECT id FROM t1_2 ORDER BY id; -let $CHILD2_2_AUTO_INCREMENT_INCREMENT1= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; -let $CHILD2_2_AUTO_INCREMENT_INCREMENT2= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; -let $CHILD2_2_AUTO_INCREMENT_OFFSET1= - SET GLOBAL AUTO_INCREMENT_OFFSET = 1; -let $CHILD2_2_AUTO_INCREMENT_OFFSET2= - SET GLOBAL AUTO_INCREMENT_OFFSET = 3; diff --git a/storage/spider/mysql-test/spider/bg/include/init_child2_3.inc b/storage/spider/mysql-test/spider/bg/include/init_child2_3.inc deleted file mode 100644 index 05dbb1c3dd1..00000000000 --- a/storage/spider/mysql-test/spider/bg/include/init_child2_3.inc +++ /dev/null @@ -1,11 +0,0 @@ -let $CHILD2_3_DROP_TABLES= - DROP TABLE IF EXISTS ta_r4; -let $CHILD2_3_CREATE_TABLES= - CREATE TABLE ta_r4 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET; -let $CHILD2_3_SELECT_TABLES= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; diff --git a/storage/spider/mysql-test/spider/bg/include/init_child3_1.inc b/storage/spider/mysql-test/spider/bg/include/init_child3_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/init_child3_2.inc b/storage/spider/mysql-test/spider/bg/include/init_child3_2.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/init_child3_3.inc b/storage/spider/mysql-test/spider/bg/include/init_child3_3.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/bg/include/init_master_1.inc b/storage/spider/mysql-test/spider/bg/include/init_master_1.inc index d6e302a6e1f..9a67251d023 100644 --- a/storage/spider/mysql-test/spider/bg/include/init_master_1.inc +++ b/storage/spider/mysql-test/spider/bg/include/init_master_1.inc @@ -9,186 +9,3 @@ SET spider_multi_split_read= 1; SET spider_reset_sql_alloc= 0; SET spider_bulk_update_size= 40; SET spider_direct_order_limit= 10000; -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_2_1= - COMMENT='database "auto_test_remote", table "ta_r"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_2_1= - COMMENT='database "auto_test_remote", table "ta_r"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT2_2_1= - COMMENT='database "auto_test_remote", table "ta_r_no_idx"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password "", prt "2000000"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT2_2_1= - COMMENT='database "auto_test_remote", table "ta_r_no_idx"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password "", prt "2000000"'; -} -let $MASTER_1_COMMENT_P_2_1= - COMMENT='table "ta_r3"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1", table "ta_r2", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_2", priority "1000001"' - ); -let $MASTER_1_COMMENT2_P_2_1= - COMMENT='table "ta_r3"' - PARTITION BY RANGE(a) ( - PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", - table "ta_r2", priority "1000"', - PARTITION pt2 VALUES LESS THAN MAXVALUE - COMMENT='srv "s_2_2", priority "1000001"' - ); -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT3_2_1= - COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT3_2_1= - COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -let $MASTER_1_COMMENT3_P_2_1= - COMMENT='table "ta_r_int"' - PARTITION BY LIST(MOD(a, 2)) ( - PARTITION pt1 VALUES IN (0) - COMMENT='srv "s_2_1", priority "1000"', - PARTITION pt2 VALUES IN (1) - COMMENT='srv "s_2_2", priority "1000001"' - ); -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT4_2_1= - COMMENT='database "auto_test_remote", table "ta_r_int"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT4_2_1= - COMMENT='database "auto_test_remote", table "ta_r_int"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT5_2_1= - COMMENT='database "auto_test_remote", table "ta_r_3"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT5_2_1= - COMMENT='database "auto_test_remote", table "ta_r_3"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_FT_2_1= - COMMENT='database "auto_test_remote", table "ft_r"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_FT_2_1= - COMMENT='database "auto_test_remote", table "ft_r"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -let $MASTER_1_COMMENT2_FT_P_2_1= - COMMENT='table "ft_r3"' - PARTITION BY RANGE(a) ( - PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", - table "ft_r2", priority "1000"', - PARTITION pt2 VALUES LESS THAN MAXVALUE - COMMENT='srv "s_2_2", priority "1000001"' - ); -let $MASTER_1_COMMENT_GM_2_1= - COMMENT='srv "s_2_1", table "gm_r"'; -let $MASTER_1_COMMENT2_GM_P_2_1= - COMMENT='table "gm_r3"' - PARTITION BY RANGE(a) ( - PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", - table "gm_r2", priority "1000"', - PARTITION pt2 VALUES LESS THAN MAXVALUE - COMMENT='srv "s_2_2", priority "1000001"' - ); -let $MASTER_1_COMMENT_LOCK1= - COMMENT 'tbl "t1_1 t1_2", srv "s_2_1 s_2_2"'; -let $MASTER_1_COMMENT_LOCK2= - COMMENT 'tbl "t2_1 t2_2", srv "s_2_2 s_2_1"'; -let $MASTER_1_COMMENT_INCREMENT1_1= - COMMENT 'aim "1", tbl "t1_1", srv "s_2_1"'; -let $MASTER_1_COMMENT_INCREMENT1_P_1= - COMMENT 'aim "1"' - PARTITION BY LIST(MOD(id, 2)) ( - PARTITION pt1 VALUES IN (0) - COMMENT='tbl "t1_1", srv "s_2_1"', - PARTITION pt2 VALUES IN (1) - COMMENT='tbl "t1_2", srv "s_2_2"' - ); -let $MASTER_1_COMMENT_READONLY1_1= - COMMENT 'read_only_mode "1", tbl "t1_1", srv "s_2_1"'; -let $MASTER_1_COMMENT_ERROR_MODE1_1= - COMMENT 'erm "1", ewm "1", tbl "ter1_1", srv "s_2_1"'; -let $MASTER_1_COMMENT_TEXT_PK1_1= - COMMENT 'tbl "t1", srv "s_2_1"'; -let $MASTER_1_COMMENT_TEXT_KEY1_1= - COMMENT 'tbl "t1", srv "s_2_1"'; -let $MASTER_1_CHECK_DIRECT_UPDATE_STATUS= - SHOW STATUS LIKE 'Spider_direct_update'; -let $MASTER_1_CHECK_DIRECT_DELETE_STATUS= - SHOW STATUS LIKE 'Spider_direct_delete'; -let $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS= - SHOW STATUS LIKE 'Spider_direct_order_limit'; -let $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS= - SHOW STATUS LIKE 'Spider_direct_aggregate'; -let $MASTER_1_AUTO_INCREMENT_INCREMENT1= - SET SESSION AUTO_INCREMENT_INCREMENT = 1 $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 1', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 1', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_INCREMENT2= - SET SESSION AUTO_INCREMENT_INCREMENT = 777 $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_OFFSET1= - SET SESSION AUTO_INCREMENT_OFFSET = 1 $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 1', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 1', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_OFFSET2= - SET SESSION AUTO_INCREMENT_OFFSET = 777 $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_OFFSET3= - SET SESSION AUTO_INCREMENT_OFFSET = 1; -let $MASTER_1_AUTO_INCREMENT_OFFSET4= - SET SESSION AUTO_INCREMENT_OFFSET = 777; diff --git a/storage/spider/mysql-test/spider/bg/include/init_slave1_1.inc b/storage/spider/mysql-test/spider/bg/include/init_slave1_1.inc deleted file mode 100644 index 73c3c6b9ef2..00000000000 --- a/storage/spider/mysql-test/spider/bg/include/init_slave1_1.inc +++ /dev/null @@ -1,10 +0,0 @@ -let $SLAVE1_1_COMMENT_INCREMENT1_1= - COMMENT ''; -let $SLAVE1_1_COMMENT_INCREMENT1_P_1= - COMMENT '' - PARTITION BY LIST(MOD(id, 2)) ( - PARTITION pt1 VALUES IN (0) - COMMENT='', - PARTITION pt2 VALUES IN (1) - COMMENT='' - ); diff --git a/storage/spider/mysql-test/spider/bg/my.cnf b/storage/spider/mysql-test/spider/bg/my.cnf index ef9a042ca11..7cb9cf710ed 100644 --- a/storage/spider/mysql-test/spider/bg/my.cnf +++ b/storage/spider/mysql-test/spider/bg/my.cnf @@ -146,32 +146,3 @@ CHILD3_3_ENGINE= ENGINE=InnoDB CHILD3_3_CHARSET= DEFAULT CHARSET=utf8 STR_SEMICOLON= ; - -#The followings are set in include/init_xxx.inc files -# MASTER_1_COMMENT_2_1 -# MASTER_1_COMMENT2_2_1 -# MASTER_1_COMMENT3_2_1 -# MASTER_1_COMMENT4_2_1 -# MASTER_1_COMMENT5_2_1 -# MASTER_1_COMMENT_P_2_1 -# CHILD2_1_DROP_TABLES -# CHILD2_1_CREATE_TABLES -# CHILD2_1_SELECT_TABLES -# CHILD2_1_DROP_TABLES2 -# CHILD2_1_CREATE_TABLES2 -# CHILD2_1_SELECT_TABLES2 -# CHILD2_1_DROP_TABLES3 -# CHILD2_1_CREATE_TABLES3 -# CHILD2_1_SELECT_TABLES3 -# CHILD2_1_DROP_TABLES4 -# CHILD2_1_CREATE_TABLES4 -# CHILD2_1_SELECT_TABLES4 -# CHILD2_1_DROP_TABLES5 -# CHILD2_1_CREATE_TABLES5 -# CHILD2_1_SELECT_TABLES5 -# CHILD2_1_DROP_TABLES6 -# CHILD2_1_CREATE_TABLES6 -# CHILD2_1_SELECT_TABLES6 -# CHILD2_2_DROP_TABLES -# CHILD2_2_CREATE_TABLES -# CHILD2_2_SELECT_TABLES diff --git a/storage/spider/mysql-test/spider/bg/t/basic_sql.test b/storage/spider/mysql-test/spider/bg/t/basic_sql.test index 24fa4314097..7b3ec715f86 100644 --- a/storage/spider/mysql-test/spider/bg/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/bg/t/basic_sql.test @@ -12,8 +12,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -22,65 +20,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tb_l; @@ -92,12 +64,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -113,71 +85,32 @@ echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 SELECT a, b, c FROM tb_l; -if ($MASTER_1_MERGE) -{ - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""' SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; - INSERT INTO ta_l SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_MERGE) -{ - eval CREATE TABLE ta_l ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 - SELECT a, b, c FROM tb_l; -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo create table ignore select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -190,12 +123,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'f', '2008-07-01 10:21:39'), @@ -208,71 +141,32 @@ echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 IGNORE SELECT a, b, c FROM tb_l; -if ($MASTER_1_MERGE) -{ - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""' IGNORE SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; - INSERT IGNORE INTO ta_l SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_MERGE) -{ - eval CREATE TABLE ta_l ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 - IGNORE SELECT a, b, c FROM tb_l; -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo create table ignore select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -282,85 +176,40 @@ echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 REPLACE SELECT a, b, c FROM tb_l; -if ($MASTER_1_MERGE) -{ - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""' REPLACE SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; - REPLACE INTO ta_l SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_MERGE) -{ - eval CREATE TABLE ta_l ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 - REPLACE SELECT a, b, c FROM tb_l; -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%replace %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo create no index table -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES3; - echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l_no_idx; @@ -369,781 +218,331 @@ DROP TABLE IF EXISTS ta_l_no_idx; echo CREATE TABLE ta_l_no_idx MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1 SELECT a, b, c FROM tb_l; -if ($MASTER_1_NEEDPK) -{ - --error ER_REQUIRES_PRIMARY_KEY - eval CREATE TABLE ta_l_no_idx - $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1 - SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l_no_idx ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; - INSERT INTO ta_l_no_idx SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_NEEDPK) -{ - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l_no_idx - $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1 +eval +CREATE TABLE ta_l_no_idx +ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"' SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l_no_idx ( - a INT, - b CHAR(1), - c DATETIME - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; - INSERT INTO ta_l_no_idx SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l_no_idx - $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1 - SELECT a, b, c FROM tb_l; - } -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES3; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l_no_idx ORDER BY a; --echo --echo select table -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table shared mode -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a LOCK IN SHARE MODE; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table for update -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a FOR UPDATE; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table join -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a, tb_l b WHERE a.a = b.a ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table straight_join -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT STRAIGHT_JOIN a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a, tb_l b WHERE a.a = b.a ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_small_result -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_SMALL_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_big_result -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_BIG_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_buffer_result -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_BUFFER_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_cache -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_no_cache -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_NO_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select high_priority -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT HIGH_PRIORITY a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select distinct -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT DISTINCT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select count -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT count(*) FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table join not use index -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 # MDEV-36357 --disable_view_protocol SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM tb_l a WHERE EXISTS (SELECT * FROM ta_l b WHERE b.b = a.b) ORDER BY a.a; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select using pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE a.b = 'g' ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select using index and pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE a.a > 0 AND a.b = 'g' ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo insert --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1151,45 +550,21 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert select --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1197,46 +572,22 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert select a --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1), 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1244,45 +595,21 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert low_priority --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT LOW_PRIORITY INTO ta_l (a, b, c) values (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1290,90 +617,42 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert high_priority --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT HIGH_PRIORITY INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo insert ignore -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT IGNORE INTO ta_l (a, b, c) VALUES (2, 'd', '2009-02-02 01:01:01'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1381,97 +660,49 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert update (insert) --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE KEY UPDATE b = 'f', c = '2005-08-08 11:11:11'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo insert update (update) -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE KEY UPDATE b = 'f', c = '2005-08-08 11:11:11'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1480,191 +711,95 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --connection master_1 TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE INTO ta_l (a, b, c) VALUES (2, 'f', '2008-02-02 02:02:02'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo replace select -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo replace select a -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1), 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo replace low_priority -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE LOW_PRIORITY INTO ta_l (a, b, c) VALUES (3, 'g', '2009-03-03 03:03:03'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1673,409 +808,193 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update select -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a IN (SELECT a FROM tb_l); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update select a -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'h', c = '2010-04-04 04:04:04' WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update join -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l a, tb_l b SET a.b = b.b, a.c = b.c WHERE a.a = b.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update join a -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l a, tb_l b SET a.b = 'g', a.c = '2009-03-03 03:03:03' WHERE a.a = b.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update low_priority -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE LOW_PRIORITY ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update ignore -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE IGNORE ta_l SET a = 1, b = 'g', c = '2009-03-03 03:03:03' WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 update ta_l set b = 'j', c = '2009-03-03 03:03:03' where b = 'f'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update index pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'j'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2088,91 +1007,43 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo delete all -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2185,46 +1056,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a IN (SELECT a FROM tb_l); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2237,46 +1084,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2289,46 +1112,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE a FROM ta_l a, (SELECT a FROM tb_l ORDER BY a) b WHERE a.a = b.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2341,46 +1140,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE LOW_PRIORITY FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2393,46 +1168,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE IGNORE FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2445,46 +1196,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE QUICK FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2497,46 +1224,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE b = 'e'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2549,90 +1252,42 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a > 0 AND b = 'e'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo truncate -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'truncate %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2641,13 +1296,10 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/basic_sql_part.test b/storage/spider/mysql-test/spider/bg/t/basic_sql_part.test index 1bb18358d5d..b1a8499251c 100644 --- a/storage/spider/mysql-test/spider/bg/t/basic_sql_part.test +++ b/storage/spider/mysql-test/spider/bg/t/basic_sql_part.test @@ -5,16 +5,6 @@ --source test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -22,8 +12,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -32,30 +20,20 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings @@ -68,12 +46,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'f', '2008-07-01 10:21:39'), @@ -84,483 +62,226 @@ INSERT INTO tb_l (a, b, c) VALUES --echo --echo create table with partition and select test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 SELECT a, b, c FROM tb_l; - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1", table "ta_r2", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_2", priority "1000001"' + ) SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - } --enable_query_log - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo select partition using pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } -} --echo --echo select partition using index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE a.a > 0 AND a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } -} --echo --echo update partition pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo update partition index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo delete partition pushdown -if ($HAVE_PARTITION) -{ TRUNCATE TABLE ta_l2; INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 DELETE FROM ta_l2 WHERE b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo delete partition index pushdown -if ($HAVE_PARTITION) -{ TRUNCATE TABLE ta_l2; INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test b/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test index 9f7e87eb05b..1cf6ad68f0e 100644 --- a/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test +++ b/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test @@ -11,8 +11,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -21,65 +19,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -91,12 +63,15 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -109,70 +84,43 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo direct_aggregating test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT COUNT(*) FROM ta_l; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l WHERE a < 5; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l WHERE a > 1; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; --enable_ps2_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test index b84825d0f22..c2e4302f42a 100644 --- a/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test +++ b/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test @@ -4,16 +4,6 @@ --source test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -21,8 +11,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,86 +19,49 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -119,12 +70,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -138,21 +95,20 @@ if ($HAVE_PARTITION) set @old_spider_direct_aggregate=@@session.spider_direct_aggregate; set spider_direct_aggregate=1; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT COUNT(*) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT SUM(a) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l2 WHERE a < 5; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l2 WHERE a > 1; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; --enable_ps2_protocol - SET spider_direct_aggregate=0; SELECT COUNT(*) FROM ta_l2; SELECT SUM(a) FROM ta_l2; @@ -160,48 +116,29 @@ if ($HAVE_PARTITION) SELECT MIN(a) FROM ta_l2; SELECT MAX(a) FROM ta_l2 WHERE a < 5; SELECT MIN(a) FROM ta_l2 WHERE a > 1; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; set spider_direct_aggregate=@old_spider_direct_aggregate; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/direct_update.test b/storage/spider/mysql-test/spider/bg/t/direct_update.test index 8b8bb1e50c9..9a80e88ed5e 100644 --- a/storage/spider/mysql-test/spider/bg/t/direct_update.test +++ b/storage/spider/mysql-test/spider/bg/t/direct_update.test @@ -11,8 +11,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -21,65 +19,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -91,12 +63,15 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -109,87 +84,60 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo direct_updating test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update all rows with function UPDATE ta_l SET c = ADDDATE(c, 1); -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update by primary key UPDATE ta_l SET b = 'x' WHERE a = 3; -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update by a column without index UPDATE ta_l SET c = '2011-10-17' WHERE b = 'x'; -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update by primary key with order and limit UPDATE ta_l SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo delete by primary key with order and limit DELETE FROM ta_l WHERE a < 4 ORDER BY c LIMIT 1; -eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo delete by a column without index DELETE FROM ta_l WHERE b = 'c'; -eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo delete by primary key DELETE FROM ta_l WHERE a = 3; -eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/direct_update_part.test b/storage/spider/mysql-test/spider/bg/t/direct_update_part.test index 690fa834659..6a0378a4cd9 100644 --- a/storage/spider/mysql-test/spider/bg/t/direct_update_part.test +++ b/storage/spider/mysql-test/spider/bg/t/direct_update_part.test @@ -4,16 +4,6 @@ --source test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -21,8 +11,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,86 +19,49 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -119,12 +70,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -134,75 +91,56 @@ if ($HAVE_PARTITION) (5, 'c', '2001-12-31 23:59:59'); --enable_ps_protocol --enable_query_log - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update all rows with function UPDATE ta_l2 SET c = ADDDATE(c, 1); - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update by primary key UPDATE ta_l2 SET b = 'x' WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update by a column without index UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update by primary key with order and limit UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo delete by primary key with order and limit DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo delete by a column without index DELETE FROM ta_l2 WHERE b = 'c'; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo delete by primary key DELETE FROM ta_l2 WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/function.test b/storage/spider/mysql-test/spider/bg/t/function.test index 2b81a130ab9..c84ce6235cc 100644 --- a/storage/spider/mysql-test/spider/bg/t/function.test +++ b/storage/spider/mysql-test/spider/bg/t/function.test @@ -12,8 +12,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -22,66 +20,45 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo in() -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TEXT_PK_TABLES1; - echo CHILD2_1_CREATE_TEXT_PK_TABLES1; - } --disable_warnings - eval $CHILD2_1_DROP_TEXT_PK_TABLES1; +DROP TABLE IF EXISTS t1; --enable_warnings - eval $CHILD2_1_CREATE_TEXT_PK_TABLES1; +CREATE TABLE t1 ( +a VARCHAR(255), +PRIMARY KEY (a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE t1 ( a VARCHAR(255), PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET3 MASTER_1_COMMENT_TEXT_PK1_1; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( a VARCHAR(255), PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET3 $MASTER_1_COMMENT_TEXT_PK1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT 'tbl "t1", srv "s_2_1"'; --enable_query_log --disable_ps_protocol insert into t1 values ('1'); @@ -97,82 +74,42 @@ insert into t1 select a + 128 from t1; insert into t1 select a + 256 from t1; insert into t1 select a + 512 from t1; flush tables; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol select a from t1 where a in ('15', '120'); --enable_ps_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TEXT_PK_TABLES1; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a FROM t1 ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo date_sub() -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -184,12 +121,15 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -215,25 +155,13 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 MINUTE); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 SECOND); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -242,13 +170,10 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/ha.test b/storage/spider/mysql-test/spider/bg/t/ha.test index a518fcd59ff..e08457ea299 100644 --- a/storage/spider/mysql-test/spider/bg/t/ha.test +++ b/storage/spider/mysql-test/spider/bg/t/ha.test @@ -1,6 +1,4 @@ # This test tests for ha features -if ($USE_HA_TEST) -{ --disable_warnings --disable_query_log --disable_result_log @@ -15,8 +13,6 @@ if ($USE_HA_TEST) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -29,9 +25,6 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; @@ -44,133 +37,111 @@ if ($USE_CHILD_GROUP3) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; --connection child2_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 SELECT 1; --connection child3_2 SELECT 1; --connection child3_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} --echo --echo create table test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -182,12 +153,16 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -200,377 +175,277 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo fail-over test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_HA_DROP_TABLES; - } --disable_warnings - eval $CHILD2_2_HA_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); -eval $MASTER_1_CHECK_LINK_STATUS; -eval $MASTER_1_CHECK_LINK_FAILED_LOG; -eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } -} --echo --echo recovery test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_HA_CREATE_TABLES; - } - eval $CHILD2_2_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_SET_RECOVERY_STATUS_2_1; -eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol --disable_view_protocol -eval $MASTER_1_COPY_TABLES_2_1; +SELECT spider_copy_tables('ta_l', '0', '1'); --enable_ps_protocol --enable_view_protocol -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_SET_OK_STATUS_2_1; -eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'); --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; DROP TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol -eval $MASTER_1_CHANGE_HA_MON; +SELECT spider_flush_table_mon_cache(); --enable_ps2_protocol --echo --echo active standby test --echo create table test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -582,12 +457,16 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -600,263 +479,160 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo fail-over test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES; - } --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); -eval $MASTER_1_CHECK_LINK_STATUS; -eval $MASTER_1_CHECK_LINK_FAILED_LOG; -eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } -} --echo --echo recovery test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_SET_OK_STATUS_AS_2_1; -eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'); --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; DROP TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol -eval $MASTER_1_CHANGE_HA_MON; +SELECT spider_flush_table_mon_cache(); --enable_ps2_protocol --echo @@ -864,24 +640,18 @@ eval $MASTER_1_CHANGE_HA_MON; --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; --connection child3_2 DROP DATABASE IF EXISTS auto_test_local; --connection child3_3 DROP DATABASE IF EXISTS auto_test_local; -} --disable_query_log --disable_result_log --source ha_test_deinit.inc @@ -889,6 +659,5 @@ if ($USE_CHILD_GROUP3) --enable_result_log --enable_query_log --enable_warnings -} --echo --echo end of test diff --git a/storage/spider/mysql-test/spider/bg/t/ha_part.test b/storage/spider/mysql-test/spider/bg/t/ha_part.test index 1ca4bb24213..205ecbeb45b 100644 --- a/storage/spider/mysql-test/spider/bg/t/ha_part.test +++ b/storage/spider/mysql-test/spider/bg/t/ha_part.test @@ -1,6 +1,4 @@ # This test tests for ha features -if ($USE_HA_TEST) -{ --disable_warnings --disable_query_log --disable_result_log @@ -8,17 +6,6 @@ if ($USE_HA_TEST) --source ha_test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source ha_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -26,8 +13,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -40,9 +25,6 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; @@ -55,158 +37,135 @@ if ($USE_CHILD_GROUP3) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; --connection child2_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 SELECT 1; --connection child3_2 SELECT 1; --connection child3_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} -if ($HAVE_PARTITION) -{ --echo --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; +DROP TABLE IF EXISTS ta_r4; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r4 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --enable_result_log - } - } --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l2; @@ -218,12 +177,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES @@ -236,262 +201,198 @@ if ($HAVE_PARTITION) --echo --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } --echo --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_DROP_TABLES; - } --disable_warnings - eval $CHILD2_3_HA_DROP_TABLES; +DROP TABLE IF EXISTS ta_r4; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } - } --echo --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_CREATE_TABLES; - } - eval $CHILD2_3_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r4 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol --disable_view_protocol - eval $MASTER_1_COPY_TABLES_P_2_1; +SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); --enable_ps_protocol --enable_view_protocol - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_SET_OK_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'), @@ -499,171 +400,139 @@ if ($HAVE_PARTITION) --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } - } -} -if ($HAVE_PARTITION) -{ --echo --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; +DROP TABLE IF EXISTS ta_r4; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r4 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --enable_result_log - } - } --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l2; @@ -675,12 +544,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES @@ -693,241 +568,152 @@ if ($HAVE_PARTITION) --echo --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } --echo --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES2; - } --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } - } --echo --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES2; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'), @@ -935,88 +721,54 @@ if ($HAVE_PARTITION) --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; --connection child3_2 DROP DATABASE IF EXISTS auto_test_local; --connection child3_3 DROP DATABASE IF EXISTS auto_test_local; -} --disable_query_log --disable_result_log --source ha_test_deinit.inc @@ -1024,6 +776,5 @@ if ($USE_CHILD_GROUP3) --enable_result_log --enable_query_log --enable_warnings -} --echo --echo end of test diff --git a/storage/spider/mysql-test/spider/bg/t/ha_test_deinit.inc b/storage/spider/mysql-test/spider/bg/t/ha_test_deinit.inc index 53d0409d066..ff195f95048 100644 --- a/storage/spider/mysql-test/spider/bg/t/ha_test_deinit.inc +++ b/storage/spider/mysql-test/spider/bg/t/ha_test_deinit.inc @@ -1,19 +1,11 @@ # get connection and exist engine test --echo for master_1 ---connection master_1 ---source ../include/ha_deinit_master_1.inc --echo for child2 if ($USE_CHILD_GROUP2) { --echo child2_1 - --connection child2_1 - --source ../include/ha_deinit_child2_1.inc --echo child2_2 - --connection child2_2 - --source ../include/ha_deinit_child2_2.inc --echo child2_3 - --connection child2_3 - --source ../include/ha_deinit_child2_3.inc } --echo for child3 if ($USE_CHILD_GROUP3) diff --git a/storage/spider/mysql-test/spider/bg/t/ha_test_init.inc b/storage/spider/mysql-test/spider/bg/t/ha_test_init.inc index 70576ab16dc..4b836b03919 100644 --- a/storage/spider/mysql-test/spider/bg/t/ha_test_init.inc +++ b/storage/spider/mysql-test/spider/bg/t/ha_test_init.inc @@ -6,14 +6,8 @@ if ($USE_CHILD_GROUP2) { --echo child2_1 - --connection child2_1 - --source ../include/ha_init_child2_1.inc --echo child2_2 - --connection child2_2 - --source ../include/ha_init_child2_2.inc --echo child2_3 - --connection child2_3 - --source ../include/ha_init_child2_3.inc } --echo for child3 if ($USE_CHILD_GROUP3) diff --git a/storage/spider/mysql-test/spider/bg/t/slave_test_deinit.inc b/storage/spider/mysql-test/spider/bg/t/slave_test_deinit.inc index e9d99b7a960..4bbc7ec420d 100644 --- a/storage/spider/mysql-test/spider/bg/t/slave_test_deinit.inc +++ b/storage/spider/mysql-test/spider/bg/t/slave_test_deinit.inc @@ -2,5 +2,4 @@ --echo for slave1_1 --connection slave1_1 STOP SLAVE; ---source ../include/deinit_slave1_1.inc --disconnect slave1_1 diff --git a/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc b/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc index 4f7a6bbae20..a479c4cd40a 100644 --- a/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc +++ b/storage/spider/mysql-test/spider/bg/t/slave_test_init.inc @@ -7,7 +7,6 @@ SET SESSION sql_log_bin= 0; --let $TEST_ENGINE_TYPE= $SLAVE1_1_ENGINE_TYPE --source have_partition.inc --source have_trigger.inc ---source ../include/init_slave1_1.inc --source have_engine.inc --let $SLAVE1_1_SLAVE_STATUS=`SHOW SLAVE STATUS` if (!$SLAVE1_1_SLAVE_STATUS) diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test index d10ac1ce163..9b267118f63 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test @@ -14,15 +14,10 @@ source include/have_log_bin.inc; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,74 +26,40 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} - --echo --echo 3.1 --echo auto_increment -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -106,7 +67,6 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} --disable_warnings DROP TABLE IF EXISTS t1, t2; --enable_warnings @@ -121,20 +81,26 @@ echo CREATE TABLE t2 ( ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1; -eval CREATE TABLE t2 ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "1", tbl "t1_1", srv "s_2_1"'; +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "1", tbl "t1_1", srv "s_2_1"'; --disable_ps_protocol -eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; -eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol -if ($USE_REPLICATION) -{ SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -148,16 +114,15 @@ if ($USE_REPLICATION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1; - eval CREATE TABLE t2 ( +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT ''; +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT ''; --connection master_1 -} --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -171,28 +136,28 @@ SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; -eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; -eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; -eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); SELECT id FROM t1 ORDER BY id; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; -eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); @@ -208,14 +173,14 @@ SELECT id FROM t2 ORDER BY id; SET INSERT_ID=5000; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; -eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; -eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (); SELECT LAST_INSERT_ID(); @@ -226,8 +191,6 @@ SELECT MAX(id) FROM t1; INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -236,57 +199,27 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } -} - --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source slave_test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test index 6f43274fc40..8bb95827b16 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test +++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test @@ -7,17 +7,6 @@ source include/have_log_bin.inc; --source slave_test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -25,15 +14,10 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -42,97 +26,49 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} - --echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_2; --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 3; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - if ($USE_REPLICATION) - { save_master_pos; --connection slave1_1 sync_with_master; @@ -140,7 +76,6 @@ if ($HAVE_PARTITION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } --disable_warnings DROP TABLE IF EXISTS t1, t2; --enable_warnings @@ -155,20 +90,38 @@ if ($HAVE_PARTITION) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t2 ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "1"' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='tbl "t1_1", srv "s_2_1"', +PARTITION pt2 VALUES IN (1) +COMMENT='tbl "t1_2", srv "s_2_2"' + ); +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "1"' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='tbl "t1_1", srv "s_2_1"', +PARTITION pt2 VALUES IN (1) +COMMENT='tbl "t1_2", srv "s_2_2"' + ); --disable_ps_protocol - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol - if ($USE_REPLICATION) - { SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -182,16 +135,27 @@ if ($HAVE_PARTITION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t2 ( +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT '' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='', +PARTITION pt2 VALUES IN (1) +COMMENT='' + ); +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT '' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='', +PARTITION pt2 VALUES IN (1) +COMMENT='' + ); --connection master_1 - } --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -205,28 +169,28 @@ if ($HAVE_PARTITION) SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; - eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; - eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; - eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); SELECT id FROM t1 ORDER BY id; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; - eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); @@ -242,14 +206,14 @@ if ($HAVE_PARTITION) SET INSERT_ID=5000; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; - eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; - eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (); SELECT LAST_INSERT_ID(); @@ -260,8 +224,6 @@ if ($HAVE_PARTITION) INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; - if ($USE_REPLICATION) - { save_master_pos; --connection slave1_1 sync_with_master; @@ -270,76 +232,32 @@ if ($HAVE_PARTITION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_2 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source slave_test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test index 6ed0b936356..3fb8894169e 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test @@ -14,15 +14,10 @@ source include/have_log_bin.inc; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,65 +26,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tb_l; @@ -101,12 +70,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -121,12 +90,15 @@ DROP TABLE IF EXISTS ta_l; echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l SELECT a, b, c FROM tb_l; @@ -135,133 +107,61 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l; --echo --echo 2.13 --echo select table with "order by desc" and "<" -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a < 5 ORDER BY a DESC LIMIT 3; --enable_ps2_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table with "order by desc" and "<=" -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a <= 5 ORDER BY a DESC LIMIT 3; --enable_ps2_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.14 --echo update table with range scan and split_read -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET c = '2000-02-02 00:00:00' WHERE a > 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -272,30 +172,19 @@ TRUNCATE TABLE ta_l; --disable_warnings DROP TABLE IF EXISTS ta_l; --enable_warnings -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES6; - echo CHILD2_1_CREATE_TABLES6; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES6; +DROP TABLE IF EXISTS ta_r_3; --enable_warnings - eval $CHILD2_1_CREATE_TABLES6; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l ( @@ -304,326 +193,162 @@ echo CREATE TABLE ta_l ( c datetime DEFAULT NULL, PRIMARY KEY (a, b, c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a int(11) NOT NULL DEFAULT '0', b char(1) DEFAULT NULL, c datetime DEFAULT NULL, PRIMARY KEY (a, b, c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l SELECT a, b, c FROM tb_l; --enable_ps_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a >= 4 AND b = 'd' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a > 4 AND b = 'c' AND c = '2001-12-31 23:59:59'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b <= 'd' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b < 'e' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND b = 'b' AND c = '2000-01-01 00:00:00'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND b = 'b' AND c = '2000-01-01 00:00:00'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b' AND b <= 'd' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b' AND b < 'e' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND a >= 1 AND b >= 'b' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND a > 1 AND b >= 'b' AND c = '2000-01-01 00:00:00'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.16 --echo auto_increment insert with trigger -if ($HAVE_TRIGGER) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES4; - echo CHILD2_1_CREATE_TABLES4; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES4; +DROP TABLE IF EXISTS ta_r_auto_inc; --enable_warnings - eval $CHILD2_1_CREATE_TABLES4; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l_auto_inc ( @@ -632,141 +357,89 @@ if ($HAVE_TRIGGER) c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; - eval CREATE TABLE ta_l_auto_inc ( +eval +CREATE TABLE ta_l_auto_inc ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tc_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; - eval CREATE TABLE tc_l ( +CREATE TABLE tc_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log --eval CREATE TRIGGER ins_ta_l_auto_inc AFTER INSERT ON ta_l_auto_inc FOR EACH ROW BEGIN INSERT INTO tc_l (a, b, c) VALUES (NEW.a, NEW.b, NEW.c); END; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 --disable_ps_protocol INSERT INTO ta_l_auto_inc (a, b, c) VALUES (NULL, 's', '2008-12-31 20:59:59'); --enable_ps_protocol - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES4; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc +ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM tc_l ORDER BY a; -} --echo --echo 2.17 --echo engine-condition-pushdown with "or" and joining -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a = 1 OR a IN (SELECT a FROM tb_l); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.23 --echo index merge -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -777,14 +450,17 @@ echo CREATE TABLE ta_l_int ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); @@ -793,45 +469,21 @@ INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.24 @@ -848,80 +500,37 @@ echo CREATE TABLE ta_l_int ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -if ($MASTER_1_NEEDPK) -{ - --error ER_REQUIRES_PRIMARY_KEY - eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT NOT NULL, b INT DEFAULT 10, c INT DEFAULT 11, KEY idx1(b), KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; - eval CREATE TABLE ta_l_int ( - a INT NOT NULL, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; -} -if (!$MASTER_1_NEEDPK) -{ - eval CREATE TABLE ta_l_int ( - a INT NOT NULL, - b INT DEFAULT 10, - c INT DEFAULT 11, - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; -} +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol SELECT a, b, c FROM ta_l_int ORDER BY a; --enable_ps_protocol INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l_int SET c = 4 WHERE b = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l_int ORDER BY a; @@ -930,75 +539,47 @@ SELECT a, b, c FROM ta_l_int ORDER BY a; --echo 2.25 --echo direct order limit --connection master_1 -eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS; +SHOW STATUS LIKE 'Spider_direct_order_limit'; --disable_ps2_protocol SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3; --enable_ps2_protocol -eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS; - +SHOW STATUS LIKE 'Spider_direct_order_limit'; --echo --echo 2.26 --echo lock tables -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_LOCK_TABLES1; - echo CHILD2_1_DROP_LOCK_TABLES2; - echo CHILD2_1_CREATE_LOCK_TABLES1; - echo CHILD2_1_CREATE_LOCK_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_LOCK_TABLES1; - eval $CHILD2_1_DROP_LOCK_TABLES2; +DROP TABLE IF EXISTS t1_1; +DROP TABLE IF EXISTS t2_2; --enable_warnings - eval $CHILD2_1_CREATE_LOCK_TABLES1; - eval $CHILD2_1_CREATE_LOCK_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE t2_2 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_LOCK_TABLES1; - echo CHILD2_2_DROP_LOCK_TABLES2; - echo CHILD2_2_CREATE_LOCK_TABLES1; - echo CHILD2_2_CREATE_LOCK_TABLES2; - } --disable_warnings - eval $CHILD2_2_DROP_LOCK_TABLES1; - eval $CHILD2_2_DROP_LOCK_TABLES2; +DROP TABLE IF EXISTS t1_2; +DROP TABLE IF EXISTS t2_1; --enable_warnings - eval $CHILD2_2_CREATE_LOCK_TABLES1; - eval $CHILD2_2_CREATE_LOCK_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_2 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE t2_1 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1009,18 +590,18 @@ echo CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK1; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_LOCK1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'tbl "t1_1 t1_2", srv "s_2_1 s_2_2"'; echo CREATE TABLE t2 ( id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK2; -eval CREATE TABLE t2 ( +CREATE TABLE t2 ( id int(11) NOT NULL, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_LOCK2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'tbl "t2_1 t2_2", srv "s_2_2 s_2_1"'; --enable_query_log LOCK TABLES t1 READ, t2 READ; UNLOCK TABLES; @@ -1028,45 +609,22 @@ UNLOCK TABLES; --echo --echo auto_increment -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -1074,7 +632,6 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1085,16 +642,22 @@ echo CREATE TABLE t1 ( ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "1", tbl "t1_1", srv "s_2_1"'; --disable_ps_protocol -eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; -eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol -if ($USE_REPLICATION) -{ SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -1104,12 +667,11 @@ if ($USE_REPLICATION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT ''; --connection master_1 -} --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -1140,8 +702,6 @@ SELECT MAX(id) FROM t1; INSERT INTO t1 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -1150,47 +710,21 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } -} - --echo --echo read only let $MASTER_1_ENGINE_IS_SPIDER= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR '$MASTER_1_HIDDEN_ENGINE_TYPE' = 'Spider', 1, 0)`; -if ($MASTER_1_ENGINE_IS_SPIDER) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1200,10 +734,10 @@ if ($MASTER_1_ENGINE_IS_SPIDER) id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_READONLY1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'read_only_mode "1", tbl "t1_1", srv "s_2_1"'; --let $MIN_VAL= `SELECT MIN(id) FROM t1` --enable_query_log --disable_ps_protocol @@ -1212,25 +746,17 @@ if ($MASTER_1_ENGINE_IS_SPIDER) --error 12518 INSERT INTO t1 (id) VALUES (1); --error 12518 - eval UPDATE t1 SET id = 4 WHERE id = $MIN_VAL; +UPDATE t1 SET id = 4 WHERE id = 777; --error 12518 - eval DELETE FROM t1 WHERE id = $MIN_VAL; +DELETE FROM t1 WHERE id = 777; --error 12518 DELETE FROM t1; --error 12518 TRUNCATE t1; -} -if (!$MASTER_1_ENGINE_IS_SPIDER) -{ - --echo skipped -} - --echo --echo 2.27 --echo error mode -if ($MASTER_1_ENGINE_IS_SPIDER) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1240,10 +766,10 @@ if ($MASTER_1_ENGINE_IS_SPIDER) id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_ERROR_MODE1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_ERROR_MODE1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'erm "1", ewm "1", tbl "ter1_1", srv "s_2_1"'; --enable_query_log --disable_ps_protocol SELECT id FROM t1 ORDER BY id; @@ -1251,39 +777,26 @@ if ($MASTER_1_ENGINE_IS_SPIDER) INSERT INTO t1 (id) VALUES (1); DELETE FROM t1; TRUNCATE t1; -} -if (!$MASTER_1_ENGINE_IS_SPIDER) -{ - --echo skipped -} - --echo --echo 3.0 --echo is null -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TEXT_KEY_TABLES1; - echo CHILD2_1_CREATE_TEXT_KEY_TABLES1; - } --disable_warnings - eval $CHILD2_1_DROP_TEXT_KEY_TABLES1; +DROP TABLE IF EXISTS t1; --enable_warnings - eval $CHILD2_1_CREATE_TEXT_KEY_TABLES1; +CREATE TABLE t1 ( +a VARCHAR(255), +b VARCHAR(255), +c VARCHAR(255), +KEY idx1(a,b), +KEY idx2(b), +PRIMARY KEY(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1297,14 +810,14 @@ echo CREATE TABLE t1 ( KEY idx2(b), PRIMARY KEY(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_TEXT_KEY1_1; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( a VARCHAR(255), b VARCHAR(255), c VARCHAR(255), KEY idx1(a,b), KEY idx2(b), PRIMARY KEY(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_TEXT_KEY1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'tbl "t1", srv "s_2_1"'; --enable_query_log --disable_ps_protocol insert into t1 values (null, null, '2048'); @@ -1321,49 +834,24 @@ insert into t1 select a + 128, b + 128, c + 128 from t1; insert into t1 select a + 256, b + 256, c + 256 from t1; insert into t1 select a + 512, b + 512, c + 512 from t1; flush tables; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol select a from t1 where a is null order by a limit 30; --enable_ps_protocol select b from t1 where b is null order by b limit 30; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TEXT_PK_TABLES1; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a FROM t1 ORDER BY a; --enable_query_log --enable_result_log - } -} - --echo --echo direct_order_limit @@ -1379,67 +867,36 @@ insert into t1 select a, b + 32, c + 32 from t1; insert into t1 select a, b + 64, c + 64 from t1; insert into t1 select a, b + 128, c + 128 from t1; flush tables; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5; --enable_ps_protocol select a, c from t1 where a = '10' order by b desc limit 5; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TEXT_PK_TABLES1; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a FROM t1 ORDER BY a; --enable_query_log --enable_result_log - } -} - --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source slave_test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test index 1f9c11eb16d..1513bd91eaf 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test +++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test @@ -7,17 +7,6 @@ source include/have_log_bin.inc; --source slave_test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -25,15 +14,10 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -42,30 +26,20 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings @@ -78,12 +52,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -95,59 +69,32 @@ INSERT INTO tb_l (a, b, c) VALUES --echo --echo 2.17 --echo partition with sort -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -156,105 +103,68 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo --echo 2.23 --echo partition update with moving partition -if ($HAVE_PARTITION) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l2; --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -263,91 +173,74 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); --enable_ps_protocol UPDATE ta_l2 SET a = 4 WHERE a = 3; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo index merge with partition -if ($HAVE_PARTITION) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l_int; --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_2_DROP_TABLES5; - echo CHILD2_2_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_2_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -358,14 +251,20 @@ if ($HAVE_PARTITION) KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; - eval CREATE TABLE ta_l_int ( +CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "ta_r_int"' + PARTITION BY LIST(MOD(a, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='srv "s_2_1", priority "1000"', +PARTITION pt2 VALUES IN (1) +COMMENT='srv "s_2_2", priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); @@ -374,125 +273,56 @@ if ($HAVE_PARTITION) INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } -} - --echo --echo 2.26 --echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_2; --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 3; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - if ($USE_REPLICATION) - { save_master_pos; --connection slave1_1 sync_with_master; @@ -500,7 +330,6 @@ if ($HAVE_PARTITION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -511,16 +340,28 @@ if ($HAVE_PARTITION) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "1"' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='tbl "t1_1", srv "s_2_1"', +PARTITION pt2 VALUES IN (1) +COMMENT='tbl "t1_2", srv "s_2_2"' + ); --disable_ps_protocol - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol - if ($USE_REPLICATION) - { SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -530,12 +371,17 @@ if ($HAVE_PARTITION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT '' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='', +PARTITION pt2 VALUES IN (1) +COMMENT='' + ); --connection master_1 - } --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -564,8 +410,6 @@ if ($HAVE_PARTITION) INSERT INTO t1 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; - if ($USE_REPLICATION) - { save_master_pos; --connection slave1_1 sync_with_master; @@ -574,76 +418,32 @@ if ($HAVE_PARTITION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_2 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source slave_test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bg/t/vp_fixes.test b/storage/spider/mysql-test/spider/bg/t/vp_fixes.test index 2061cf253ba..3442d5a0877 100644 --- a/storage/spider/mysql-test/spider/bg/t/vp_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/vp_fixes.test @@ -12,8 +12,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -22,65 +20,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tb_l; @@ -92,12 +64,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -112,12 +84,15 @@ DROP TABLE IF EXISTS ta_l; echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l SELECT a, b, c FROM tb_l; @@ -126,29 +101,22 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l; --echo --echo 0.9 --echo create different primary key table -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -157,67 +125,38 @@ echo CREATE TABLE ta_l_int ( c INT DEFAULT 11, PRIMARY KEY(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT DEFAULT 10, b INT AUTO_INCREMENT, c INT DEFAULT 11, PRIMARY KEY(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --let $MASTER_1_IS_VP= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'VP', 1, 0)` --disable_ps_protocol -if ($MASTER_1_IS_VP) -{ - --error 14514 - INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); -} -if (!$MASTER_1_IS_VP) -{ INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); --disable_query_log --disable_result_log TRUNCATE TABLE ta_l_int; --enable_query_log --enable_result_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES5; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, c FROM ta_r_int ORDER BY a; --enable_query_log --enable_result_log - } -} --enable_ps_protocol --echo create un-correspond primary key table @@ -225,29 +164,22 @@ if ($USE_CHILD_GROUP2) --disable_warnings DROP TABLE IF EXISTS ta_l_int; --enable_warnings -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -256,67 +188,38 @@ echo CREATE TABLE ta_l_int ( c INT DEFAULT 11, PRIMARY KEY(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT DEFAULT 10, b INT DEFAULT 12, c INT DEFAULT 11, PRIMARY KEY(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol -if ($MASTER_1_IS_VP) -{ - --error 14514 - INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); -} -if (!$MASTER_1_IS_VP) -{ INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); --disable_query_log --disable_result_log TRUNCATE TABLE ta_l_int; --enable_query_log --enable_result_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES5; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, c FROM ta_r_int ORDER BY a; --enable_query_log --enable_result_log - } -} --enable_ps_protocol --echo @@ -324,13 +227,10 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/bugfix/my_1_1.cnf b/storage/spider/mysql-test/spider/bugfix/my_1_1.cnf index 5f17295d895..be960747491 100644 --- a/storage/spider/mysql-test/spider/bugfix/my_1_1.cnf +++ b/storage/spider/mysql-test/spider/bugfix/my_1_1.cnf @@ -26,7 +26,6 @@ MASTER_1_HSRPORT= 20000 MASTER_1_HSWPORT= 20001 MASTER_1_MYSOCK= @mysqld.1.1.socket MASTER_1_ENGINE_TYPE= Spider -#MASTER_1_ENGINE_TYPE= MyISAM MASTER_1_ENGINE= ENGINE=Spider MASTER_1_CHARSET= DEFAULT CHARSET=utf8 MASTER_1_ENGINE2= ENGINE=MyISAM @@ -34,11 +33,3 @@ MASTER_1_CHARSET2= DEFAULT CHARSET=utf8 MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci STR_SEMICOLON= ; - -#The followings are set in include/init_xxx.inc files -# MASTER_1_COMMENT_2_1 -# MASTER_1_COMMENT2_2_1 -# MASTER_1_COMMENT3_2_1 -# MASTER_1_COMMENT4_2_1 -# MASTER_1_COMMENT5_2_1 -# MASTER_1_COMMENT_P_2_1 diff --git a/storage/spider/mysql-test/spider/bugfix/my_2_1.cnf b/storage/spider/mysql-test/spider/bugfix/my_2_1.cnf index 24161645607..adc955ee0d9 100644 --- a/storage/spider/mysql-test/spider/bugfix/my_2_1.cnf +++ b/storage/spider/mysql-test/spider/bugfix/my_2_1.cnf @@ -34,23 +34,3 @@ CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket CHILD2_1_GM_ENGINE_TYPE= MyISAM CHILD2_1_GM_ENGINE= ENGINE=MyISAM CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_1_DROP_TABLES -# CHILD2_1_CREATE_TABLES -# CHILD2_1_SELECT_TABLES -# CHILD2_1_DROP_TABLES2 -# CHILD2_1_CREATE_TABLES2 -# CHILD2_1_SELECT_TABLES2 -# CHILD2_1_DROP_TABLES3 -# CHILD2_1_CREATE_TABLES3 -# CHILD2_1_SELECT_TABLES3 -# CHILD2_1_DROP_TABLES4 -# CHILD2_1_CREATE_TABLES4 -# CHILD2_1_SELECT_TABLES4 -# CHILD2_1_DROP_TABLES5 -# CHILD2_1_CREATE_TABLES5 -# CHILD2_1_SELECT_TABLES5 -# CHILD2_1_DROP_TABLES6 -# CHILD2_1_CREATE_TABLES6 -# CHILD2_1_SELECT_TABLES6 diff --git a/storage/spider/mysql-test/spider/bugfix/my_2_2.cnf b/storage/spider/mysql-test/spider/bugfix/my_2_2.cnf index 2d3c2a89a7d..557b02e8e0a 100644 --- a/storage/spider/mysql-test/spider/bugfix/my_2_2.cnf +++ b/storage/spider/mysql-test/spider/bugfix/my_2_2.cnf @@ -31,8 +31,3 @@ CHILD2_2_GM_MYSOCK= @mysqld.2.2.socket CHILD2_2_GM_ENGINE_TYPE= MyISAM CHILD2_2_GM_ENGINE= ENGINE=MyISAM CHILD2_2_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_2_DROP_TABLES -# CHILD2_2_CREATE_TABLES -# CHILD2_2_SELECT_TABLES diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26540.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26540.result new file mode 100644 index 00000000000..f2421465101 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26540.result @@ -0,0 +1,46 @@ +for master_1 +for child2 +for child3 +SET spider_same_server_link=1; +CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +CREATE TABLE t (c INT KEY,c1 BLOB,c2 TEXT) ENGINE=InnoDB; +CREATE TABLE t2 (pk INT,c1 INT) ENGINE=Spider COMMENT='TABLE "st"' PARTITION BY LIST COLUMNS (c1) +(PARTITION p DEFAULT COMMENT='srv "d"' ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t"'); +Warnings: +Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead. +Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead. +DELETE FROM t2 WHERE pk=2; +ERROR 42S22: Unknown column 'pk' in 'WHERE' +DROP TABLE t, t2; +CREATE TABLE t (c1 INT,c2 INT,c3 INT,c4 DATE,c5 DATE,c6 TIME,c7 TIME,c8 DATE,c9 DATE,c10 CHAR(1),c11 VARCHAR(1),KEY(c1),KEY(c3),KEY(c4),KEY(c6),KEY(c8),KEY(c10,c3)) ENGINE=Spider PARTITION BY LIST (c1) (PARTITION p VALUES IN (1,2)); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `c1` int(11) DEFAULT NULL, + `c2` int(11) DEFAULT NULL, + `c3` int(11) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` date DEFAULT NULL, + `c6` time DEFAULT NULL, + `c7` time DEFAULT NULL, + `c8` date DEFAULT NULL, + `c9` date DEFAULT NULL, + `c10` char(1) DEFAULT NULL, + `c11` varchar(1) DEFAULT NULL, + KEY `c1` (`c1`), + KEY `c3` (`c3`), + KEY `c4` (`c4`), + KEY `c6` (`c6`), + KEY `c8` (`c8`), + KEY `c10` (`c10`,`c3`) +) ENGINE=SPIDER DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci + PARTITION BY LIST (`c1`) +(PARTITION `p` VALUES IN (1,2) ENGINE = SPIDER) +DELETE FROM t; +ERROR HY000: Unable to connect to foreign data source: localhost +DROP TABLE t; +DROP SERVER srv; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_37829.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_37829.result new file mode 100644 index 00000000000..4897ff9aec6 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_37829.result @@ -0,0 +1,77 @@ +# +# MDEV-37829 XA COMMIT ONE PHASE fails with "This xid does not +# exist" if a trigger references a SPIDER table +# +for master_1 +for child2 +for child3 +set spider_same_server_link= 1; +CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +CREATE TABLE t ( +id INT auto_increment NOT NULL, +name varchar(100) NULL, +CONSTRAINT test_pk PRIMARY KEY (id) +) ENGINE=InnoDB; +Warnings: +Warning 1280 Name 'test_pk' ignored for PRIMARY key. +INSERT INTO t(id, name) VALUES(1,'test1'); +CREATE TABLE t2 ( +id INT auto_increment NOT NULL, +name varchar(100) NULL, +CONSTRAINT test2_pk PRIMARY KEY (id) +) ENGINE=InnoDB; +Warnings: +Warning 1280 Name 'test2_pk' ignored for PRIMARY key. +CREATE TABLE t3 ( +id INT auto_increment NOT NULL, +name varchar(100) NULL, +CONSTRAINT test3_pk PRIMARY KEY (id) +) ENGINE=SPIDER COMMENT='wrapper "mysql", srv "srv", table "t2"'; +Warnings: +Warning 1280 Name 'test3_pk' ignored for PRIMARY key. +Warning 138 Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead. +CREATE PROCEDURE tProc() +BEGIN +# This conditional logic is intentionally FALSE. +# The SELECT on the SPIDER table will never run. +SET @t := FALSE; +IF @t = TRUE THEN +SELECT name INTO @b FROM t3 WHERE id = 1; +END IF; +END$$ +CREATE TRIGGER t_au +AFTER UPDATE +ON t FOR EACH ROW +BEGIN +# This condition will also be false in our test case. +IF NEW.name = '3' THEN +CALL tProc(); +END IF; +END$$ +SELECT "Using 2PC..."; +Using 2PC... +Using 2PC... +XA START 'TESTTRX_2P'; +UPDATE t SET name = 'abc' WHERE ID = 1; +SHOW WARNINGS; +Level Code Message +XA END 'TESTTRX_2P'; +XA PREPARE 'TESTTRX_2P'; +XA COMMIT 'TESTTRX_2P'; +SELECT "Using 1PC..."; +Using 1PC... +Using 1PC... +XA START 'TESTTRX_1P'; +UPDATE t SET name = 'abc' WHERE ID = 1; +SHOW WARNINGS; +Level Code Message +XA END 'TESTTRX_1P'; +XA COMMIT 'TESTTRX_1P' ONE PHASE; +drop trigger t_au; +drop procedure tProc; +drop table t, t2, t3; +drop server srv; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result b/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result index 48f86f42159..eb262b1c209 100644 --- a/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result +++ b/storage/spider/mysql-test/spider/bugfix/r/xa_cmd.result @@ -36,10 +36,79 @@ INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); XA END 'test'; XA PREPARE 'test'; XA COMMIT 'test'; +# MDEV-37829 XA COMMIT ONE PHASE fails with "This xid does not +# exist" if a trigger references a SPIDER table +# +# Below we test a version of the MDEV-37829 case that is not a +# no-op on the spider table +XA START 'test1'; +INSERT INTO tbl_a (pkey) VALUES (100); +XA END 'test1'; +XA COMMIT 'test1' ONE PHASE; +select * from tbl_a; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +100 +create table t (c int); +insert into t values (1),(2); +CREATE PROCEDURE tProc() +BEGIN +SET @t := TRUE; +IF @t = TRUE THEN +INSERT INTO tbl_a select max(pkey) + 1 from tbl_a; +END IF; +END$$ +CREATE TRIGGER t_au +AFTER UPDATE +ON t FOR EACH ROW +BEGIN +IF NEW.c < 50 THEN +CALL tProc(); +END IF; +END$$ +XA START 'test'; +update t set c = c + 1 where c = 1; +XA END 'test'; +XA PREPARE 'test'; +XA COMMIT 'test'; +XA START 'test1'; +update t set c = c + 1 where c = 2; +XA END 'test1'; +XA COMMIT 'test1' ONE PHASE; +drop table t; +select * from tbl_a; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +100 +101 +102 +103 connection child2_1; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; argument insert into `auto_test_remote`.`tbl_a`(`pkey`)values(0),(1),(2),(3),(4),(5),(6),(7),(8),(9) +insert into `auto_test_remote`.`tbl_a`(`pkey`)values(100) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`)values(101) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`)values(102) +insert high_priority into `auto_test_remote`.`tbl_a`(`pkey`)values(103) SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %' SELECT pkey FROM tbl_a ORDER BY pkey; pkey @@ -53,6 +122,10 @@ pkey 7 8 9 +100 +101 +102 +103 deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test index d49a24ad7fa..1b1c83597d8 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test +++ b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test @@ -22,7 +22,10 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -32,10 +35,10 @@ echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -56,10 +59,10 @@ CHECKSUM TABLE tbl_a EXTENDED; --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%checksum %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test b/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test index 70266c71c96..522df0938d3 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test +++ b/storage/spider/mysql-test/spider/bugfix/t/cp932_column.test @@ -22,7 +22,12 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +txt_utf8 char(8) NOT NULL, +txt_cp932 char(8) NOT NULL COLLATE cp932_japanese_ci, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARACTER SET utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -34,12 +39,12 @@ echo CREATE TABLE tbl_a ( txt_cp932 char(8) NOT NULL COLLATE cp932_japanese_ci, PRIMARY KEY (pkey) ) MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, txt_utf8 char(8) NOT NULL, txt_cp932 char(8) NOT NULL COLLATE cp932_japanese_ci, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARACTER SET utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey,txt_utf8,txt_cp932) VALUES (0,'',''),(1,'',''),(2,'',''),(3,'',''),(4,'',''),(5,'',''),(6,'',''),(7,'',''),(8,'',''),(9,'',''); @@ -65,10 +70,10 @@ SET NAMES utf8; SET NAMES cp932; --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND (argument LIKE '%insert %' OR argument LIKE '%update %'); --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey, txt_utf8, txt_cp932 FROM tbl_a ORDER BY pkey; SET NAMES utf8; --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test b/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test index 39dc456bd78..c40525a30d0 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test +++ b/storage/spider/mysql-test/spider/bugfix/t/group_by_order_by_limit.test @@ -27,14 +27,24 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +skey int NOT NULL, +PRIMARY KEY (pkey), +KEY idx1 (skey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +skey int NOT NULL, +PRIMARY KEY (pkey), +KEY idx1 (skey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -46,12 +56,16 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY (pkey), KEY idx1 (skey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, skey int NOT NULL, PRIMARY KEY (pkey), KEY idx1 (skey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' + PARTITION BY KEY(pkey) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); @@ -81,15 +95,15 @@ set spider_direct_aggregate=@old_spider_direct_aggregate; --connection child2_1 --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey, skey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey, skey FROM tbl_a ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/insert_select.test b/storage/spider/mysql-test/spider/bugfix/t/insert_select.test index ee2fbc4b871..f1c6165e4ae 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/insert_select.test +++ b/storage/spider/mysql-test/spider/bugfix/t/insert_select.test @@ -22,9 +22,19 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +skey int NOT NULL, +dt date NOT NULL, +tm time NOT NULL, +KEY idx1 (skey,dt,tm) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; echo CHILD2_1_CREATE_TABLES2; -eval $CHILD2_1_CREATE_TABLES2; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +dt datetime NOT NULL, +PRIMARY KEY (pkey), +KEY idx1 (dt) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -36,24 +46,24 @@ echo CREATE TABLE tbl_a ( tm time NOT NULL, KEY idx1 (skey,dt,tm) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( skey int NOT NULL, dt date NOT NULL, tm time NOT NULL, KEY idx1 (skey,dt,tm) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; echo CREATE TABLE tbl_b ( pkey int NOT NULL, dt datetime NOT NULL, PRIMARY KEY (pkey), KEY idx1 (dt) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1_2; -eval CREATE TABLE tbl_b ( +CREATE TABLE tbl_b ( pkey int NOT NULL, dt datetime NOT NULL, PRIMARY KEY (pkey), KEY idx1 (dt) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00'); @@ -85,10 +95,10 @@ INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FRO --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey, dt FROM tbl_b ORDER BY pkey; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test index eee517e45f7..ab048655a02 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_19866.test @@ -27,14 +27,22 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val char(1) NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +val char(1) NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -45,11 +53,15 @@ echo CREATE TABLE tbl_a ( val char(1) NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, val char(1) NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' + PARTITION BY KEY(pkey) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey,val) VALUES (1,'1'),(2,'2'),(3,'3'),(4,'4'); @@ -74,15 +86,15 @@ SELECT * FROM tbl_a; --connection child2_1 --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey, val FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey, val FROM tbl_a ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test index be8e806a7a9..7a65dc07be4 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_20100.test @@ -23,7 +23,24 @@ USE auto_test_remote; --disable_query_log echo CHILD2_1_CREATE_TABLES; --disable_ps_protocol -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE ta_r2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r3 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r4 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_ps_protocol --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -36,12 +53,16 @@ echo CREATE TABLE tbl_a ( c DATETIME, PRIMARY KEY(a) ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; +) ENGINE=Spider PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"', +PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"', +PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (a, b, c) VALUES @@ -81,10 +102,13 @@ SELECT a, b, c FROM tbl_a PARTITION (pt2,pt3); --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_ps2_protocol --disable_ps_protocol -eval $CHILD2_1_SELECT_TABLES; +eval +SELECT a, b, c FROM ta_r2 ORDER BY a $STR_SEMICOLON +SELECT a, b, c FROM ta_r3 ORDER BY a $STR_SEMICOLON +SELECT a, b, c FROM ta_r4 ORDER BY a; --enable_ps_protocol --enable_view_protocol diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test index 1765e38500a..4e773beb98f 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_20502.test @@ -22,7 +22,11 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +id int(10) unsigned NOT NULL AUTO_INCREMENT, +val int(10) unsigned DEFAULT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -33,11 +37,11 @@ echo CREATE TABLE tbl_a ( val int(10) unsigned DEFAULT NULL, PRIMARY KEY(id) ) $MASTER_1_ENGINE $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( id int(10) unsigned NOT NULL AUTO_INCREMENT, val int(10) unsigned DEFAULT NULL, PRIMARY KEY(id) -) $MASTER_1_ENGINE $MASTER_1_COMMENT_2_1; +) ENGINE=Spider COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (val) VALUES (1); @@ -66,9 +70,9 @@ FROM tbl_a GROUP BY val; --connection child2_1 --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT id, val FROM tbl_a ORDER BY id; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test index c6ec22550d5..9ace645c20d 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_21884.test @@ -23,7 +23,18 @@ USE auto_test_remote; --disable_query_log echo CHILD2_1_CREATE_TABLES; --disable_ps_protocol -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE ta_r2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a,b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r3 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a,b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_ps_protocol --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -36,24 +47,29 @@ echo CREATE TABLE tbl_a ( c DATETIME, PRIMARY KEY(a,b) ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a,b) -) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r2", + priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", priority "1000001"' + ); echo CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (a, b, c) VALUES @@ -85,10 +101,12 @@ SELECT STRAIGHT_JOIN b.a, b.b FROM tb_l a, tbl_a b WHERE a.a = b.a; SET NAMES utf8; --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_ps2_protocol --disable_ps_protocol -eval $CHILD2_1_SELECT_TABLES; +eval +SELECT a, b, c FROM ta_r2 ORDER BY a $STR_SEMICOLON +SELECT a, b, c FROM ta_r3 ORDER BY a; --enable_ps_protocol --enable_view_protocol diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test index 5449a0574ee..e6e95aadc88 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test @@ -27,14 +27,22 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +id bigint NOT NULL, +node text, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_a ( +id bigint NOT NULL, +node text, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -45,11 +53,15 @@ echo CREATE TABLE tbl_a ( node text, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( id bigint NOT NULL, node text, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' + PARTITION BY HASH(id) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (id,node) VALUES (1,'DB-G0'),(2,'DB-G1'); @@ -70,10 +82,10 @@ SELECT * FROM tbl_a; SELECT * FROM tbl_a WHERE id <0 || id >0; --connection child2_1 -eval $CHILD2_1_SELECT_TABLES; +SELECT * FROM tbl_a ORDER BY id; --connection child2_2 -eval $CHILD2_2_SELECT_TABLES; +SELECT * FROM tbl_a ORDER BY id; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test index 906d0d70af8..01fe0b0b0da 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24020.test @@ -21,7 +21,21 @@ USE auto_test_remote; --disable_query_log --disable_ps_protocol echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE ta_r2 ( +a INT, +b VARCHAR(30), +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r3 ( +a INT, +b VARCHAR(30), +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r4 ( +a INT, +b VARCHAR(30), +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_ps_protocol --enable_query_log @@ -32,11 +46,15 @@ echo CREATE TABLE tbl_a ( b VARCHAR(30), PRIMARY KEY(a) ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( a INT, b VARCHAR(30), PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; +) ENGINE=Spider PARTITION BY LIST(a % 3) ( +PARTITION pt1 VALUES IN (0) COMMENT='srv "s_2_1", table "ta_r2"', +PARTITION pt2 VALUES IN (1) COMMENT='srv "s_2_1", table "ta_r3"', +PARTITION pt3 VALUES IN (2) COMMENT='srv "s_2_1", table "ta_r4"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a VALUES(10000, " abcd "); diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test index c3951c4cafc..cd233012a83 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24517.test @@ -23,7 +23,21 @@ USE auto_test_remote; --disable_query_log --disable_ps_protocol echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE ta_r2 ( +i INT, +j JSON, +PRIMARY KEY(i) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r3 ( +i INT, +j JSON, +PRIMARY KEY(i) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r4 ( +i INT, +j JSON, +PRIMARY KEY(i) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_ps_protocol --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -35,11 +49,15 @@ echo CREATE TABLE tbl_a ( j JSON, PRIMARY KEY(i) ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( i INT, j JSON, PRIMARY KEY(i) -) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; +) ENGINE=Spider PARTITION BY RANGE(i) ( +PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"', +PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"', +PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (i, j) VALUES diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test index f351a252c97..20e725f8dfa 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test @@ -21,7 +21,21 @@ USE auto_test_remote; --disable_query_log --disable_ps_protocol echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE ta_r2 ( +i INT, +j JSON, +PRIMARY KEY(i) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r3 ( +i INT, +j JSON, +PRIMARY KEY(i) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE ta_r4 ( +i INT, +j JSON, +PRIMARY KEY(i) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_ps_protocol --enable_query_log @@ -32,11 +46,15 @@ echo CREATE TABLE tbl_a ( j JSON, PRIMARY KEY(i) ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( i INT, j JSON, PRIMARY KEY(i) -) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; +) ENGINE=Spider PARTITION BY RANGE(i) ( +PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"', +PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"', +PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}'); diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26540.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26540.test new file mode 100644 index 00000000000..e3c6ed17259 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26540.test @@ -0,0 +1,37 @@ +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +--source include/have_innodb.inc +--source include/have_partition.inc + +SET spider_same_server_link=1; + +evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); + +CREATE TABLE t (c INT KEY,c1 BLOB,c2 TEXT) ENGINE=InnoDB; +CREATE TABLE t2 (pk INT,c1 INT) ENGINE=Spider COMMENT='TABLE "st"' PARTITION BY LIST COLUMNS (c1) + (PARTITION p DEFAULT COMMENT='srv "d"' ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t"'); +--error ER_BAD_FIELD_ERROR +DELETE FROM t2 WHERE pk=2; + +DROP TABLE t, t2; + +--disable_warnings +CREATE TABLE t (c1 INT,c2 INT,c3 INT,c4 DATE,c5 DATE,c6 TIME,c7 TIME,c8 DATE,c9 DATE,c10 CHAR(1),c11 VARCHAR(1),KEY(c1),KEY(c3),KEY(c4),KEY(c6),KEY(c8),KEY(c10,c3)) ENGINE=Spider PARTITION BY LIST (c1) (PARTITION p VALUES IN (1,2)); +SHOW CREATE TABLE t; +--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE +DELETE FROM t; +--enable_warnings +DROP TABLE t; + +DROP SERVER srv; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_37829.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_37829.test new file mode 100644 index 00000000000..828fc6a39ca --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_37829.test @@ -0,0 +1,99 @@ +--echo # +--echo # MDEV-37829 XA COMMIT ONE PHASE fails with "This xid does not +--echo # exist" if a trigger references a SPIDER table +--echo # + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log +--source include/have_innodb.inc +set spider_same_server_link= 1; +evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql +OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); + +# See also spider/bugfix.xa_cmd for a case that is not a no-op on +# the spider table + +# 1. SETUP: Create local InnoDB tables and one remote SPIDER table + +# Local table to be updated +CREATE TABLE t ( + id INT auto_increment NOT NULL, + name varchar(100) NULL, + CONSTRAINT test_pk PRIMARY KEY (id) +) ENGINE=InnoDB; + +INSERT INTO t(id, name) VALUES(1,'test1'); + +# Remote table target +CREATE TABLE t2 ( + id INT auto_increment NOT NULL, + name varchar(100) NULL, + CONSTRAINT test2_pk PRIMARY KEY (id) +) ENGINE=InnoDB; + +# SPIDER table pointing to the remote target +CREATE TABLE t3 ( + id INT auto_increment NOT NULL, + name varchar(100) NULL, + CONSTRAINT test3_pk PRIMARY KEY (id) +) ENGINE=SPIDER COMMENT='wrapper "mysql", srv "srv", table "t2"'; + + +# 2. SETUP: Create a procedure and trigger that reference the SPIDER table + +DELIMITER $$; + +CREATE PROCEDURE tProc() +BEGIN + # This conditional logic is intentionally FALSE. + # The SELECT on the SPIDER table will never run. + SET @t := FALSE; + IF @t = TRUE THEN + SELECT name INTO @b FROM t3 WHERE id = 1; + END IF; +END$$ + +CREATE TRIGGER t_au +AFTER UPDATE +ON t FOR EACH ROW +BEGIN + # This condition will also be false in our test case. + IF NEW.name = '3' THEN + CALL tProc(); + END IF; +END$$ + +DELIMITER ;$$ + + +# 3. TEST CASE 1: Two-phase commit +SELECT "Using 2PC..."; +XA START 'TESTTRX_2P'; +UPDATE t SET name = 'abc' WHERE ID = 1; +SHOW WARNINGS; +XA END 'TESTTRX_2P'; +XA PREPARE 'TESTTRX_2P'; +XA COMMIT 'TESTTRX_2P'; + +# 4. TEST CASE 2: One-phase commit + +SELECT "Using 1PC..."; +XA START 'TESTTRX_1P'; +UPDATE t SET name = 'abc' WHERE ID = 1; +SHOW WARNINGS; +XA END 'TESTTRX_1P'; +XA COMMIT 'TESTTRX_1P' ONE PHASE; + +drop trigger t_au; +drop procedure tProc; +drop table t, t2, t3; + +drop server srv; +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test index 9dc2837cacd..db996c0c3c7 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test @@ -28,14 +28,20 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -49,14 +55,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -85,19 +91,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 @@ -114,19 +120,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 @@ -143,16 +149,16 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ --disable_view_protocol -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test index 1ec6f6d734e..4e4c3979f91 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test @@ -28,14 +28,20 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -49,14 +55,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -86,19 +92,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 @@ -115,19 +121,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 @@ -144,16 +150,16 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test index 38d435ae2cf..1b18dfae319 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test @@ -28,14 +28,20 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -49,14 +55,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -85,19 +91,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 @@ -114,19 +120,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 @@ -143,16 +149,16 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test index 2fe23dbe557..6ee8885f1a7 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test @@ -29,14 +29,20 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -50,14 +56,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -86,19 +92,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 @@ -115,19 +121,19 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 @@ -144,16 +150,16 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; --connection child2_1 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test index b1b6ee7d43a..a75971c37e1 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test +++ b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_insert.test @@ -22,7 +22,12 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +skey int NOT NULL, +dt date NOT NULL, +tm time NOT NULL, +PRIMARY KEY (skey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -34,12 +39,12 @@ echo CREATE TABLE tbl_a ( tm time NOT NULL, PRIMARY KEY (skey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( skey int NOT NULL, dt date NOT NULL, tm time NOT NULL, PRIMARY KEY (skey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00'); @@ -60,10 +65,10 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK - --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND (argument LIKE '%insert %' OR argument LIKE '%replace %'); --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT skey, dt, tm FROM tbl_a ORDER BY skey; TRUNCATE TABLE mysql.general_log; @@ -75,10 +80,10 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK - --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND (argument LIKE '%insert %' OR argument LIKE '%replace %'); --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT skey, dt, tm FROM tbl_a ORDER BY skey; TRUNCATE TABLE mysql.general_log; @@ -90,10 +95,10 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK - --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND (argument LIKE '%insert %' OR argument LIKE '%replace %'); --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT skey, dt, tm FROM tbl_a ORDER BY skey; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test index 465bee76776..0691250c5ec 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test +++ b/storage/spider/mysql-test/spider/bugfix/t/return_found_rows_update.test @@ -22,7 +22,12 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +skey int NOT NULL, +dt date NOT NULL, +tm time NOT NULL, +KEY idx1 (skey,dt) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -34,12 +39,12 @@ echo CREATE TABLE tbl_a ( tm time NOT NULL, KEY idx1 (skey,dt) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( skey int NOT NULL, dt date NOT NULL, tm time NOT NULL, KEY idx1 (skey,dt) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (skey, dt, tm) VALUES (0, '2012-01-01', '12:00:00'),(1, '2012-02-01', '12:00:00'),(2, '2012-03-01', '12:00:00'),(3, '2012-04-01', '12:00:00'),(4, '2012-05-01', '12:00:00'),(5, '2012-06-01', '12:00:00'),(6, '2012-07-01', '12:00:00'),(7, '2012-08-01', '12:00:00'),(8, '2012-09-01', '12:00:00'),(9, '2012-10-01', '12:00:00'); @@ -62,10 +67,10 @@ exec $MYSQL -v -v -u root -h localhost --default-character-set=latin1 -P $MASTER --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT skey, dt, tm FROM tbl_a ORDER BY skey; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test b/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test index e191367cfb7..e0605202f41 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test +++ b/storage/spider/mysql-test/spider/bugfix/t/select_by_null.test @@ -22,7 +22,10 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -32,10 +35,10 @@ echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -58,10 +61,10 @@ SELECT pkey FROM tbl_a WHERE NULL; --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test b/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test index 84595cab752..66c72adca1d 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test +++ b/storage/spider/mysql-test/spider/bugfix/t/select_with_backquote.test @@ -22,7 +22,11 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +txt_utf8 char(8) NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARACTER SET utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -33,11 +37,11 @@ echo CREATE TABLE tbl_a ( txt_utf8 char(8) NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, txt_utf8 char(8) NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE DEFAULT CHARACTER SET utf8 $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARACTER SET utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey,txt_utf8) VALUES (0,'01234567'),(1,'12345678'),(2,'23456789'),(3,'34567890'),(4,'45678901'),(5,'56789012'),(6,'67890123'),(7,'78901234'),(8,'89012345'),(9,'90123456'); @@ -61,9 +65,9 @@ SELECT `pkey`, SUBSTR(`txt_utf8`, 1, 4) FROM `auto_test_local`.`tbl_a` ORDER BY --connection child2_1 SET NAMES utf8; --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey, txt_utf8 FROM tbl_a ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test index 66e044a5a5c..f5ba9737e13 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test +++ b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test @@ -23,7 +23,10 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -40,10 +43,10 @@ echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log SET SESSION sql_log_bin= 1; @@ -53,10 +56,10 @@ echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --connection master_1 @@ -74,10 +77,10 @@ SET SESSION sql_log_bin= 0; --disable_view_protocol --disable_ps2_protocol --replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/ -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection slave1_1 SELECT pkey FROM tbl_a ORDER BY pkey; diff --git a/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test b/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test index ed41b77335c..187bcc31846 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test +++ b/storage/spider/mysql-test/spider/bugfix/t/strict_group_by.test @@ -27,14 +27,24 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +skey int NOT NULL, +PRIMARY KEY (pkey), +KEY idx1 (skey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +skey int NOT NULL, +PRIMARY KEY (pkey), +KEY idx1 (skey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -46,12 +56,16 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY (pkey), KEY idx1 (skey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, skey int NOT NULL, PRIMARY KEY (pkey), KEY idx1 (skey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' + PARTITION BY KEY(pkey) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); @@ -84,18 +98,18 @@ set spider_direct_aggregate=@old_spider_direct_aggregate; --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey, skey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey, skey FROM tbl_a ORDER BY pkey; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test index dc66aecf807..26a6cc7a9f2 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test +++ b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test @@ -22,7 +22,10 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -32,10 +35,10 @@ echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1", wrapper "mariadb"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -55,9 +58,9 @@ SELECT * FROM tbl_a ORDER BY pkey; --connection child2_1 --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test b/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test index a57c96cbb82..db34518f01b 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test +++ b/storage/spider/mysql-test/spider/bugfix/t/xa_cmd.test @@ -22,7 +22,10 @@ USE auto_test_remote; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -32,10 +35,10 @@ echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --connection child2_1 @@ -50,13 +53,65 @@ XA END 'test'; XA PREPARE 'test'; XA COMMIT 'test'; +--echo # MDEV-37829 XA COMMIT ONE PHASE fails with "This xid does not +--echo # exist" if a trigger references a SPIDER table +--echo # +--echo # Below we test a version of the MDEV-37829 case that is not a +--echo # no-op on the spider table + +XA START 'test1'; +INSERT INTO tbl_a (pkey) VALUES (100); +XA END 'test1'; +XA COMMIT 'test1' ONE PHASE; + +select * from tbl_a; + +create table t (c int); +insert into t values (1),(2); + +DELIMITER $$; + +CREATE PROCEDURE tProc() +BEGIN + SET @t := TRUE; + IF @t = TRUE THEN + INSERT INTO tbl_a select max(pkey) + 1 from tbl_a; + END IF; +END$$ + +CREATE TRIGGER t_au +AFTER UPDATE +ON t FOR EACH ROW +BEGIN + IF NEW.c < 50 THEN + CALL tProc(); + END IF; +END$$ + +DELIMITER ;$$ + +XA START 'test'; +update t set c = c + 1 where c = 1; +XA END 'test'; +XA PREPARE 'test'; +XA COMMIT 'test'; + +XA START 'test1'; +update t set c = c + 1 where c = 2; +XA END 'test1'; +XA COMMIT 'test1' ONE PHASE; + +drop table t; + +select * from tbl_a; + --connection child2_1 --disable_view_protocol --disable_ps2_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; --enable_ps2_protocol --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --echo --echo deinit diff --git a/storage/spider/mysql-test/spider/feature/my_1_1.cnf b/storage/spider/mysql-test/spider/feature/my_1_1.cnf index 5f17295d895..be960747491 100644 --- a/storage/spider/mysql-test/spider/feature/my_1_1.cnf +++ b/storage/spider/mysql-test/spider/feature/my_1_1.cnf @@ -26,7 +26,6 @@ MASTER_1_HSRPORT= 20000 MASTER_1_HSWPORT= 20001 MASTER_1_MYSOCK= @mysqld.1.1.socket MASTER_1_ENGINE_TYPE= Spider -#MASTER_1_ENGINE_TYPE= MyISAM MASTER_1_ENGINE= ENGINE=Spider MASTER_1_CHARSET= DEFAULT CHARSET=utf8 MASTER_1_ENGINE2= ENGINE=MyISAM @@ -34,11 +33,3 @@ MASTER_1_CHARSET2= DEFAULT CHARSET=utf8 MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci STR_SEMICOLON= ; - -#The followings are set in include/init_xxx.inc files -# MASTER_1_COMMENT_2_1 -# MASTER_1_COMMENT2_2_1 -# MASTER_1_COMMENT3_2_1 -# MASTER_1_COMMENT4_2_1 -# MASTER_1_COMMENT5_2_1 -# MASTER_1_COMMENT_P_2_1 diff --git a/storage/spider/mysql-test/spider/feature/my_2_1.cnf b/storage/spider/mysql-test/spider/feature/my_2_1.cnf index 24161645607..adc955ee0d9 100644 --- a/storage/spider/mysql-test/spider/feature/my_2_1.cnf +++ b/storage/spider/mysql-test/spider/feature/my_2_1.cnf @@ -34,23 +34,3 @@ CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket CHILD2_1_GM_ENGINE_TYPE= MyISAM CHILD2_1_GM_ENGINE= ENGINE=MyISAM CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_1_DROP_TABLES -# CHILD2_1_CREATE_TABLES -# CHILD2_1_SELECT_TABLES -# CHILD2_1_DROP_TABLES2 -# CHILD2_1_CREATE_TABLES2 -# CHILD2_1_SELECT_TABLES2 -# CHILD2_1_DROP_TABLES3 -# CHILD2_1_CREATE_TABLES3 -# CHILD2_1_SELECT_TABLES3 -# CHILD2_1_DROP_TABLES4 -# CHILD2_1_CREATE_TABLES4 -# CHILD2_1_SELECT_TABLES4 -# CHILD2_1_DROP_TABLES5 -# CHILD2_1_CREATE_TABLES5 -# CHILD2_1_SELECT_TABLES5 -# CHILD2_1_DROP_TABLES6 -# CHILD2_1_CREATE_TABLES6 -# CHILD2_1_SELECT_TABLES6 diff --git a/storage/spider/mysql-test/spider/feature/my_2_2.cnf b/storage/spider/mysql-test/spider/feature/my_2_2.cnf index 2d3c2a89a7d..557b02e8e0a 100644 --- a/storage/spider/mysql-test/spider/feature/my_2_2.cnf +++ b/storage/spider/mysql-test/spider/feature/my_2_2.cnf @@ -31,8 +31,3 @@ CHILD2_2_GM_MYSOCK= @mysqld.2.2.socket CHILD2_2_GM_ENGINE_TYPE= MyISAM CHILD2_2_GM_ENGINE= ENGINE=MyISAM CHILD2_2_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_2_DROP_TABLES -# CHILD2_2_CREATE_TABLES -# CHILD2_2_SELECT_TABLES diff --git a/storage/spider/mysql-test/spider/include/deinit_slave1_1.inc b/storage/spider/mysql-test/spider/include/deinit_slave1_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/include/ha_deinit_child2_1.inc b/storage/spider/mysql-test/spider/include/ha_deinit_child2_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/include/ha_deinit_child2_2.inc b/storage/spider/mysql-test/spider/include/ha_deinit_child2_2.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/include/ha_deinit_child2_3.inc b/storage/spider/mysql-test/spider/include/ha_deinit_child2_3.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/include/ha_deinit_master_1.inc b/storage/spider/mysql-test/spider/include/ha_deinit_master_1.inc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/storage/spider/mysql-test/spider/include/ha_init_child2_1.inc b/storage/spider/mysql-test/spider/include/ha_init_child2_1.inc deleted file mode 100644 index 2684829408d..00000000000 --- a/storage/spider/mysql-test/spider/include/ha_init_child2_1.inc +++ /dev/null @@ -1,8 +0,0 @@ -let $CHILD2_1_HA_AS_DROP_TABLES= - $CHILD2_1_DROP_TABLES; -let $CHILD2_1_HA_AS_CREATE_TABLES= - $CHILD2_1_CREATE_TABLES; -let $CHILD2_1_HA_AS_DROP_TABLES2= - $CHILD2_1_DROP_TABLES2; -let $CHILD2_1_HA_AS_CREATE_TABLES2= - $CHILD2_1_CREATE_TABLES2; diff --git a/storage/spider/mysql-test/spider/include/ha_init_child2_2.inc b/storage/spider/mysql-test/spider/include/ha_init_child2_2.inc deleted file mode 100644 index 205eaa6fe35..00000000000 --- a/storage/spider/mysql-test/spider/include/ha_init_child2_2.inc +++ /dev/null @@ -1,4 +0,0 @@ -let $CHILD2_2_HA_DROP_TABLES= - $CHILD2_2_DROP_TABLES; -let $CHILD2_2_HA_CREATE_TABLES= - $CHILD2_2_CREATE_TABLES; diff --git a/storage/spider/mysql-test/spider/include/ha_init_child2_3.inc b/storage/spider/mysql-test/spider/include/ha_init_child2_3.inc deleted file mode 100644 index 55cb858372c..00000000000 --- a/storage/spider/mysql-test/spider/include/ha_init_child2_3.inc +++ /dev/null @@ -1,4 +0,0 @@ -let $CHILD2_3_HA_DROP_TABLES= - $CHILD2_3_DROP_TABLES; -let $CHILD2_3_HA_CREATE_TABLES= - $CHILD2_3_CREATE_TABLES; diff --git a/storage/spider/mysql-test/spider/include/ha_init_child3_1.inc b/storage/spider/mysql-test/spider/include/ha_init_child3_1.inc index 8357f0bdbc2..adf6a04101d 100644 --- a/storage/spider/mysql-test/spider/include/ha_init_child3_1.inc +++ b/storage/spider/mysql-test/spider/include/ha_init_child3_1.inc @@ -11,130 +11,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $CHILD3_1_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $CHILD3_1_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $CHILD3_1_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $CHILD3_1_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $CHILD3_1_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; - -let $CHILD3_1_DROP_TABLES_HA_2_1= - DROP TABLE IF EXISTS ta_l; -if ($VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_1_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_1_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_1_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_1_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $CHILD3_1_DROP_TABLES_HA_P_2_1= - DROP TABLE IF EXISTS ta_l2; -let $CHILD3_1_CREATE_TABLES_HA_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_1_ENGINE $CHILD3_1_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_1_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $CHILD3_1_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $CHILD3_1_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); diff --git a/storage/spider/mysql-test/spider/include/ha_init_child3_2.inc b/storage/spider/mysql-test/spider/include/ha_init_child3_2.inc index 3ffcec24f51..0d2c1f9de5b 100644 --- a/storage/spider/mysql-test/spider/include/ha_init_child3_2.inc +++ b/storage/spider/mysql-test/spider/include/ha_init_child3_2.inc @@ -11,130 +11,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $CHILD3_2_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $CHILD3_2_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $CHILD3_2_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $CHILD3_2_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $CHILD3_2_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; - -let $CHILD3_2_DROP_TABLES_HA_2_1= - DROP TABLE IF EXISTS ta_l; -if ($VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_2_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_2_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_2_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_2_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $CHILD3_2_DROP_TABLES_HA_P_2_1= - DROP TABLE IF EXISTS ta_l2; -let $CHILD3_2_CREATE_TABLES_HA_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_2_ENGINE $CHILD3_2_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_2_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $CHILD3_2_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $CHILD3_2_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); diff --git a/storage/spider/mysql-test/spider/include/ha_init_child3_3.inc b/storage/spider/mysql-test/spider/include/ha_init_child3_3.inc index 67bd00109f5..e5fd7d1dd69 100644 --- a/storage/spider/mysql-test/spider/include/ha_init_child3_3.inc +++ b/storage/spider/mysql-test/spider/include/ha_init_child3_3.inc @@ -11,130 +11,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $CHILD3_3_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $CHILD3_3_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $CHILD3_3_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $CHILD3_3_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $CHILD3_3_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; - -let $CHILD3_3_DROP_TABLES_HA_2_1= - DROP TABLE IF EXISTS ta_l; -if ($VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_3_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_3_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $CHILD3_3_CREATE_TABLES_HA_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $CHILD3_3_CREATE_TABLES_HA_AS_2_1= - CREATE TABLE ta_l ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $CHILD3_3_DROP_TABLES_HA_P_2_1= - DROP TABLE IF EXISTS ta_l2; -let $CHILD3_3_CREATE_TABLES_HA_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1= - CREATE TABLE ta_l2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD3_3_ENGINE $CHILD3_3_CHARSET - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $CHILD3_3_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $CHILD3_3_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $CHILD3_3_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); diff --git a/storage/spider/mysql-test/spider/include/ha_init_master_1.inc b/storage/spider/mysql-test/spider/include/ha_init_master_1.inc index 78797d80ce7..46a47f916f0 100644 --- a/storage/spider/mysql-test/spider/include/ha_init_master_1.inc +++ b/storage/spider/mysql-test/spider/include/ha_init_master_1.inc @@ -8,98 +8,3 @@ eval INSERT INTO mysql.spider_link_mon_servers NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), ('%auto_test_local%', '%ta_l%', '%', $CHILD3_3_SERVER_ID, 's_3_3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL); -let $MASTER_1_CHECK_LINK_STATUS= - SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables - ORDER BY db_name, table_name, link_id; -let $MASTER_1_CHECK_LINK_FAILED_LOG= - SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -let $MASTER_1_SET_RECOVERY_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 2"'; -let $MASTER_1_SET_OK_STATUS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2", lst "0 1"'; -let $MASTER_1_SET_OK_STATUS_AS_2_1= - ALTER TABLE ta_l - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2", lst "1 0"'; -let $MASTER_1_COPY_TABLES_2_1= - SELECT spider_copy_tables('ta_l', '0', '1'); - -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_HA_2_1= - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $MASTER_1_COMMENT_HA_AS_2_1= - COMMENT='port "$CHILD2_1_MYPORT $CHILD2_2_MYPORT", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_HA_2_1= - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", - database "auto_test_remote auto_test_remote2"'; - let $MASTER_1_COMMENT_HA_AS_2_1= - COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' - CONNECTION='host "localhost", user "root", password "", - msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1", - database "auto_test_remote auto_test_remote2"'; -} -let $MASTER_1_COMMENT_HA_P_2_1= - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $MASTER_1_COMMENT_HA_AS_P_2_1= - COMMENT='msi "$CHILD3_1_SERVER_ID", mkd "2", alc "1"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001"' - ); -let $MASTER_1_SET_RECOVERY_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -let $MASTER_1_SET_OK_STATUS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -let $MASTER_1_SET_OK_STATUS_AS_P_2_1= - ALTER TABLE ta_l2 - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); -let $MASTER_1_COPY_TABLES_P_2_1= - SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); -let $MASTER_1_CHECK_HA_STATUS= - SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -let $MASTER_1_CHANGE_HA_MON= - SELECT spider_flush_table_mon_cache(); diff --git a/storage/spider/mysql-test/spider/include/init_child2_1.inc b/storage/spider/mysql-test/spider/include/init_child2_1.inc index 782f538eb43..abc64df3c08 100644 --- a/storage/spider/mysql-test/spider/include/init_child2_1.inc +++ b/storage/spider/mysql-test/spider/include/init_child2_1.inc @@ -1,192 +1,3 @@ --let $TEST_ENGINE_TYPE= $CHILD2_1_ENGINE_TYPE --source ../include/init_engine.inc --let $INIT_CHILD2_1_ENGINE= $INIT_TEST_ENGINE -let $CHILD2_1_DROP_TABLES= - DROP TABLE IF EXISTS ta_r; -let $CHILD2_1_CREATE_TABLES= - CREATE TABLE ta_r ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a), - KEY idx1(b) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; -let $CHILD2_1_DROP_TABLES2= - DROP TABLE IF EXISTS ta_r2; -let $CHILD2_1_CREATE_TABLES2= - CREATE TABLE ta_r2 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES2= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; -let $CHILD2_1_DROP_TABLES3= - DROP TABLE IF EXISTS ta_r_no_idx; -let $CHILD2_1_CREATE_TABLES3= - CREATE TABLE ta_r_no_idx ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10' - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES3= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a; -let $CHILD2_1_DROP_TABLES4= - DROP TABLE IF EXISTS ta_r_auto_inc; -let $CHILD2_1_CREATE_TABLES4= - CREATE TABLE ta_r_auto_inc ( - a INT AUTO_INCREMENT, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES4= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc - ORDER BY a; -let $CHILD2_1_DROP_TABLES5= - DROP TABLE IF EXISTS ta_r_int; -let $CHILD2_1_CREATE_TABLES5= - CREATE TABLE ta_r_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES5= - SELECT a, b, c FROM ta_r_int ORDER BY a; -let $CHILD2_1_DROP_TABLES6= - DROP TABLE IF EXISTS ta_r_3; -let $CHILD2_1_CREATE_TABLES6= - CREATE TABLE ta_r_3 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10' - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES6= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_3 ORDER BY a; -let $CHILD2_1_DROP_TABLES7= - DROP TABLE IF EXISTS ta_ob; -let $CHILD2_1_CREATE_TABLES7= - CREATE TABLE ta_ob ( - a VARCHAR(50) NOT NULL, - b VARCHAR(50) NULL DEFAULT NULL, - c VARCHAR(100) NULL DEFAULT NULL, - d DATETIME(0) NULL DEFAULT NULL, - e INT(11) NOT NULL, - f INT(10) NULL DEFAULT NULL, - PRIMARY KEY (a, e) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TABLES7= - SELECT * FROM ta_ob WHERE c LIKE "%510411106%" AND e = 510411 AND f != 1 ORDER BY d,c LIMIT 6 OFFSET 0; -let $CHILD2_1_DROP_FT_TABLES= - DROP TABLE IF EXISTS ft_r; -let $CHILD2_1_CREATE_FT_TABLES= - CREATE TABLE ft_r ( - a INT DEFAULT 0, - b TEXT, - c TEXT, - d TEXT, - PRIMARY KEY(a), - FULLTEXT INDEX ft_idx1(b), - FULLTEXT INDEX ft_idx2(c) - ) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET; -let $CHILD2_1_SELECT_FT_TABLES= - SELECT a, b, c, d FROM ft_r ORDER BY a; -let $CHILD2_1_DROP_FT_TABLES2= - DROP TABLE IF EXISTS ft_r2; -let $CHILD2_1_CREATE_FT_TABLES2= - CREATE TABLE ft_r2 ( - a INT DEFAULT 0, - b TEXT, - c TEXT, - d TEXT, - PRIMARY KEY(a), - FULLTEXT INDEX ft_idx1(b), - FULLTEXT INDEX ft_idx2(c) - ) $CHILD2_1_FT_ENGINE $CHILD2_1_FT_CHARSET; -let $CHILD2_1_SELECT_FT_TABLES2= - SELECT a, b, c, d FROM ft_r2 ORDER BY a; -let $CHILD2_1_DROP_GM_TABLES= - DROP TABLE IF EXISTS gm_r; -let $CHILD2_1_CREATE_GM_TABLES= - CREATE TABLE gm_r ( - a INT DEFAULT 0, - b GEOMETRY NOT NULL, - c GEOMETRY NOT NULL, - PRIMARY KEY(a), - SPATIAL INDEX sp_idx1(b), - SPATIAL INDEX sp_idx2(c) - ) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET; -let $CHILD2_1_SELECT_GM_TABLES= - SELECT a, b, c FROM gm_r ORDER BY a; -let $CHILD2_1_DROP_GM_TABLES2= - DROP TABLE IF EXISTS gm_r2; -let $CHILD2_1_CREATE_GM_TABLES2= - CREATE TABLE gm_r2 ( - a INT DEFAULT 0, - b GEOMETRY NOT NULL, - c GEOMETRY NOT NULL, - PRIMARY KEY(a), - SPATIAL INDEX sp_idx1(b), - SPATIAL INDEX sp_idx2(c) - ) $CHILD2_1_GM_ENGINE $CHILD2_1_GM_CHARSET; -let $CHILD2_1_SELECT_GM_TABLES2= - SELECT a, b, c FROM gm_r2 ORDER BY a; -let $CHILD2_1_DROP_LOCK_TABLES1= - DROP TABLE IF EXISTS t1_1; -let $CHILD2_1_CREATE_LOCK_TABLES1= - CREATE TABLE t1_1 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_DROP_LOCK_TABLES2= - DROP TABLE IF EXISTS t2_2; -let $CHILD2_1_CREATE_LOCK_TABLES2= - CREATE TABLE t2_2 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_DROP_INCREMENT_TABLES1= - DROP TABLE IF EXISTS t1_1; -let $CHILD2_1_CREATE_INCREMENT_TABLES1= - CREATE TABLE t1_1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_INCREMENT_TABLES1= - SELECT id FROM t1_1 ORDER BY id; -let $CHILD2_1_DROP_TEXT_PK_TABLES1= - DROP TABLE IF EXISTS t1; -let $CHILD2_1_CREATE_TEXT_PK_TABLES1= - CREATE TABLE t1 ( - a VARCHAR(255), - PRIMARY KEY (a) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET2; -let $CHILD2_1_SELECT_TEXT_PK_TABLES1= - SELECT a FROM t1 ORDER BY a; -let $CHILD2_1_DROP_TEXT_KEY_TABLES1= - DROP TABLE IF EXISTS t1; -let $CHILD2_1_CREATE_TEXT_KEY_TABLES1= - CREATE TABLE t1 ( - a VARCHAR(255), - b VARCHAR(255), - c VARCHAR(255), - KEY idx1(a,b), - KEY idx2(b), - PRIMARY KEY(c) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; -let $CHILD2_1_SELECT_TEXT_KEY_TABLES1= - SELECT a, b FROM t1 ORDER BY a, b; -let $CHILD2_1_AUTO_INCREMENT_INCREMENT1= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; -let $CHILD2_1_AUTO_INCREMENT_INCREMENT2= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; -let $CHILD2_1_AUTO_INCREMENT_OFFSET1= - SET GLOBAL AUTO_INCREMENT_OFFSET = 1; -let $CHILD2_1_AUTO_INCREMENT_OFFSET2= - SET GLOBAL AUTO_INCREMENT_OFFSET = 2; diff --git a/storage/spider/mysql-test/spider/include/init_child2_2.inc b/storage/spider/mysql-test/spider/include/init_child2_2.inc index 5d7227e43ad..ac8a1452c65 100644 --- a/storage/spider/mysql-test/spider/include/init_child2_2.inc +++ b/storage/spider/mysql-test/spider/include/init_child2_2.inc @@ -1,83 +1,3 @@ --let $TEST_ENGINE_TYPE= $CHILD2_2_ENGINE_TYPE --source ../include/init_engine.inc --let $INIT_CHILD2_2_ENGINE= $INIT_TEST_ENGINE -let $CHILD2_2_DROP_TABLES= - DROP TABLE IF EXISTS ta_r3; -let $CHILD2_2_CREATE_TABLES= - CREATE TABLE ta_r3 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_DROP_TABLES5= - DROP TABLE IF EXISTS ta_r_int; -let $CHILD2_2_CREATE_TABLES5= - CREATE TABLE ta_r_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_SELECT_TABLES= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; -let $CHILD2_2_DROP_FT_TABLES= - DROP TABLE IF EXISTS ft_r3; -let $CHILD2_2_CREATE_FT_TABLES= - CREATE TABLE ft_r3 ( - a INT DEFAULT 0, - b TEXT, - c TEXT, - d TEXT, - PRIMARY KEY(a), - FULLTEXT INDEX ft_idx1(b), - FULLTEXT INDEX ft_idx2(c) - ) $CHILD2_2_FT_ENGINE $CHILD2_2_FT_CHARSET; -let $CHILD2_2_SELECT_FT_TABLES= - SELECT a, b, c, d FROM ft_r3 ORDER BY a; -let $CHILD2_2_DROP_GM_TABLES= - DROP TABLE IF EXISTS gm_r3; -let $CHILD2_2_CREATE_GM_TABLES= - CREATE TABLE gm_r3 ( - a INT DEFAULT 0, - b GEOMETRY NOT NULL, - c GEOMETRY NOT NULL, - PRIMARY KEY(a), - SPATIAL INDEX sp_idx1(b), - SPATIAL INDEX sp_idx2(c) - ) $CHILD2_2_GM_ENGINE $CHILD2_2_GM_CHARSET; -let $CHILD2_2_SELECT_GM_TABLES= - SELECT a, b, c FROM gm_r3 ORDER BY a; -let $CHILD2_2_DROP_LOCK_TABLES1= - DROP TABLE IF EXISTS t1_2; -let $CHILD2_2_CREATE_LOCK_TABLES1= - CREATE TABLE t1_2 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_DROP_LOCK_TABLES2= - DROP TABLE IF EXISTS t2_1; -let $CHILD2_2_CREATE_LOCK_TABLES2= - CREATE TABLE t2_1 ( - id int(11) NOT NULL, - PRIMARY KEY (id) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_DROP_INCREMENT_TABLES1= - DROP TABLE IF EXISTS t1_2; -let $CHILD2_2_CREATE_INCREMENT_TABLES1= - CREATE TABLE t1_2 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; -let $CHILD2_2_SELECT_INCREMENT_TABLES1= - SELECT id FROM t1_2 ORDER BY id; -let $CHILD2_2_AUTO_INCREMENT_INCREMENT1= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; -let $CHILD2_2_AUTO_INCREMENT_INCREMENT2= - SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; -let $CHILD2_2_AUTO_INCREMENT_OFFSET1= - SET GLOBAL AUTO_INCREMENT_OFFSET = 1; -let $CHILD2_2_AUTO_INCREMENT_OFFSET2= - SET GLOBAL AUTO_INCREMENT_OFFSET = 3; diff --git a/storage/spider/mysql-test/spider/include/init_child2_3.inc b/storage/spider/mysql-test/spider/include/init_child2_3.inc index 0ae240626fe..af0b42e2915 100644 --- a/storage/spider/mysql-test/spider/include/init_child2_3.inc +++ b/storage/spider/mysql-test/spider/include/init_child2_3.inc @@ -1,14 +1,3 @@ --let $TEST_ENGINE_TYPE= $CHILD2_3_ENGINE_TYPE --source ../include/init_engine.inc --let $INIT_CHILD2_3_ENGINE= $INIT_TEST_ENGINE -let $CHILD2_3_DROP_TABLES= - DROP TABLE IF EXISTS ta_r4; -let $CHILD2_3_CREATE_TABLES= - CREATE TABLE ta_r4 ( - a INT DEFAULT 10, - b CHAR(1) DEFAULT 'c', - c DATETIME DEFAULT '1999-10-10 10:10:10', - PRIMARY KEY(a) - ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET; -let $CHILD2_3_SELECT_TABLES= - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; diff --git a/storage/spider/mysql-test/spider/include/init_master_1.inc b/storage/spider/mysql-test/spider/include/init_master_1.inc index 460142b9c7d..b955119a268 100644 --- a/storage/spider/mysql-test/spider/include/init_master_1.inc +++ b/storage/spider/mysql-test/spider/include/init_master_1.inc @@ -1,195 +1,3 @@ --source ../include/init_spider.inc SET spider_direct_order_limit= 10000; SET spider_init_sql_alloc_size= 1; -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_2_1= - COMMENT='database "auto_test_remote", table "ta_r"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_2_1= - COMMENT='database "auto_test_remote", table "ta_r"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT2_2_1= - COMMENT='database "auto_test_remote", table "ta_r_no_idx"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password "", prt "2000000"'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT2_2_1= - COMMENT='database "auto_test_remote", table "ta_r_no_idx"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password "", prt "2000000"'; -} -let $MASTER_1_COMMENT_P_2_1= - COMMENT='table "ta_r3"' - PARTITION BY KEY(a) ( - PARTITION pt1 COMMENT='srv "s_2_1", table "ta_r2", - priority "1000"', - PARTITION pt2 COMMENT='srv "s_2_2", priority "1000001"' - ); -let $MASTER_1_COMMENT2_P_2_1= - COMMENT='table "ta_r3"' - PARTITION BY RANGE(a) ( - PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", - table "ta_r2", priority "1000"', - PARTITION pt2 VALUES LESS THAN MAXVALUE - COMMENT='srv "s_2_2", priority "1000001"' - ); -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT3_2_1= - COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT3_2_1= - COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -let $MASTER_1_COMMENT3_P_2_1= - COMMENT='table "ta_r_int"' - PARTITION BY LIST(MOD(a, 2)) ( - PARTITION pt1 VALUES IN (0) - COMMENT='srv "s_2_1", priority "1000"', - PARTITION pt2 VALUES IN (1) - COMMENT='srv "s_2_2", priority "1000001"' - ); -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT4_2_1= - COMMENT='database "auto_test_remote", table "ta_r_int"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT4_2_1= - COMMENT='database "auto_test_remote", table "ta_r_int"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT5_2_1= - COMMENT='database "auto_test_remote", table "ta_r_3"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT5_2_1= - COMMENT='database "auto_test_remote", table "ta_r_3"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -let $MASTER_1_COMMENT6_P_1_1= - COMMENT='database "auto_test_remote", table "ta_ob"' - PARTITION BY LIST COLUMNS (e) PARTITIONS 1 - (PARTITION pt1 values in (510411) COMMENT = 'srv "s_2_1"'); -if ($VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_FT_2_1= - COMMENT='database "auto_test_remote", table "ft_r"' - CONNECTION='host "localhost", port "$CHILD2_1_MYPORT", user "root", - password ""'; -} -if (!$VERSION_COMPILE_OS_WIN) -{ - let $MASTER_1_COMMENT_FT_2_1= - COMMENT='database "auto_test_remote", table "ft_r"' - CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", - password ""'; -} -let $MASTER_1_COMMENT2_FT_P_2_1= - COMMENT='table "ft_r3"' - PARTITION BY RANGE(a) ( - PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", - table "ft_r2", priority "1000"', - PARTITION pt2 VALUES LESS THAN MAXVALUE - COMMENT='srv "s_2_2", priority "1000001"' - ); -let $MASTER_1_COMMENT_GM_2_1= - COMMENT='srv "s_2_1", table "gm_r"'; -let $MASTER_1_COMMENT2_GM_P_2_1= - COMMENT='table "gm_r3"' - PARTITION BY RANGE(a) ( - PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", - table "gm_r2", priority "1000"', - PARTITION pt2 VALUES LESS THAN MAXVALUE - COMMENT='srv "s_2_2", priority "1000001"' - ); -let $MASTER_1_COMMENT_LOCK1= - COMMENT 'tbl "t1_1 t1_2", srv "s_2_1 s_2_2"'; -let $MASTER_1_COMMENT_LOCK2= - COMMENT 'tbl "t2_1 t2_2", srv "s_2_2 s_2_1"'; -let $MASTER_1_COMMENT_INCREMENT1_1= - COMMENT 'aim "0", tbl "t1_1", srv "s_2_1"'; -let $MASTER_1_COMMENT_INCREMENT1_P_1= - COMMENT 'aim "0"' - PARTITION BY LIST(MOD(id, 2)) ( - PARTITION pt1 VALUES IN (0) - COMMENT='tbl "t1_1", srv "s_2_1"', - PARTITION pt2 VALUES IN (1) - COMMENT='tbl "t1_2", srv "s_2_2"' - ); -let $MASTER_1_COMMENT_READONLY1_1= - COMMENT 'read_only_mode "1", tbl "t1_1", srv "s_2_1"'; -let $MASTER_1_COMMENT_ERROR_MODE1_1= - COMMENT 'erm "1", ewm "1", tbl "ter1_1", srv "s_2_1"'; -let $MASTER_1_COMMENT_TEXT_PK1_1= - COMMENT 'tbl "t1", srv "s_2_1"'; -let $MASTER_1_COMMENT_TEXT_KEY1_1= - COMMENT 'tbl "t1", srv "s_2_1"'; -let $MASTER_1_COMMENT_MDEV_25985= - COMMENT='table "t1"' - PARTITION BY LIST COLUMNS(`a`) ( - PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"' - ); -let $MASTER_1_CHECK_DIRECT_UPDATE_STATUS= - SHOW STATUS LIKE 'Spider_direct_update'; -let $MASTER_1_CHECK_DIRECT_DELETE_STATUS= - SHOW STATUS LIKE 'Spider_direct_delete'; -let $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS= - SHOW STATUS LIKE 'Spider_direct_order_limit'; -let $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS= - SHOW STATUS LIKE 'Spider_direct_aggregate'; -let $MASTER_1_AUTO_INCREMENT_INCREMENT1= - SET SESSION AUTO_INCREMENT_INCREMENT = 1 $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 1', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 1', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_INCREMENT2= - SET SESSION AUTO_INCREMENT_INCREMENT = 777 $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_OFFSET1= - SET SESSION AUTO_INCREMENT_OFFSET = 1 $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 1', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 1', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_OFFSET2= - SET SESSION AUTO_INCREMENT_OFFSET = 777 $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', - 'srv "s_2_1"') $STR_SEMICOLON - SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', - 'srv "s_2_2"'); -let $MASTER_1_AUTO_INCREMENT_OFFSET3= - SET SESSION AUTO_INCREMENT_OFFSET = 1; -let $MASTER_1_AUTO_INCREMENT_OFFSET4= - SET SESSION AUTO_INCREMENT_OFFSET = 777; diff --git a/storage/spider/mysql-test/spider/include/init_slave1_1.inc b/storage/spider/mysql-test/spider/include/init_slave1_1.inc deleted file mode 100644 index 73c3c6b9ef2..00000000000 --- a/storage/spider/mysql-test/spider/include/init_slave1_1.inc +++ /dev/null @@ -1,10 +0,0 @@ -let $SLAVE1_1_COMMENT_INCREMENT1_1= - COMMENT ''; -let $SLAVE1_1_COMMENT_INCREMENT1_P_1= - COMMENT '' - PARTITION BY LIST(MOD(id, 2)) ( - PARTITION pt1 VALUES IN (0) - COMMENT='', - PARTITION pt2 VALUES IN (1) - COMMENT='' - ); diff --git a/storage/spider/mysql-test/spider/my_1_1.cnf b/storage/spider/mysql-test/spider/my_1_1.cnf index 5f17295d895..be960747491 100644 --- a/storage/spider/mysql-test/spider/my_1_1.cnf +++ b/storage/spider/mysql-test/spider/my_1_1.cnf @@ -26,7 +26,6 @@ MASTER_1_HSRPORT= 20000 MASTER_1_HSWPORT= 20001 MASTER_1_MYSOCK= @mysqld.1.1.socket MASTER_1_ENGINE_TYPE= Spider -#MASTER_1_ENGINE_TYPE= MyISAM MASTER_1_ENGINE= ENGINE=Spider MASTER_1_CHARSET= DEFAULT CHARSET=utf8 MASTER_1_ENGINE2= ENGINE=MyISAM @@ -34,11 +33,3 @@ MASTER_1_CHARSET2= DEFAULT CHARSET=utf8 MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci STR_SEMICOLON= ; - -#The followings are set in include/init_xxx.inc files -# MASTER_1_COMMENT_2_1 -# MASTER_1_COMMENT2_2_1 -# MASTER_1_COMMENT3_2_1 -# MASTER_1_COMMENT4_2_1 -# MASTER_1_COMMENT5_2_1 -# MASTER_1_COMMENT_P_2_1 diff --git a/storage/spider/mysql-test/spider/my_2_1.cnf b/storage/spider/mysql-test/spider/my_2_1.cnf index 24161645607..adc955ee0d9 100644 --- a/storage/spider/mysql-test/spider/my_2_1.cnf +++ b/storage/spider/mysql-test/spider/my_2_1.cnf @@ -34,23 +34,3 @@ CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket CHILD2_1_GM_ENGINE_TYPE= MyISAM CHILD2_1_GM_ENGINE= ENGINE=MyISAM CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_1_DROP_TABLES -# CHILD2_1_CREATE_TABLES -# CHILD2_1_SELECT_TABLES -# CHILD2_1_DROP_TABLES2 -# CHILD2_1_CREATE_TABLES2 -# CHILD2_1_SELECT_TABLES2 -# CHILD2_1_DROP_TABLES3 -# CHILD2_1_CREATE_TABLES3 -# CHILD2_1_SELECT_TABLES3 -# CHILD2_1_DROP_TABLES4 -# CHILD2_1_CREATE_TABLES4 -# CHILD2_1_SELECT_TABLES4 -# CHILD2_1_DROP_TABLES5 -# CHILD2_1_CREATE_TABLES5 -# CHILD2_1_SELECT_TABLES5 -# CHILD2_1_DROP_TABLES6 -# CHILD2_1_CREATE_TABLES6 -# CHILD2_1_SELECT_TABLES6 diff --git a/storage/spider/mysql-test/spider/my_2_2.cnf b/storage/spider/mysql-test/spider/my_2_2.cnf index 2d3c2a89a7d..557b02e8e0a 100644 --- a/storage/spider/mysql-test/spider/my_2_2.cnf +++ b/storage/spider/mysql-test/spider/my_2_2.cnf @@ -31,8 +31,3 @@ CHILD2_2_GM_MYSOCK= @mysqld.2.2.socket CHILD2_2_GM_ENGINE_TYPE= MyISAM CHILD2_2_GM_ENGINE= ENGINE=MyISAM CHILD2_2_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_2_DROP_TABLES -# CHILD2_2_CREATE_TABLES -# CHILD2_2_SELECT_TABLES diff --git a/storage/spider/mysql-test/spider/regression/e1121/my_1_1.cnf b/storage/spider/mysql-test/spider/regression/e1121/my_1_1.cnf index 5f17295d895..be960747491 100644 --- a/storage/spider/mysql-test/spider/regression/e1121/my_1_1.cnf +++ b/storage/spider/mysql-test/spider/regression/e1121/my_1_1.cnf @@ -26,7 +26,6 @@ MASTER_1_HSRPORT= 20000 MASTER_1_HSWPORT= 20001 MASTER_1_MYSOCK= @mysqld.1.1.socket MASTER_1_ENGINE_TYPE= Spider -#MASTER_1_ENGINE_TYPE= MyISAM MASTER_1_ENGINE= ENGINE=Spider MASTER_1_CHARSET= DEFAULT CHARSET=utf8 MASTER_1_ENGINE2= ENGINE=MyISAM @@ -34,11 +33,3 @@ MASTER_1_CHARSET2= DEFAULT CHARSET=utf8 MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci STR_SEMICOLON= ; - -#The followings are set in include/init_xxx.inc files -# MASTER_1_COMMENT_2_1 -# MASTER_1_COMMENT2_2_1 -# MASTER_1_COMMENT3_2_1 -# MASTER_1_COMMENT4_2_1 -# MASTER_1_COMMENT5_2_1 -# MASTER_1_COMMENT_P_2_1 diff --git a/storage/spider/mysql-test/spider/regression/e1121/my_2_1.cnf b/storage/spider/mysql-test/spider/regression/e1121/my_2_1.cnf index 24161645607..adc955ee0d9 100644 --- a/storage/spider/mysql-test/spider/regression/e1121/my_2_1.cnf +++ b/storage/spider/mysql-test/spider/regression/e1121/my_2_1.cnf @@ -34,23 +34,3 @@ CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket CHILD2_1_GM_ENGINE_TYPE= MyISAM CHILD2_1_GM_ENGINE= ENGINE=MyISAM CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_1_DROP_TABLES -# CHILD2_1_CREATE_TABLES -# CHILD2_1_SELECT_TABLES -# CHILD2_1_DROP_TABLES2 -# CHILD2_1_CREATE_TABLES2 -# CHILD2_1_SELECT_TABLES2 -# CHILD2_1_DROP_TABLES3 -# CHILD2_1_CREATE_TABLES3 -# CHILD2_1_SELECT_TABLES3 -# CHILD2_1_DROP_TABLES4 -# CHILD2_1_CREATE_TABLES4 -# CHILD2_1_SELECT_TABLES4 -# CHILD2_1_DROP_TABLES5 -# CHILD2_1_CREATE_TABLES5 -# CHILD2_1_SELECT_TABLES5 -# CHILD2_1_DROP_TABLES6 -# CHILD2_1_CREATE_TABLES6 -# CHILD2_1_SELECT_TABLES6 diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test index 76717a72c5d..7f2b16a3ff7 100644 --- a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test +++ b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_key.test @@ -23,7 +23,16 @@ USE auto_test_remote; --disable_query_log --disable_ps_protocol echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +akey int NOT NULL, +val int NOT NULL, +KEY idx1 (akey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE tbl_b ( +bkey int NOT NULL, +akey int NOT NULL, +PRIMARY KEY (bkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_ps_protocol --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -35,21 +44,21 @@ echo CREATE TABLE tbl_a ( val int NOT NULL, KEY idx1 (akey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( akey int NOT NULL, val int NOT NULL, KEY idx1 (akey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; echo CREATE TABLE tbl_b ( bkey int NOT NULL, akey int NOT NULL, PRIMARY KEY (bkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1_2; -eval CREATE TABLE tbl_b ( +CREATE TABLE tbl_b ( bkey int NOT NULL, akey int NOT NULL, PRIMARY KEY (bkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (akey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); @@ -70,8 +79,12 @@ SELECT a.val, a.akey FROM tbl_a a, tbl_b b WHERE a.akey = b.akey AND b.bkey = 5; --connection child2_1 --disable_ps_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; -eval $CHILD2_1_SELECT_TABLES; +eval +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%`tbl_a`%' $STR_SEMICOLON +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%`tbl_b`%'; +eval +SELECT akey, val FROM tbl_a ORDER BY akey $STR_SEMICOLON +SELECT bkey, akey FROM tbl_b ORDER BY bkey; --enable_ps_protocol --enable_view_protocol diff --git a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test index f22e158916f..8684e22625f 100644 --- a/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test +++ b/storage/spider/mysql-test/spider/regression/e1121/t/direct_join_by_pkey_pkey.test @@ -23,7 +23,16 @@ USE auto_test_remote; --disable_query_log echo CHILD2_1_CREATE_TABLES; --disable_ps_protocol -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +akey int NOT NULL, +val int NOT NULL, +PRIMARY KEY (akey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE tbl_b ( +bkey int NOT NULL, +akey int NOT NULL, +PRIMARY KEY (bkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_ps_protocol --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -35,21 +44,21 @@ echo CREATE TABLE tbl_a ( val int NOT NULL, PRIMARY KEY (akey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( akey int NOT NULL, val int NOT NULL, PRIMARY KEY (akey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; echo CREATE TABLE tbl_b ( bkey int NOT NULL, akey int NOT NULL, PRIMARY KEY (bkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1_2; -eval CREATE TABLE tbl_b ( +CREATE TABLE tbl_b ( bkey int NOT NULL, akey int NOT NULL, PRIMARY KEY (bkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (akey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); @@ -70,8 +79,12 @@ SELECT a.val, a.akey FROM tbl_a a, tbl_b b WHERE a.akey = b.akey AND b.bkey = 5; --connection child2_1 --disable_ps_protocol --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; -eval $CHILD2_1_SELECT_TABLES; +eval +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%`tbl_a`%' $STR_SEMICOLON +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%`tbl_b`%'; +eval +SELECT akey, val FROM tbl_a ORDER BY akey $STR_SEMICOLON +SELECT bkey, akey FROM tbl_b ORDER BY bkey; --enable_view_protocol --enable_ps_protocol diff --git a/storage/spider/mysql-test/spider/regression/e112122/my_1_1.cnf b/storage/spider/mysql-test/spider/regression/e112122/my_1_1.cnf index 5f17295d895..be960747491 100644 --- a/storage/spider/mysql-test/spider/regression/e112122/my_1_1.cnf +++ b/storage/spider/mysql-test/spider/regression/e112122/my_1_1.cnf @@ -26,7 +26,6 @@ MASTER_1_HSRPORT= 20000 MASTER_1_HSWPORT= 20001 MASTER_1_MYSOCK= @mysqld.1.1.socket MASTER_1_ENGINE_TYPE= Spider -#MASTER_1_ENGINE_TYPE= MyISAM MASTER_1_ENGINE= ENGINE=Spider MASTER_1_CHARSET= DEFAULT CHARSET=utf8 MASTER_1_ENGINE2= ENGINE=MyISAM @@ -34,11 +33,3 @@ MASTER_1_CHARSET2= DEFAULT CHARSET=utf8 MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci STR_SEMICOLON= ; - -#The followings are set in include/init_xxx.inc files -# MASTER_1_COMMENT_2_1 -# MASTER_1_COMMENT2_2_1 -# MASTER_1_COMMENT3_2_1 -# MASTER_1_COMMENT4_2_1 -# MASTER_1_COMMENT5_2_1 -# MASTER_1_COMMENT_P_2_1 diff --git a/storage/spider/mysql-test/spider/regression/e112122/my_2_1.cnf b/storage/spider/mysql-test/spider/regression/e112122/my_2_1.cnf index 24161645607..adc955ee0d9 100644 --- a/storage/spider/mysql-test/spider/regression/e112122/my_2_1.cnf +++ b/storage/spider/mysql-test/spider/regression/e112122/my_2_1.cnf @@ -34,23 +34,3 @@ CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket CHILD2_1_GM_ENGINE_TYPE= MyISAM CHILD2_1_GM_ENGINE= ENGINE=MyISAM CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_1_DROP_TABLES -# CHILD2_1_CREATE_TABLES -# CHILD2_1_SELECT_TABLES -# CHILD2_1_DROP_TABLES2 -# CHILD2_1_CREATE_TABLES2 -# CHILD2_1_SELECT_TABLES2 -# CHILD2_1_DROP_TABLES3 -# CHILD2_1_CREATE_TABLES3 -# CHILD2_1_SELECT_TABLES3 -# CHILD2_1_DROP_TABLES4 -# CHILD2_1_CREATE_TABLES4 -# CHILD2_1_SELECT_TABLES4 -# CHILD2_1_DROP_TABLES5 -# CHILD2_1_CREATE_TABLES5 -# CHILD2_1_SELECT_TABLES5 -# CHILD2_1_DROP_TABLES6 -# CHILD2_1_CREATE_TABLES6 -# CHILD2_1_SELECT_TABLES6 diff --git a/storage/spider/mysql-test/spider/regression/e112122/my_2_2.cnf b/storage/spider/mysql-test/spider/regression/e112122/my_2_2.cnf index 2d3c2a89a7d..557b02e8e0a 100644 --- a/storage/spider/mysql-test/spider/regression/e112122/my_2_2.cnf +++ b/storage/spider/mysql-test/spider/regression/e112122/my_2_2.cnf @@ -31,8 +31,3 @@ CHILD2_2_GM_MYSOCK= @mysqld.2.2.socket CHILD2_2_GM_ENGINE_TYPE= MyISAM CHILD2_2_GM_ENGINE= ENGINE=MyISAM CHILD2_2_GM_CHARSET= DEFAULT CHARSET=utf8 - -#The followings are set in include/init_xxx.inc files -# CHILD2_2_DROP_TABLES -# CHILD2_2_CREATE_TABLES -# CHILD2_2_SELECT_TABLES diff --git a/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test b/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test index 0a36108df51..b4bbc30f263 100644 --- a/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test +++ b/storage/spider/mysql-test/spider/regression/e112122/t/group_by_order_by_limit_ok.test @@ -27,14 +27,24 @@ USE auto_test_remote2; --connection child2_1 --disable_query_log echo CHILD2_1_CREATE_TABLES; -eval $CHILD2_1_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +skey int NOT NULL, +KEY idx1 (pkey), +KEY idx2 (skey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; --connection child2_2 --disable_query_log echo CHILD2_2_CREATE_TABLES; -eval $CHILD2_2_CREATE_TABLES; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +skey int NOT NULL, +KEY idx1 (pkey), +KEY idx2 (skey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log TRUNCATE TABLE mysql.general_log; @@ -46,12 +56,16 @@ echo CREATE TABLE tbl_a ( KEY idx1 (pkey), KEY idx2 (skey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, skey int NOT NULL, KEY idx1 (pkey), KEY idx2 (skey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' + PARTITION BY KEY(skey) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey,skey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); @@ -81,15 +95,15 @@ set spider_direct_aggregate=@old_spider_direct_aggregate; --connection child2_1 --disable_view_protocol -eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_1_SELECT_TABLES; +SELECT pkey, skey FROM tbl_a ORDER BY pkey; --connection child2_2 --disable_view_protocol -eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol -eval $CHILD2_2_SELECT_TABLES; +SELECT pkey, skey FROM tbl_a ORDER BY pkey; --enable_ps2_protocol --echo diff --git a/storage/spider/mysql-test/spider/t/auto_increment.test b/storage/spider/mysql-test/spider/t/auto_increment.test index fe002edfa0b..00c78fd1f90 100644 --- a/storage/spider/mysql-test/spider/t/auto_increment.test +++ b/storage/spider/mysql-test/spider/t/auto_increment.test @@ -7,74 +7,38 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +col_a INT NOT NULL AUTO_INCREMENT, +col_b VARCHAR(20) DEFAULT 'def', +col_c INT NOT NULL DEFAULT 10, +PRIMARY KEY(col_a) +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -86,12 +50,12 @@ echo CREATE TABLE tbl_a ( col_c INT NOT NULL DEFAULT 100, PRIMARY KEY(col_a) ) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( col_a INT NOT NULL AUTO_INCREMENT, col_b VARCHAR(20) DEFAULT 'defg', col_c INT NOT NULL DEFAULT 100, PRIMARY KEY(col_a) -) $MASTER_1_ENGINE $MASTER_1_AUTO_INCREMENT_2_1 $MASTER_1_COMMENT_2_1; +) ENGINE=Spider AUTO_INCREMENT=20 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"'; --enable_query_log --disable_ps_protocol SHOW CREATE TABLE tbl_a; @@ -116,7 +80,7 @@ INSERT INTO tbl_a () VALUES (); SHOW CREATE TABLE tbl_a; --disable_query_log echo MASTER_1_AUTO_INCREMENT1; -eval $MASTER_1_AUTO_INCREMENT1; +ALTER TABLE tbl_a AUTO_INCREMENT=30; --enable_query_log --disable_ps_protocol SHOW CREATE TABLE tbl_a; @@ -126,7 +90,7 @@ INSERT INTO tbl_a () VALUES (); SHOW CREATE TABLE tbl_a; --disable_query_log echo MASTER_1_AUTO_INCREMENT2; -eval $MASTER_1_AUTO_INCREMENT2; +ALTER TABLE tbl_a AUTO_INCREMENT=10; --enable_query_log --disable_ps_protocol SHOW CREATE TABLE tbl_a; @@ -137,50 +101,18 @@ SHOW CREATE TABLE tbl_a; --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol SELECT * FROM tbl_a; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_a, col_b, col_c FROM tbl_a ORDER BY col_a; --enable_ps2_protocol --echo @@ -188,15 +120,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source auto_increment_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/auto_increment_deinit.inc b/storage/spider/mysql-test/spider/t/auto_increment_deinit.inc index 52be67a1d09..ecb5622af14 100644 --- a/storage/spider/mysql-test/spider/t/auto_increment_deinit.inc +++ b/storage/spider/mysql-test/spider/t/auto_increment_deinit.inc @@ -1,9 +1,3 @@ ---let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP ---let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP ---let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP ---let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP ---let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP ---let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP --disable_warnings --disable_query_log --disable_result_log diff --git a/storage/spider/mysql-test/spider/t/auto_increment_init.inc b/storage/spider/mysql-test/spider/t/auto_increment_init.inc index 52245bdd02e..6cf6b0c1f41 100644 --- a/storage/spider/mysql-test/spider/t/auto_increment_init.inc +++ b/storage/spider/mysql-test/spider/t/auto_increment_init.inc @@ -5,34 +5,3 @@ --enable_result_log --enable_query_log --enable_warnings ---let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 -let $MASTER_1_COMMENT_2_1= - COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"'; -let $MASTER_1_AUTO_INCREMENT_2_1= - AUTO_INCREMENT=20; -let $MASTER_1_AUTO_INCREMENT1= - ALTER TABLE tbl_a AUTO_INCREMENT=30; -let $MASTER_1_AUTO_INCREMENT2= - ALTER TABLE tbl_a AUTO_INCREMENT=10; -let $CHILD2_1_CHARSET_AUTO_INCREMENT= - AUTO_INCREMENT=20; ---let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES -let $CHILD2_1_DROP_TABLES= - DROP TABLE IF EXISTS tbl_a; ---let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES -let $CHILD2_1_CREATE_TABLES= - CREATE TABLE tbl_a ( - col_a INT NOT NULL AUTO_INCREMENT, - col_b VARCHAR(20) DEFAULT 'def', - col_c INT NOT NULL DEFAULT 10, - PRIMARY KEY(col_a) - ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET_AUTO_INCREMENT $CHILD2_1_CHARSET; ---let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES -let $CHILD2_1_SELECT_TABLES= - SELECT col_a, col_b, col_c FROM tbl_a ORDER BY col_a; -let $CHILD2_1_SELECT_ARGUMENT1= - SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; ---let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 ---let $OUTPUT_CHILD_GROUP2= 1 ---let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG ---let $USE_GENERAL_LOG= 1 diff --git a/storage/spider/mysql-test/spider/t/basic_sql.test b/storage/spider/mysql-test/spider/t/basic_sql.test index 9439d01d9d9..7877a4e9525 100644 --- a/storage/spider/mysql-test/spider/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/t/basic_sql.test @@ -12,8 +12,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -22,65 +20,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tb_l; @@ -92,12 +64,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -113,71 +85,32 @@ echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 SELECT a, b, c FROM tb_l; -if ($MASTER_1_MERGE) -{ - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""' SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; - INSERT INTO ta_l SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_MERGE) -{ - eval CREATE TABLE ta_l ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 - SELECT a, b, c FROM tb_l; -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo create table ignore select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -190,12 +123,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'f', '2008-07-01 10:21:39'), @@ -208,71 +141,32 @@ echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 IGNORE SELECT a, b, c FROM tb_l; -if ($MASTER_1_MERGE) -{ - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""' IGNORE SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; - INSERT IGNORE INTO ta_l SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_MERGE) -{ - eval CREATE TABLE ta_l ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 - IGNORE SELECT a, b, c FROM tb_l; -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo create table ignore select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -282,85 +176,40 @@ echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 REPLACE SELECT a, b, c FROM tb_l; -if ($MASTER_1_MERGE) -{ - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""' REPLACE SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; - REPLACE INTO ta_l SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_MERGE) -{ - eval CREATE TABLE ta_l ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1 - REPLACE SELECT a, b, c FROM tb_l; -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%replace %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo create no index table -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES3; - echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l_no_idx; @@ -369,778 +218,328 @@ DROP TABLE IF EXISTS ta_l_no_idx; echo CREATE TABLE ta_l_no_idx MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1 SELECT a, b, c FROM tb_l; -if ($MASTER_1_NEEDPK) -{ - --error ER_REQUIRES_PRIMARY_KEY - eval CREATE TABLE ta_l_no_idx - $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1 - SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l_no_idx ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; - INSERT INTO ta_l_no_idx SELECT a, b, c FROM tb_l; -} -if (!$MASTER_1_NEEDPK) -{ - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l_no_idx - $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1 +eval +CREATE TABLE ta_l_no_idx +ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"' SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l_no_idx ( - a INT, - b CHAR(1), - c DATETIME - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; - INSERT INTO ta_l_no_idx SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l_no_idx - $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1 - SELECT a, b, c FROM tb_l; - } -} --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES3; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_no_idx ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l_no_idx ORDER BY a; --echo --echo select table -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table shared mode -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a LOCK IN SHARE MODE; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table for update -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a FOR UPDATE; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table join -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a, tb_l b WHERE a.a = b.a ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table straight_join -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT STRAIGHT_JOIN a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a, tb_l b WHERE a.a = b.a ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_small_result -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_SMALL_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_big_result -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_BIG_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_buffer_result -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_BUFFER_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_cache -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select sql_no_cache -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT SQL_NO_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select high_priority -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT HIGH_PRIORITY a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select distinct -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT DISTINCT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select count -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT count(*) FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table join not use index -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM tb_l a WHERE EXISTS (SELECT * FROM ta_l b WHERE b.b = a.b) ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select using pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE a.b = 'g' ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select using index and pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE a.a > 0 AND a.b = 'g' ORDER BY a.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo insert --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1148,45 +547,21 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert select --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1194,46 +569,22 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert select a --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1), 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1241,45 +592,21 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert low_priority --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT LOW_PRIORITY INTO ta_l (a, b, c) values (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1287,90 +614,42 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert high_priority --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT HIGH_PRIORITY INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo insert ignore -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT IGNORE INTO ta_l (a, b, c) VALUES (2, 'd', '2009-02-02 01:01:01'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1378,97 +657,49 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo insert update (insert) --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE KEY UPDATE b = 'f', c = '2005-08-08 11:11:11'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo insert update (update) -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE KEY UPDATE b = 'f', c = '2005-08-08 11:11:11'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1477,191 +708,95 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --connection master_1 TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE INTO ta_l (a, b, c) VALUES (2, 'f', '2008-02-02 02:02:02'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo replace select -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo replace select a -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1), 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo replace low_priority -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 REPLACE LOW_PRIORITY INTO ta_l (a, b, c) VALUES (3, 'g', '2009-03-03 03:03:03'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'replace %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -1670,409 +805,193 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (2, 'e', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update select -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a IN (SELECT a FROM tb_l); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update select a -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'h', c = '2010-04-04 04:04:04' WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update join -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l a, tb_l b SET a.b = b.b, a.c = b.c WHERE a.a = b.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update join a -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l a, tb_l b SET a.b = 'g', a.c = '2009-03-03 03:03:03' WHERE a.a = b.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update low_priority -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE LOW_PRIORITY ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update ignore -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE IGNORE ta_l SET a = 1, b = 'g', c = '2009-03-03 03:03:03' WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 update ta_l set b = 'j', c = '2009-03-03 03:03:03' where b = 'f'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo update index pushdown -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'j'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2085,91 +1004,43 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo delete all -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2182,46 +1053,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a IN (SELECT a FROM tb_l); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2234,46 +1081,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2286,46 +1109,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE a FROM ta_l a, (SELECT a FROM tb_l ORDER BY a) b WHERE a.a = b.a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2338,46 +1137,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE LOW_PRIORITY FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2390,46 +1165,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE IGNORE FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2442,46 +1193,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE QUICK FROM ta_l WHERE a = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2494,46 +1221,22 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE b = 'e'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2546,90 +1249,42 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), (6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'), (8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'), (10, 'j', '2008-01-01 23:59:59'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 DELETE FROM ta_l WHERE a > 0 AND b = 'e'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo --echo truncate -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 TRUNCATE TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'truncate %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -2650,13 +1305,10 @@ drop table mdev_26139; --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log diff --git a/storage/spider/mysql-test/spider/t/basic_sql_part.test b/storage/spider/mysql-test/spider/t/basic_sql_part.test index 1bb18358d5d..b1a8499251c 100644 --- a/storage/spider/mysql-test/spider/t/basic_sql_part.test +++ b/storage/spider/mysql-test/spider/t/basic_sql_part.test @@ -5,16 +5,6 @@ --source test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -22,8 +12,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -32,30 +20,20 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings @@ -68,12 +46,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'f', '2008-07-01 10:21:39'), @@ -84,483 +62,226 @@ INSERT INTO tb_l (a, b, c) VALUES --echo --echo create table with partition and select test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 SELECT a, b, c FROM tb_l; - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1", table "ta_r2", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_2", priority "1000001"' + ) SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - } --enable_query_log - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo select partition using pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } -} --echo --echo select partition using index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE a.a > 0 AND a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } -} --echo --echo update partition pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo update partition index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo delete partition pushdown -if ($HAVE_PARTITION) -{ TRUNCATE TABLE ta_l2; INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 DELETE FROM ta_l2 WHERE b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo delete partition index pushdown -if ($HAVE_PARTITION) -{ TRUNCATE TABLE ta_l2; INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test index 15848cf8f35..42b12838c5b 100644 --- a/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test +++ b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test @@ -5,59 +5,34 @@ --disable_warnings CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_CREATE_TABLES; - } - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -68,64 +43,26 @@ FLUSH TABLES; --echo --echo select test 1 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 CHECKSUM TABLE tbl_a EXTENDED; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --disable_ps2_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%checksum %'; --enable_ps2_protocol --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_a ORDER BY pkey; --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/checksum_table_with_quick_mode_3_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_aggregate.test b/storage/spider/mysql-test/spider/t/direct_aggregate.test index 89997ba742b..8ae0cd5157f 100644 --- a/storage/spider/mysql-test/spider/t/direct_aggregate.test +++ b/storage/spider/mysql-test/spider/t/direct_aggregate.test @@ -11,8 +11,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -21,65 +19,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -91,12 +63,15 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -109,37 +84,25 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo direct_aggregating test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT COUNT(*) FROM ta_l; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l WHERE a < 5; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l WHERE a > 1; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; --enable_ps2_protocol SET spider_direct_aggregate=0; @@ -148,41 +111,26 @@ SELECT MAX(a) FROM ta_l; SELECT MIN(a) FROM ta_l; SELECT MAX(a) FROM ta_l WHERE a < 5; SELECT MIN(a) FROM ta_l WHERE a > 1; -eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SET spider_direct_aggregate=1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/t/direct_aggregate_part.test index 3e593183ce8..7a52cd8d069 100644 --- a/storage/spider/mysql-test/spider/t/direct_aggregate_part.test +++ b/storage/spider/mysql-test/spider/t/direct_aggregate_part.test @@ -4,16 +4,6 @@ --source test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -21,8 +11,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,86 +19,49 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -119,12 +70,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -138,21 +95,20 @@ if ($HAVE_PARTITION) set @old_spider_direct_aggregate=@@session.spider_direct_aggregate; set spider_direct_aggregate=1; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT COUNT(*) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT SUM(a) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l2; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MAX(a) FROM ta_l2 WHERE a < 5; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; SELECT MIN(a) FROM ta_l2 WHERE a > 1; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; --enable_ps2_protocol - SET spider_direct_aggregate=0; SELECT COUNT(*) FROM ta_l2; SELECT SUM(a) FROM ta_l2; @@ -160,49 +116,30 @@ if ($HAVE_PARTITION) SELECT MIN(a) FROM ta_l2; SELECT MAX(a) FROM ta_l2 WHERE a < 5; SELECT MIN(a) FROM ta_l2 WHERE a > 1; - eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_aggregate'; set spider_direct_aggregate=@old_spider_direct_aggregate; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/direct_join.test b/storage/spider/mysql-test/spider/t/direct_join.test index c2ebd03e60c..b37dc6e7779 100644 --- a/storage/spider/mysql-test/spider/t/direct_join.test +++ b/storage/spider/mysql-test/spider/t/direct_join.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -60,29 +32,33 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES; echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES5; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -95,23 +71,29 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, @@ -120,14 +102,17 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); @@ -137,92 +122,50 @@ insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500); --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.a, c.b, c.c FROM tbl_a a, tbl_b b, tbl_c c WHERE a.a = b.a and a.a = c.a ORDER BY a.b DESC LIMIT 1,2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo --echo Test JOIN on a constant table. --echo Spider should NOT push down the join because the tbl_person table --echo is optimized as a constant table. -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_CONST_TABLE_JOIN; echo CHILD2_1_DROP_CONST_TABLE2_JOIN; echo CHILD2_1_CREATE_CONST_TABLE_JOIN; echo CHILD2_1_CREATE_CONST_TABLE2_JOIN; - } --disable_warnings - eval $CHILD2_1_DROP_CONST_TABLE_JOIN; - eval $CHILD2_1_DROP_CONST_TABLE2_JOIN; +DROP TABLE IF EXISTS tbl_person; +DROP TABLE IF EXISTS tbl_ncd_cm_person; --enable_warnings - eval $CHILD2_1_CREATE_CONST_TABLE_JOIN; - eval $CHILD2_1_CREATE_CONST_TABLE2_JOIN; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_person ( +id VARCHAR(50) NOT NULL, +hr_status VARCHAR(50) NULL DEFAULT NULL, +region_code VARCHAR(50) NULL DEFAULT NULL, +region INT(11) NOT NULL, +PRIMARY KEY (id, region) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Dynamic; +CREATE TABLE tbl_ncd_cm_person ( +id VARCHAR(50) NOT NULL, +person_id VARCHAR(50) NULL DEFAULT '', +diseaseKind_id VARCHAR(50) NULL DEFAULT NULL, +region INT(11) NOT NULL, +PRIMARY KEY (id, region) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Dynamic; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_person; @@ -237,14 +180,16 @@ echo CREATE TABLE tbl_person ( PRIMARY KEY (id, region) USING BTREE ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_CONST_TABLE_JOIN MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN MASTER_1_PART_CONST_TABLE_JOIN; -eval CREATE TABLE tbl_person ( +CREATE TABLE tbl_person ( id VARCHAR(50) NOT NULL, hr_status VARCHAR(50) NULL DEFAULT NULL, region_code VARCHAR(50) NULL DEFAULT NULL, region INT(11) NOT NULL, PRIMARY KEY (id, region) USING BTREE - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_CONST_TABLE_JOIN - $MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN $MASTER_1_PART_CONST_TABLE_JOIN; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'table "tbl_ncd_cm_person"' +ROW_FORMAT = Dynamic PARTITION BY LIST COLUMNS (region) PARTITIONS 1 +(PARTITION pt1 values in (510411) +COMMENT = 'tbl "tbl_person", srv "s_2_1"' MAX_ROWS = 0 MIN_ROWS = 0); echo SHOW CREATE TABLE tbl_person; --disable_ps_protocol SHOW CREATE TABLE tbl_person; @@ -257,14 +202,16 @@ echo CREATE TABLE tbl_ncd_cm_person ( PRIMARY KEY (id, region) USING BTREE ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_CONST_TABLE2_JOIN MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN MASTER_1_PART_CONST_TABLE2_JOIN; -eval CREATE TABLE tbl_ncd_cm_person ( +CREATE TABLE tbl_ncd_cm_person ( id VARCHAR(50) NOT NULL, person_id VARCHAR(50) NULL DEFAULT '', diseaseKind_id VARCHAR(50) NULL DEFAULT NULL, region INT(11) NOT NULL, PRIMARY KEY (id, region) USING BTREE - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_CONST_TABLE2_JOIN - $MASTER_1_ROW_FORMAT_CONST_TABLE_JOIN $MASTER_1_PART_CONST_TABLE2_JOIN; +) ENGINE=Spider DEFAULT CHARSET=utf8 +ROW_FORMAT = Dynamic PARTITION BY LIST COLUMNS (region) PARTITIONS 1 +(PARTITION pt1 values in (510411) +COMMENT = 'tbl "tbl_ncd_cm_person", srv "s_2_1"' MAX_ROWS = 0 MIN_ROWS = 0); echo SHOW CREATE TABLE tbl_ncd_cm_person; --disable_ps_protocol SHOW CREATE TABLE tbl_ncd_cm_person; @@ -291,50 +238,18 @@ INSERT INTO tbl_ncd_cm_person VALUES ('123456789AB', '123456789012345678901234567890AB', '52A0328740914BCE86ED10A4D2521816', 510411); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT count(0) FROM tbl_person tp INNER JOIN tbl_ncd_cm_person tncp ON tp.id = tncp.person_id WHERE 1 = 1 AND tp.hr_status != "99" AND tp.hr_status != "2" AND tp.region_code LIKE CONCAT(CONCAT('%', '51041110620301', '%')) AND tp.id = '24FC3F0A5119432BAE13DD65AABAA39C' AND tncp.diseaseKind_id = '52A0328740914BCE86ED10A4D2521816' AND tp.region = 510411; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_CONST_TABLE_JOIN; - eval $CHILD2_1_SELECT_CONST_TABLE2_JOIN; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT * FROM tbl_person; +SELECT * FROM tbl_ncd_cm_person; --enable_ps2_protocol --echo @@ -342,15 +257,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_join_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_join_using.test b/storage/spider/mysql-test/spider/t/direct_join_using.test index a14c0158549..fcc273e5d1e 100644 --- a/storage/spider/mysql-test/spider/t/direct_join_using.test +++ b/storage/spider/mysql-test/spider/t/direct_join_using.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -60,29 +32,33 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES; echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES5; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -95,23 +71,29 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, @@ -120,14 +102,17 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); @@ -137,52 +122,19 @@ insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500); --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol SELECT a.a, c.b, c.c FROM tbl_a a join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC; --enable_view_protocol - -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -190,15 +142,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_join_using_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_left_join.test b/storage/spider/mysql-test/spider/t/direct_left_join.test index 5b7087a5ce5..2bce65734d5 100644 --- a/storage/spider/mysql-test/spider/t/direct_left_join.test +++ b/storage/spider/mysql-test/spider/t/direct_left_join.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -60,29 +32,33 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES; echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES5; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -95,23 +71,29 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, @@ -120,14 +102,17 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); @@ -137,52 +122,19 @@ insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500); --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol SELECT a.a, c.b, c.c FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC; --enable_view_protocol - -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -190,15 +142,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_left_join_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test index 7de6e6a2a4d..da42006ea99 100644 --- a/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test +++ b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -62,31 +34,37 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES4; echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES4; - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_auto_inc; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES4; - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -99,23 +77,29 @@ echo CREATE TABLE tbl_a ( KEY idx0(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', @@ -124,24 +108,30 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1; -eval CREATE TABLE tbl_d ( +eval +CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); @@ -152,50 +142,18 @@ insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/ --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.a, c.b, c.c, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -203,15 +161,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_left_join_nullable_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test index f7f02ec9ea9..86519608b4d 100644 --- a/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test +++ b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -62,31 +34,37 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES4; echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES4; - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_auto_inc; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES4; - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -99,23 +77,29 @@ echo CREATE TABLE tbl_a ( KEY idx0(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', @@ -124,24 +108,30 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1; -eval CREATE TABLE tbl_d ( +eval +CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); @@ -152,50 +142,18 @@ insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/ --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -203,15 +161,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_left_right_join_nullable_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test index 2e27d0a062c..06311337cdb 100644 --- a/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test +++ b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -62,31 +34,37 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES4; echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES4; - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_auto_inc; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES4; - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -99,23 +77,29 @@ echo CREATE TABLE tbl_a ( KEY idx0(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', @@ -124,24 +108,30 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1; -eval CREATE TABLE tbl_d ( +eval +CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); @@ -152,50 +142,18 @@ insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/ --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -203,15 +161,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_left_right_left_join_nullable_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_right_join.test b/storage/spider/mysql-test/spider/t/direct_right_join.test index 3a4eb5183b1..97876edd374 100644 --- a/storage/spider/mysql-test/spider/t/direct_right_join.test +++ b/storage/spider/mysql-test/spider/t/direct_right_join.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -60,29 +32,33 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES; echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES5; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -95,23 +71,29 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, @@ -120,14 +102,17 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); @@ -137,52 +122,19 @@ insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500); --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC; --enable_view_protocol - -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -190,15 +142,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_right_join_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test index 0089f4df4c0..8d1af261642 100644 --- a/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test +++ b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -62,31 +34,37 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES4; echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES4; - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_auto_inc; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES4; - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -99,23 +77,29 @@ echo CREATE TABLE tbl_a ( KEY idx0(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', @@ -124,24 +108,30 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1; -eval CREATE TABLE tbl_d ( +eval +CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); @@ -152,50 +142,18 @@ insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/ --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -203,15 +161,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_right_join_nullable_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test index 18ae8eb1c9f..b51709ac563 100644 --- a/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test +++ b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -62,31 +34,37 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES4; echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES4; - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_auto_inc; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES4; - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -99,23 +77,29 @@ echo CREATE TABLE tbl_a ( KEY idx0(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', @@ -124,24 +108,30 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1; -eval CREATE TABLE tbl_d ( +eval +CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); @@ -152,50 +142,18 @@ insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/ --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -203,15 +161,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_right_left_join_nullable_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test index d6354898b21..5cb91477b17 100644 --- a/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test +++ b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test @@ -7,52 +7,24 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES6; @@ -62,31 +34,37 @@ if ($USE_CHILD_GROUP2) echo CHILD2_1_CREATE_TABLES6; echo CHILD2_1_CREATE_TABLES4; echo CHILD2_1_CREATE_TABLES3; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES6; - eval $CHILD2_1_DROP_TABLES4; - eval $CHILD2_1_DROP_TABLES3; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r_3; +DROP TABLE IF EXISTS ta_r_auto_inc; +DROP TABLE IF EXISTS ta_r_no_idx; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES6; - eval $CHILD2_1_CREATE_TABLES4; - eval $CHILD2_1_CREATE_TABLES3; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r_no_idx ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -99,23 +77,29 @@ echo CREATE TABLE tbl_a ( KEY idx0(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +eval +CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE tbl_b ( +eval +CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', @@ -124,24 +108,30 @@ echo CREATE TABLE tbl_c ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; -eval CREATE TABLE tbl_c ( +eval +CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', KEY idx0(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1; -eval CREATE TABLE tbl_d ( +eval +CREATE TABLE tbl_d ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT2_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_no_idx"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password "", prt "2000000"'; --enable_query_log --disable_ps_protocol insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); @@ -152,50 +142,18 @@ insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/ --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_ps2_protocol --echo @@ -203,15 +161,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/direct_right_left_right_join_nullable_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/direct_update.test b/storage/spider/mysql-test/spider/t/direct_update.test index 8b8bb1e50c9..9a80e88ed5e 100644 --- a/storage/spider/mysql-test/spider/t/direct_update.test +++ b/storage/spider/mysql-test/spider/t/direct_update.test @@ -11,8 +11,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -21,65 +19,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -91,12 +63,15 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -109,87 +84,60 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo direct_updating test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update all rows with function UPDATE ta_l SET c = ADDDATE(c, 1); -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update by primary key UPDATE ta_l SET b = 'x' WHERE a = 3; -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update by a column without index UPDATE ta_l SET c = '2011-10-17' WHERE b = 'x'; -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo update by primary key with order and limit UPDATE ta_l SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; -eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo delete by primary key with order and limit DELETE FROM ta_l WHERE a < 4 ORDER BY c LIMIT 1; -eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo delete by a column without index DELETE FROM ta_l WHERE b = 'c'; -eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo delete by primary key DELETE FROM ta_l WHERE a = 3; -eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/direct_update_part.test b/storage/spider/mysql-test/spider/t/direct_update_part.test index 690fa834659..6a0378a4cd9 100644 --- a/storage/spider/mysql-test/spider/t/direct_update_part.test +++ b/storage/spider/mysql-test/spider/t/direct_update_part.test @@ -4,16 +4,6 @@ --source test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -21,8 +11,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,86 +19,49 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -119,12 +70,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -134,75 +91,56 @@ if ($HAVE_PARTITION) (5, 'c', '2001-12-31 23:59:59'); --enable_ps_protocol --enable_query_log - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update all rows with function UPDATE ta_l2 SET c = ADDDATE(c, 1); - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update by primary key UPDATE ta_l2 SET b = 'x' WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update by a column without index UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo update by primary key with order and limit UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; +SHOW STATUS LIKE 'Spider_direct_update'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo delete by primary key with order and limit DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo delete by a column without index DELETE FROM ta_l2 WHERE b = 'c'; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; --echo delete by primary key DELETE FROM ta_l2 WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; +SHOW STATUS LIKE 'Spider_direct_delete'; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/error_row_number.test b/storage/spider/mysql-test/spider/t/error_row_number.test index 408e739656a..2774b221bae 100644 --- a/storage/spider/mysql-test/spider/t/error_row_number.test +++ b/storage/spider/mysql-test/spider/t/error_row_number.test @@ -5,6 +5,10 @@ --disable_query_log --disable_result_log --source test_init.inc +let $MASTER_1_COMMENT_2_1= + COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_result_log --enable_query_log diff --git a/storage/spider/mysql-test/spider/t/function.test b/storage/spider/mysql-test/spider/t/function.test index 2b81a130ab9..c84ce6235cc 100644 --- a/storage/spider/mysql-test/spider/t/function.test +++ b/storage/spider/mysql-test/spider/t/function.test @@ -12,8 +12,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -22,66 +20,45 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo in() -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TEXT_PK_TABLES1; - echo CHILD2_1_CREATE_TEXT_PK_TABLES1; - } --disable_warnings - eval $CHILD2_1_DROP_TEXT_PK_TABLES1; +DROP TABLE IF EXISTS t1; --enable_warnings - eval $CHILD2_1_CREATE_TEXT_PK_TABLES1; +CREATE TABLE t1 ( +a VARCHAR(255), +PRIMARY KEY (a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE t1 ( a VARCHAR(255), PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET3 MASTER_1_COMMENT_TEXT_PK1_1; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( a VARCHAR(255), PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET3 $MASTER_1_COMMENT_TEXT_PK1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT 'tbl "t1", srv "s_2_1"'; --enable_query_log --disable_ps_protocol insert into t1 values ('1'); @@ -97,82 +74,42 @@ insert into t1 select a + 128 from t1; insert into t1 select a + 256 from t1; insert into t1 select a + 512 from t1; flush tables; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol select a from t1 where a in ('15', '120'); --enable_ps_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TEXT_PK_TABLES1; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a FROM t1 ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo date_sub() -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -184,12 +121,15 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -215,25 +155,13 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; UPDATE ta_l SET c = DATE_SUB(c, INTERVAL 1 MINUTE); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 SECOND); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -242,13 +170,10 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/ha.test b/storage/spider/mysql-test/spider/t/ha.test index dab57bcea1c..3d47ad92d06 100644 --- a/storage/spider/mysql-test/spider/t/ha.test +++ b/storage/spider/mysql-test/spider/t/ha.test @@ -1,6 +1,4 @@ # This test tests for ha features -if ($USE_HA_TEST) -{ --disable_warnings --disable_query_log --disable_result_log @@ -15,8 +13,6 @@ if ($USE_HA_TEST) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -29,9 +25,6 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; @@ -44,133 +37,111 @@ if ($USE_CHILD_GROUP3) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; --connection child2_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 SELECT 1; --connection child3_2 SELECT 1; --connection child3_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} --echo --echo create table test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -182,12 +153,16 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -200,377 +175,277 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo fail-over test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_HA_DROP_TABLES; - } --disable_warnings - eval $CHILD2_2_HA_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); -eval $MASTER_1_CHECK_LINK_STATUS; -eval $MASTER_1_CHECK_LINK_FAILED_LOG; -eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } -} --echo --echo recovery test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_HA_CREATE_TABLES; - } - eval $CHILD2_2_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_SET_RECOVERY_STATUS_2_1; -eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 2"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol --disable_view_protocol -eval $MASTER_1_COPY_TABLES_2_1; +SELECT spider_copy_tables('ta_l', '0', '1'); --enable_ps_protocol --enable_view_protocol -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_SET_OK_STATUS_2_1; -eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", + database "auto_test_remote auto_test_remote2", lst "0 1"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'); --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; DROP TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol -eval $MASTER_1_CHANGE_HA_MON; +SELECT spider_flush_table_mon_cache(); --enable_ps2_protocol --echo --echo active standby test --echo create table test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_2_1; +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +eval +CREATE TABLE ta_l ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l; @@ -582,12 +457,16 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='socket "$CHILD2_1_MYSOCK $CHILD2_2_MYSOCK", table "ta_r ta_r3"' + CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2"'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -600,263 +479,160 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} --echo --echo fail-over test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES; - } --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); -eval $MASTER_1_CHECK_LINK_STATUS; -eval $MASTER_1_CHECK_LINK_FAILED_LOG; -eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } -} --echo --echo recovery test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } -} --connection master_1 -eval $MASTER_1_SET_OK_STATUS_AS_2_1; -eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l +CONNECTION='host "localhost", user "root", password "", + msi "5", mkd "2", alc "1", + database "auto_test_remote auto_test_remote2", lst "1 0"'; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'); --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; DROP TABLE ta_l; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_2_1; +DROP TABLE IF EXISTS ta_l; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol -eval $MASTER_1_CHANGE_HA_MON; +SELECT spider_flush_table_mon_cache(); --enable_ps2_protocol --echo @@ -864,24 +640,18 @@ eval $MASTER_1_CHANGE_HA_MON; --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; --connection child3_2 DROP DATABASE IF EXISTS auto_test_local; --connection child3_3 DROP DATABASE IF EXISTS auto_test_local; -} --disable_query_log --disable_result_log --source ha_test_deinit.inc @@ -889,6 +659,5 @@ if ($USE_CHILD_GROUP3) --enable_result_log --enable_query_log --enable_warnings -} --echo --echo end of test diff --git a/storage/spider/mysql-test/spider/t/ha_part.test b/storage/spider/mysql-test/spider/t/ha_part.test index 3551c59e51d..97165a15d59 100644 --- a/storage/spider/mysql-test/spider/t/ha_part.test +++ b/storage/spider/mysql-test/spider/t/ha_part.test @@ -1,6 +1,4 @@ # This test tests for ha features -if ($USE_HA_TEST) -{ --disable_warnings --disable_query_log --disable_result_log @@ -8,17 +6,6 @@ if ($USE_HA_TEST) --source ha_test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source ha_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -26,8 +13,6 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -40,9 +25,6 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; @@ -55,158 +37,135 @@ if ($USE_CHILD_GROUP3) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; --connection child2_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} -if ($USE_CHILD_GROUP3) -{ - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 SELECT 1; --connection child3_2 SELECT 1; --connection child3_3 SELECT 1; - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } -} -if ($HAVE_PARTITION) -{ --echo --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; +DROP TABLE IF EXISTS ta_r4; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r4 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --enable_result_log - } - } --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l2; @@ -218,12 +177,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='msi "5", mkd "2"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES @@ -236,262 +201,198 @@ if ($HAVE_PARTITION) --echo --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } --echo --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_DROP_TABLES; - } --disable_warnings - eval $CHILD2_3_HA_DROP_TABLES; +DROP TABLE IF EXISTS ta_r4; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } - } --echo --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_CREATE_TABLES; - } - eval $CHILD2_3_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r4 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol --disable_view_protocol - eval $MASTER_1_COPY_TABLES_P_2_1; +SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); --enable_ps_protocol --enable_view_protocol - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_SET_OK_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'), @@ -499,171 +400,139 @@ if ($HAVE_PARTITION) --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } - } -} -if ($HAVE_PARTITION) -{ --echo --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; +DROP TABLE IF EXISTS ta_r4; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r4 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { +CREATE TABLE ta_l2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=Spider DEFAULT CHARSET=utf8 +COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --enable_result_log - } - } --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l2; @@ -675,12 +544,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='msi "5", mkd "2", alc "1"' + PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES @@ -693,241 +568,152 @@ if ($HAVE_PARTITION) --echo --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } --echo --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES2; - } --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; --error 12511 INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; INSERT INTO ta_l2 (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; --enable_query_log --enable_result_log - } - } --echo --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES2; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --enable_query_log --enable_result_log - } - } --connection master_1 - eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (8, 'g', '2011-05-05 21:33:30'), @@ -935,67 +721,38 @@ if ($HAVE_PARTITION) --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_3 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r4 ORDER BY a; --enable_query_log --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { --disable_query_log --disable_result_log - } --connection child3_1 --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_2 --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings --connection child3_3 --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; +DROP TABLE IF EXISTS ta_l2; --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { --enable_query_log --enable_result_log - } - } -} --connection master_1 - CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER); SHOW FIELDS FROM t; SHOW FIELDS FROM t; @@ -1006,24 +763,18 @@ DROP TABLE t; --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; -} -if ($USE_CHILD_GROUP3) -{ --connection child3_1 DROP DATABASE IF EXISTS auto_test_local; --connection child3_2 DROP DATABASE IF EXISTS auto_test_local; --connection child3_3 DROP DATABASE IF EXISTS auto_test_local; -} --disable_query_log --disable_result_log --source ha_test_deinit.inc @@ -1031,6 +782,5 @@ if ($USE_CHILD_GROUP3) --enable_result_log --enable_query_log --enable_warnings -} --echo --echo end of test diff --git a/storage/spider/mysql-test/spider/t/ha_test_deinit.inc b/storage/spider/mysql-test/spider/t/ha_test_deinit.inc index 53d0409d066..1ea64a434a5 100644 --- a/storage/spider/mysql-test/spider/t/ha_test_deinit.inc +++ b/storage/spider/mysql-test/spider/t/ha_test_deinit.inc @@ -1,19 +1,12 @@ # get connection and exist engine test --echo for master_1 --connection master_1 ---source ../include/ha_deinit_master_1.inc --echo for child2 if ($USE_CHILD_GROUP2) { --echo child2_1 - --connection child2_1 - --source ../include/ha_deinit_child2_1.inc --echo child2_2 - --connection child2_2 - --source ../include/ha_deinit_child2_2.inc --echo child2_3 - --connection child2_3 - --source ../include/ha_deinit_child2_3.inc } --echo for child3 if ($USE_CHILD_GROUP3) diff --git a/storage/spider/mysql-test/spider/t/ha_test_init.inc b/storage/spider/mysql-test/spider/t/ha_test_init.inc index 70576ab16dc..4b836b03919 100644 --- a/storage/spider/mysql-test/spider/t/ha_test_init.inc +++ b/storage/spider/mysql-test/spider/t/ha_test_init.inc @@ -6,14 +6,8 @@ if ($USE_CHILD_GROUP2) { --echo child2_1 - --connection child2_1 - --source ../include/ha_init_child2_1.inc --echo child2_2 - --connection child2_2 - --source ../include/ha_init_child2_2.inc --echo child2_3 - --connection child2_3 - --source ../include/ha_init_child2_3.inc } --echo for child3 if ($USE_CHILD_GROUP3) diff --git a/storage/spider/mysql-test/spider/t/partition_cond_push.test b/storage/spider/mysql-test/spider/t/partition_cond_push.test index 6d96831d656..b71a565f9d4 100644 --- a/storage/spider/mysql-test/spider/t/partition_cond_push.test +++ b/storage/spider/mysql-test/spider/t/partition_cond_push.test @@ -1,9 +1,4 @@ --source ../include/partition_cond_push_init.inc -if (!$HAVE_PARTITION) -{ - --source ../include/partition_cond_push_deinit.inc - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -12,110 +7,64 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; --connection child2_3 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +value int NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_DROP_TABLES; echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +value int NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_3_DROP_TABLES; echo CHILD2_3_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +value int NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -125,9 +74,14 @@ DROP TABLE IF EXISTS tbl_b; echo CREATE TABLE tbl_a ( value int NOT NULL ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( value int NOT NULL -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' + PARTITION BY KEY(value) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"', +PARTITION pt3 COMMENT='srv "s_2_3"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (value) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -137,64 +91,26 @@ INSERT INTO tbl_a (value) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(2 --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT value FROM tbl_a WHERE value < 100; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT value FROM tbl_a ORDER BY value; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; +SELECT value FROM tbl_a ORDER BY value; --connection child2_3 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_3_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT value FROM tbl_a ORDER BY value; --enable_ps2_protocol --echo @@ -202,27 +118,15 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/partition_cond_push_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/partition_fulltext.test b/storage/spider/mysql-test/spider/t/partition_fulltext.test index 5c6a7863fd8..661cee3a626 100644 --- a/storage/spider/mysql-test/spider/t/partition_fulltext.test +++ b/storage/spider/mysql-test/spider/t/partition_fulltext.test @@ -1,9 +1,4 @@ --source ../include/partition_fulltext_init.inc -if (!$HAVE_PARTITION) -{ - --source ../include/partition_fulltext_deinit.inc - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -12,110 +7,73 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; --connection child2_3 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +words text NOT NULL, +PRIMARY KEY (pkey), +FULLTEXT (words) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_DROP_TABLES; echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +words text NOT NULL, +PRIMARY KEY (pkey), +FULLTEXT (words) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_3_DROP_TABLES; echo CHILD2_3_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +words text NOT NULL, +PRIMARY KEY (pkey), +FULLTEXT (words) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -128,12 +86,17 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY (pkey), FULLTEXT (words) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, words text NOT NULL, PRIMARY KEY (pkey), FULLTEXT (words) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", bka_mode "1"' + PARTITION BY KEY(pkey) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"', +PARTITION pt3 COMMENT='srv "s_2_3"' + ); --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey, words) VALUES (0, 'abc'),(1, 'def'),(2, 'ghi'),(3, 'jkl'),(4, 'mno'),(5, 'pqr'),(6, 'stu'),(7, 'vwx'); @@ -141,64 +104,26 @@ INSERT INTO tbl_a (pkey, words) VALUES (0, 'abc'),(1, 'def'),(2, 'ghi'),(3, 'jkl --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT pkey, words FROM tbl_a WHERE match(words) against('+ghi' in boolean mode); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_3 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_3_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_a ORDER BY pkey; --enable_ps2_protocol --echo @@ -206,27 +131,15 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/partition_fulltext_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test b/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test index 0d7f4ab987e..9c4b6ec2014 100644 --- a/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test +++ b/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test @@ -1,9 +1,4 @@ --source ../include/partition_join_pushdown_for_single_partition_init.inc -if (!$HAVE_PARTITION) -{ - --source ../include/partition_join_pushdown_for_single_partition_deinit.inc - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -12,122 +7,88 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; --connection child2_3 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_DROP_TABLES2; echo CHILD2_1_CREATE_TABLES; echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +value int NOT NULL, +PRIMARY KEY(value) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE tbl_b ( +value2 int NOT NULL, +PRIMARY KEY(value2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_DROP_TABLES; echo CHILD2_2_DROP_TABLES2; echo CHILD2_2_CREATE_TABLES; echo CHILD2_2_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; - eval $CHILD2_2_DROP_TABLES2; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - eval $CHILD2_2_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +value int NOT NULL, +PRIMARY KEY(value) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE tbl_b ( +value2 int NOT NULL, +PRIMARY KEY(value2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_3_DROP_TABLES; echo CHILD2_3_DROP_TABLES2; echo CHILD2_3_CREATE_TABLES; echo CHILD2_3_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; - eval $CHILD2_3_DROP_TABLES2; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - eval $CHILD2_3_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +value int NOT NULL, +PRIMARY KEY(value) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE tbl_b ( +value2 int NOT NULL, +PRIMARY KEY(value2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -138,18 +99,28 @@ echo CREATE TABLE tbl_a ( value int NOT NULL, PRIMARY KEY(value) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( value int NOT NULL, PRIMARY KEY(value) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' + PARTITION BY RANGE(value) ( +PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1"', +PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_2"', +PARTITION pt3 VALUES LESS THAN (15) COMMENT='srv "s_2_3"' + ); echo CREATE TABLE tbl_b ( value2 int NOT NULL, PRIMARY KEY(value2) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_b ( +CREATE TABLE tbl_b ( value2 int NOT NULL, PRIMARY KEY(value2) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b"' + PARTITION BY RANGE(value2) ( +PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1"', +PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_2"', +PARTITION pt3 VALUES LESS THAN (15) COMMENT='srv "s_2_3"' + ); --enable_query_log --disable_ps_protocol @@ -161,43 +132,21 @@ insert into tbl_b values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); --disable_ps2_protocol SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = b.value2 AND a.value = 5; SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = 5 and b.value2 = 5; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT value FROM tbl_a ORDER BY value; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; +SELECT value FROM tbl_a ORDER BY value; --connection child2_3 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_3_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT value FROM tbl_a ORDER BY value; --enable_ps2_protocol --echo @@ -205,27 +154,15 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/partition_join_pushdown_for_single_partition_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/partition_mrr.test b/storage/spider/mysql-test/spider/t/partition_mrr.test index 842505fe870..943b14491fe 100644 --- a/storage/spider/mysql-test/spider/t/partition_mrr.test +++ b/storage/spider/mysql-test/spider/t/partition_mrr.test @@ -1,10 +1,5 @@ --source include/no_protocol.inc --source ../include/partition_mrr_init.inc -if (!$HAVE_PARTITION) -{ - --source ../include/partition_mrr_deinit.inc - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -13,110 +8,82 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; --connection child2_3 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLES; echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a ; +DROP TABLE IF EXISTS tbl_b; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_DROP_TABLES; echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a ; +DROP TABLE IF EXISTS tbl_b; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_3_DROP_TABLES; echo CHILD2_3_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_3_DROP_TABLES; +DROP TABLE IF EXISTS tbl_a ; +DROP TABLE IF EXISTS tbl_b; --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -131,14 +98,24 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", bka_mode "1"' + PARTITION BY KEY(pkey) ( +PARTITION pt1 COMMENT='srv "s_2_1"', +PARTITION pt2 COMMENT='srv "s_2_2"', +PARTITION pt3 COMMENT='srv "s_2_3"' + ); +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", bka_mode "1"' + PARTITION BY KEY(pkey) ( +PARTITION pt1 COMMENT='srv "s_2_2"', +PARTITION pt2 COMMENT='srv "s_2_3"', +PARTITION pt3 COMMENT='srv "s_2_1"' + ); --enable_query_log INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); @@ -149,63 +126,32 @@ INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29 --echo --echo select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --sorted_result SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey+0 = b.pkey+0 ORDER BY a.pkey; # MDEV-29947 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey+0 = b.pkey+0 ORDER BY a.pkey; +# MDEV-29947 --connection child2_1 - if ($USE_GENERAL_LOG) - { --replace_regex /tmp_spider_bka_(0x)?[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; +eval +SELECT pkey FROM tbl_a ORDER BY pkey $STR_SEMICOLON +SELECT pkey FROM tbl_b ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --replace_regex /tmp_spider_bka_(0x)?[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; +eval +SELECT pkey FROM tbl_a ORDER BY pkey $STR_SEMICOLON +SELECT pkey FROM tbl_b ORDER BY pkey; --connection child2_3 - if ($USE_GENERAL_LOG) - { --replace_regex /tmp_spider_bka_(0x)?[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_3_SELECT_ARGUMENT1; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; +eval +SELECT pkey FROM tbl_a ORDER BY pkey $STR_SEMICOLON +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo @@ -213,27 +159,15 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_3 DROP DATABASE IF EXISTS auto_test_remote3; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/partition_mrr_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/pushdown_not_like.test b/storage/spider/mysql-test/spider/t/pushdown_not_like.test index 7a7154069ca..06d0d2fdfc9 100644 --- a/storage/spider/mysql-test/spider/t/pushdown_not_like.test +++ b/storage/spider/mysql-test/spider/t/pushdown_not_like.test @@ -12,52 +12,33 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo create table select test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; SET @old_log_output = @@global.log_output; TRUNCATE TABLE mysql.general_log; set global log_output = 'TABLE'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings @@ -70,12 +51,15 @@ echo CREATE TABLE ta_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l (a, b, c) VALUES @@ -86,40 +70,22 @@ INSERT INTO ta_l (a, b, c) VALUES --echo --echo spider not like bug fix test -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol select * from ta_l where b not like 'a%'; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select%'; --enable_view_protocol - } -} --enable_ps2_protocol --echo @@ -127,13 +93,9 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; SET GLOBAL log_output = @old_log_output; -} - --disable_query_log --disable_result_log diff --git a/storage/spider/mysql-test/spider/t/quick_mode_0.test b/storage/spider/mysql-test/spider/t/quick_mode_0.test index 33cd271b989..93420043a9d 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_0.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_0.test @@ -5,72 +5,38 @@ --disable_warnings CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_CREATE_TABLES; - } - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_CREATE_TABLES; - } - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE tbl_a ( @@ -81,14 +47,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -103,188 +69,74 @@ INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29 --echo --echo select test 1 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_view_protocol --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; - } - eval $CHILD2_1_SELECT_TABLES; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --enable_view_protocol @@ -293,21 +145,12 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/quick_mode_0_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/quick_mode_1.test b/storage/spider/mysql-test/spider/t/quick_mode_1.test index 73241457418..f63dd6d7cd2 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_1.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_1.test @@ -5,72 +5,38 @@ --disable_warnings CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_CREATE_TABLES; - } - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_CREATE_TABLES; - } - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE tbl_a ( @@ -81,14 +47,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -103,191 +69,77 @@ INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29 --echo --echo select test 1 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo @@ -295,21 +147,12 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/quick_mode_1_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/quick_mode_2.test b/storage/spider/mysql-test/spider/t/quick_mode_2.test index 2a54b0be3fe..b2bb57cedea 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_2.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_2.test @@ -5,72 +5,38 @@ --disable_warnings CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_CREATE_TABLES; - } - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_CREATE_TABLES; - } - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE tbl_a ( @@ -81,14 +47,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -103,191 +69,77 @@ INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29 --echo --echo select test 1 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo @@ -295,21 +147,12 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/quick_mode_2_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/quick_mode_3.test b/storage/spider/mysql-test/spider/t/quick_mode_3.test index 67f0230a34f..041507f9aa2 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_3.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_3.test @@ -5,72 +5,38 @@ --disable_warnings CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote; USE auto_test_remote; --connection child2_2 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_CREATE_TABLES; - } - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_2_CREATE_TABLES; - } - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE tbl_a ( @@ -81,14 +47,14 @@ echo CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_b ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +CREATE TABLE tbl_b ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_b", srv "s_2_2"'; --enable_query_log --disable_ps_protocol INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -103,191 +69,77 @@ INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29 --echo --echo select test 1 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; +set session spider_quick_page_byte= 6; --echo --echo select test 2 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --connection master_1 -eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; +set session spider_quick_page_byte= 0; --echo --echo select test 3 -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; --connection child2_2 - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ - eval $CHILD2_2_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT pkey FROM tbl_b ORDER BY pkey; --enable_ps2_protocol --echo @@ -295,21 +147,12 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/quick_mode_3_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/slave_test_deinit.inc b/storage/spider/mysql-test/spider/t/slave_test_deinit.inc index e9d99b7a960..4bbc7ec420d 100644 --- a/storage/spider/mysql-test/spider/t/slave_test_deinit.inc +++ b/storage/spider/mysql-test/spider/t/slave_test_deinit.inc @@ -2,5 +2,4 @@ --echo for slave1_1 --connection slave1_1 STOP SLAVE; ---source ../include/deinit_slave1_1.inc --disconnect slave1_1 diff --git a/storage/spider/mysql-test/spider/t/slave_test_init.inc b/storage/spider/mysql-test/spider/t/slave_test_init.inc index 4f7a6bbae20..a479c4cd40a 100644 --- a/storage/spider/mysql-test/spider/t/slave_test_init.inc +++ b/storage/spider/mysql-test/spider/t/slave_test_init.inc @@ -7,7 +7,6 @@ SET SESSION sql_log_bin= 0; --let $TEST_ENGINE_TYPE= $SLAVE1_1_ENGINE_TYPE --source have_partition.inc --source have_trigger.inc ---source ../include/init_slave1_1.inc --source have_engine.inc --let $SLAVE1_1_SLAVE_STATUS=`SHOW SLAVE STATUS` if (!$SLAVE1_1_SLAVE_STATUS) diff --git a/storage/spider/mysql-test/spider/t/slave_trx_isolation.test b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test index b88d038de46..fa14db7e0f1 100644 --- a/storage/spider/mysql-test/spider/t/slave_trx_isolation.test +++ b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test @@ -5,76 +5,43 @@ --disable_warnings CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --enable_warnings --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_CREATE_TABLES; - } - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; --connection master_1 SET SESSION sql_log_bin= 0; -} --disable_query_log echo CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log -if ($USE_REPLICATION) -{ SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_query_log @@ -82,71 +49,39 @@ if ($USE_REPLICATION) pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; - eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; --enable_query_log --connection master_1 -} INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; --connection master_1 SET SESSION sql_log_bin= 0; -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 --disable_ps2_protocol - if ($USE_GENERAL_LOG) - { --disable_view_protocol --replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/ - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %'; --enable_view_protocol - } --enable_ps2_protocol - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} -if ($USE_REPLICATION) -{ +SELECT pkey FROM tbl_a ORDER BY pkey; --connection slave1_1 SELECT pkey FROM tbl_a ORDER BY pkey; -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source ../include/slave_trx_isolation_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/spider3_fixes.test b/storage/spider/mysql-test/spider/t/spider3_fixes.test index 0d46802f1cf..aea7ddd0285 100644 --- a/storage/spider/mysql-test/spider/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/t/spider3_fixes.test @@ -14,15 +14,10 @@ source include/have_log_bin.inc; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,74 +26,40 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} - --echo --echo 3.1 --echo auto_increment -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -106,7 +67,6 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} --disable_warnings DROP TABLE IF EXISTS t1, t2; --enable_warnings @@ -121,20 +81,26 @@ echo CREATE TABLE t2 ( ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1; -eval CREATE TABLE t2 ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "0", tbl "t1_1", srv "s_2_1"'; +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "0", tbl "t1_1", srv "s_2_1"'; --disable_ps_protocol -eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; -eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol -if ($USE_REPLICATION) -{ SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -148,16 +114,15 @@ if ($USE_REPLICATION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1; - eval CREATE TABLE t2 ( +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT ''; +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT ''; --connection master_1 -} --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -171,28 +136,28 @@ SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; -eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; -eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; -eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); SELECT id FROM t1 ORDER BY id; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; -eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); @@ -208,14 +173,14 @@ SELECT id FROM t2 ORDER BY id; SET INSERT_ID=5000; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; -eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; -eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (); SELECT LAST_INSERT_ID(); @@ -226,8 +191,6 @@ SELECT MAX(id) FROM t1; INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -236,39 +199,15 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } -} - --echo # --echo # MDEV-28225 Disallow user to create Spider temporary table @@ -285,18 +224,12 @@ CREATE TEMPORARY TABLE t1 ( --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source slave_test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/t/spider3_fixes_part.test index 6f43274fc40..7c7360d4fff 100644 --- a/storage/spider/mysql-test/spider/t/spider3_fixes_part.test +++ b/storage/spider/mysql-test/spider/t/spider3_fixes_part.test @@ -7,17 +7,6 @@ source include/have_log_bin.inc; --source slave_test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -25,15 +14,10 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -42,97 +26,49 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} - --echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_2; --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 3; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - if ($USE_REPLICATION) - { save_master_pos; --connection slave1_1 sync_with_master; @@ -140,7 +76,6 @@ if ($HAVE_PARTITION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } --disable_warnings DROP TABLE IF EXISTS t1, t2; --enable_warnings @@ -155,20 +90,38 @@ if ($HAVE_PARTITION) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t2 ( +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "0"' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='tbl "t1_1", srv "s_2_1"', +PARTITION pt2 VALUES IN (1) +COMMENT='tbl "t1_2", srv "s_2_2"' + ); +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "0"' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='tbl "t1_1", srv "s_2_1"', +PARTITION pt2 VALUES IN (1) +COMMENT='tbl "t1_2", srv "s_2_2"' + ); --disable_ps_protocol - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol - if ($USE_REPLICATION) - { SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -182,16 +135,27 @@ if ($HAVE_PARTITION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t2 ( +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT '' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='', +PARTITION pt2 VALUES IN (1) +COMMENT='' + ); +CREATE TABLE t2 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT '' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='', +PARTITION pt2 VALUES IN (1) +COMMENT='' + ); --connection master_1 - } --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -205,28 +169,28 @@ if ($HAVE_PARTITION) SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; - eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; - eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 (id) VALUES (null); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; - eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); SELECT id FROM t1 ORDER BY id; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; - eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); @@ -242,14 +206,14 @@ if ($HAVE_PARTITION) SET INSERT_ID=5000; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET3; - eval $MASTER_1_AUTO_INCREMENT_OFFSET3; +SET SESSION AUTO_INCREMENT_OFFSET = 1; --enable_query_log INSERT INTO t1 () VALUES (); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; --disable_query_log echo MASTER_1_AUTO_INCREMENT_OFFSET4; - eval $MASTER_1_AUTO_INCREMENT_OFFSET4; +SET SESSION AUTO_INCREMENT_OFFSET = 777; --enable_query_log INSERT INTO t2 () VALUES (); SELECT LAST_INSERT_ID(); @@ -260,8 +224,6 @@ if ($HAVE_PARTITION) INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; - if ($USE_REPLICATION) - { save_master_pos; --connection slave1_1 sync_with_master; @@ -270,76 +232,32 @@ if ($HAVE_PARTITION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_2 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source slave_test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/spider_fixes.test b/storage/spider/mysql-test/spider/t/spider_fixes.test index 326e176743c..7843f65661f 100644 --- a/storage/spider/mysql-test/spider/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/t/spider_fixes.test @@ -14,15 +14,10 @@ source include/have_log_bin.inc; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -31,65 +26,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tb_l; @@ -101,12 +70,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -121,12 +90,15 @@ DROP TABLE IF EXISTS ta_l; echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l SELECT a, b, c FROM tb_l; @@ -135,133 +107,61 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l; --echo --echo 2.13 --echo select table with "order by desc" and "<" -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a < 5 ORDER BY a DESC LIMIT 3; --enable_ps2_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo select table with "order by desc" and "<=" -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps2_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a <= 5 ORDER BY a DESC LIMIT 3; --enable_ps2_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.14 --echo update table with range scan and split_read -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l SET c = '2000-02-02 00:00:00' WHERE a > 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; @@ -272,30 +172,19 @@ TRUNCATE TABLE ta_l; --disable_warnings DROP TABLE IF EXISTS ta_l; --enable_warnings -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES6; - echo CHILD2_1_CREATE_TABLES6; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES6; +DROP TABLE IF EXISTS ta_r_3; --enable_warnings - eval $CHILD2_1_CREATE_TABLES6; +CREATE TABLE ta_r_3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l ( @@ -304,326 +193,162 @@ echo CREATE TABLE ta_l ( c datetime DEFAULT NULL, PRIMARY KEY (a, b, c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a int(11) NOT NULL DEFAULT '0', b char(1) DEFAULT NULL, c datetime DEFAULT NULL, PRIMARY KEY (a, b, c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT5_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_3"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l SELECT a, b, c FROM tb_l; --enable_ps_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a >= 4 AND b = 'd' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a > 4 AND b = 'c' AND c = '2001-12-31 23:59:59'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b <= 'd' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b < 'e' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND b = 'b' AND c = '2000-01-01 00:00:00'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND b = 'b' AND c = '2000-01-01 00:00:00'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b' AND b <= 'd' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b' AND b < 'e' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND a >= 1 AND b >= 'b' AND c = '2003-11-30 05:01:03'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND a > 1 AND b >= 'b' AND c = '2000-01-01 00:00:00'; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.16 --echo auto_increment insert with trigger -if ($HAVE_TRIGGER) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES4; - echo CHILD2_1_CREATE_TABLES4; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES4; +DROP TABLE IF EXISTS ta_r_auto_inc; --enable_warnings - eval $CHILD2_1_CREATE_TABLES4; +CREATE TABLE ta_r_auto_inc ( +a INT AUTO_INCREMENT, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l_auto_inc ( @@ -632,141 +357,89 @@ if ($HAVE_TRIGGER) c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; - eval CREATE TABLE ta_l_auto_inc ( +eval +CREATE TABLE ta_l_auto_inc ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_auto_inc"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; echo CREATE TABLE tc_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; - eval CREATE TABLE tc_l ( +CREATE TABLE tc_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log --eval CREATE TRIGGER ins_ta_l_auto_inc AFTER INSERT ON ta_l_auto_inc FOR EACH ROW BEGIN INSERT INTO tc_l (a, b, c) VALUES (NEW.a, NEW.b, NEW.c); END; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 --disable_ps_protocol INSERT INTO ta_l_auto_inc (a, b, c) VALUES (NULL, 's', '2008-12-31 20:59:59'); --enable_ps_protocol - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES4; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r_auto_inc +ORDER BY a; --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM tc_l ORDER BY a; -} --echo --echo 2.17 --echo engine-condition-pushdown with "or" and joining -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a = 1 OR a IN (SELECT a FROM tb_l); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.23 --echo index merge -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -777,14 +450,17 @@ echo CREATE TABLE ta_l_int ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); @@ -793,45 +469,21 @@ INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo 2.24 @@ -848,80 +500,37 @@ echo CREATE TABLE ta_l_int ( KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -if ($MASTER_1_NEEDPK) -{ - --error ER_REQUIRES_PRIMARY_KEY - eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT NOT NULL, b INT DEFAULT 10, c INT DEFAULT 11, KEY idx1(b), KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; - eval CREATE TABLE ta_l_int ( - a INT NOT NULL, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; -} -if (!$MASTER_1_NEEDPK) -{ - eval CREATE TABLE ta_l_int ( - a INT NOT NULL, - b INT DEFAULT 10, - c INT DEFAULT 11, - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; -} +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol SELECT a, b, c FROM ta_l_int ORDER BY a; --enable_ps_protocol INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 UPDATE ta_l_int SET c = 4 WHERE b = 2; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 SELECT a, b, c FROM ta_l_int ORDER BY a; @@ -930,75 +539,47 @@ SELECT a, b, c FROM ta_l_int ORDER BY a; --echo 2.25 --echo direct order limit --connection master_1 -eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS; +SHOW STATUS LIKE 'Spider_direct_order_limit'; --disable_ps2_protocol SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3; --enable_ps2_protocol -eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS; - +SHOW STATUS LIKE 'Spider_direct_order_limit'; --echo --echo 2.26 --echo lock tables -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_LOCK_TABLES1; - echo CHILD2_1_DROP_LOCK_TABLES2; - echo CHILD2_1_CREATE_LOCK_TABLES1; - echo CHILD2_1_CREATE_LOCK_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_LOCK_TABLES1; - eval $CHILD2_1_DROP_LOCK_TABLES2; +DROP TABLE IF EXISTS t1_1; +DROP TABLE IF EXISTS t2_2; --enable_warnings - eval $CHILD2_1_CREATE_LOCK_TABLES1; - eval $CHILD2_1_CREATE_LOCK_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE t2_2 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_LOCK_TABLES1; - echo CHILD2_2_DROP_LOCK_TABLES2; - echo CHILD2_2_CREATE_LOCK_TABLES1; - echo CHILD2_2_CREATE_LOCK_TABLES2; - } --disable_warnings - eval $CHILD2_2_DROP_LOCK_TABLES1; - eval $CHILD2_2_DROP_LOCK_TABLES2; +DROP TABLE IF EXISTS t1_2; +DROP TABLE IF EXISTS t2_1; --enable_warnings - eval $CHILD2_2_CREATE_LOCK_TABLES1; - eval $CHILD2_2_CREATE_LOCK_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_2 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE t2_1 ( +id int(11) NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1009,18 +590,18 @@ echo CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK1; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_LOCK1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'tbl "t1_1 t1_2", srv "s_2_1 s_2_2"'; echo CREATE TABLE t2 ( id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_LOCK2; -eval CREATE TABLE t2 ( +CREATE TABLE t2 ( id int(11) NOT NULL, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_LOCK2; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'tbl "t2_1 t2_2", srv "s_2_2 s_2_1"'; --enable_query_log LOCK TABLES t1 READ, t2 READ; UNLOCK TABLES; @@ -1028,45 +609,22 @@ UNLOCK TABLES; --echo --echo auto_increment -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -1074,7 +632,6 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1085,16 +642,22 @@ echo CREATE TABLE t1 ( ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "0", tbl "t1_1", srv "s_2_1"'; --disable_ps_protocol -eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; -eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol -if ($USE_REPLICATION) -{ SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -1104,12 +667,11 @@ if ($USE_REPLICATION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT ''; --connection master_1 -} --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -1140,8 +702,6 @@ SELECT MAX(id) FROM t1; INSERT INTO t1 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; -if ($USE_REPLICATION) -{ save_master_pos; --connection slave1_1 sync_with_master; @@ -1150,47 +710,21 @@ if ($USE_REPLICATION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } -} - --echo --echo read only let $MASTER_1_ENGINE_IS_SPIDER= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR '$MASTER_1_HIDDEN_ENGINE_TYPE' = 'Spider', 1, 0)`; -if ($MASTER_1_ENGINE_IS_SPIDER) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1200,10 +734,10 @@ if ($MASTER_1_ENGINE_IS_SPIDER) id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_READONLY1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'read_only_mode "1", tbl "t1_1", srv "s_2_1"'; --let $MIN_VAL= `SELECT MIN(id) FROM t1` --enable_query_log --disable_ps_protocol @@ -1212,25 +746,17 @@ if ($MASTER_1_ENGINE_IS_SPIDER) --error 12518 INSERT INTO t1 (id) VALUES (1); --error 12518 - eval UPDATE t1 SET id = 4 WHERE id = $MIN_VAL; +UPDATE t1 SET id = 4 WHERE id = 777; --error 12518 - eval DELETE FROM t1 WHERE id = $MIN_VAL; +DELETE FROM t1 WHERE id = 777; --error 12518 DELETE FROM t1; --error 12518 TRUNCATE t1; -} -if (!$MASTER_1_ENGINE_IS_SPIDER) -{ - --echo skipped -} - --echo --echo 2.27 --echo error mode -if ($MASTER_1_ENGINE_IS_SPIDER) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1240,10 +766,10 @@ if ($MASTER_1_ENGINE_IS_SPIDER) id int(11) NOT NULL, PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_ERROR_MODE1_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_ERROR_MODE1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'erm "1", ewm "1", tbl "ter1_1", srv "s_2_1"'; --enable_query_log --disable_ps_protocol SELECT id FROM t1 ORDER BY id; @@ -1251,39 +777,26 @@ if ($MASTER_1_ENGINE_IS_SPIDER) INSERT INTO t1 (id) VALUES (1); DELETE FROM t1; TRUNCATE t1; -} -if (!$MASTER_1_ENGINE_IS_SPIDER) -{ - --echo skipped -} - --echo --echo 3.0 --echo is null -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TEXT_KEY_TABLES1; - echo CHILD2_1_CREATE_TEXT_KEY_TABLES1; - } --disable_warnings - eval $CHILD2_1_DROP_TEXT_KEY_TABLES1; +DROP TABLE IF EXISTS t1; --enable_warnings - eval $CHILD2_1_CREATE_TEXT_KEY_TABLES1; +CREATE TABLE t1 ( +a VARCHAR(255), +b VARCHAR(255), +c VARCHAR(255), +KEY idx1(a,b), +KEY idx2(b), +PRIMARY KEY(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS t1; @@ -1297,14 +810,14 @@ echo CREATE TABLE t1 ( KEY idx2(b), PRIMARY KEY(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_TEXT_KEY1_1; -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( a VARCHAR(255), b VARCHAR(255), c VARCHAR(255), KEY idx1(a,b), KEY idx2(b), PRIMARY KEY(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_TEXT_KEY1_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'tbl "t1", srv "s_2_1"'; --enable_query_log --disable_ps_protocol insert into t1 values (null, null, '2048'); @@ -1321,49 +834,24 @@ insert into t1 select a + 128, b + 128, c + 128 from t1; insert into t1 select a + 256, b + 256, c + 256 from t1; insert into t1 select a + 512, b + 512, c + 512 from t1; flush tables; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol select a from t1 where a is null order by a limit 30; --enable_ps_protocol select b from t1 where b is null order by b limit 30; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TEXT_PK_TABLES1; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a FROM t1 ORDER BY a; --enable_query_log --enable_result_log - } -} - --echo --echo direct_order_limit @@ -1379,68 +867,36 @@ insert into t1 select a, b + 32, c + 32 from t1; insert into t1 select a, b + 64, c + 64 from t1; insert into t1 select a, b + 128, c + 128 from t1; flush tables; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5; --enable_ps_protocol select a, c from t1 where a = '10' order by b desc limit 5; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TEXT_PK_TABLES1; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a FROM t1 ORDER BY a; --enable_query_log --enable_result_log - } -} - --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} - # MDEV-27039 LOCK_global_system_variables attempted to re-acquire # The test proves no assert anymore. diff --git a/storage/spider/mysql-test/spider/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/t/spider_fixes_part.test index 6c0c8a7ed34..c09f29ea131 100644 --- a/storage/spider/mysql-test/spider/t/spider_fixes_part.test +++ b/storage/spider/mysql-test/spider/t/spider_fixes_part.test @@ -7,17 +7,6 @@ source include/have_log_bin.inc; --source slave_test_init.inc --enable_result_log --enable_query_log -if (!$HAVE_PARTITION) -{ - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - skip Test requires partitioning; -} --echo --echo drop and create databases @@ -25,15 +14,10 @@ if (!$HAVE_PARTITION) DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -42,30 +26,20 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings @@ -78,12 +52,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -95,59 +69,32 @@ INSERT INTO tb_l (a, b, c) VALUES --echo --echo 2.17 --echo partition with sort -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -156,105 +103,68 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; --enable_ps_protocol SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo --echo 2.23 --echo partition update with moving partition -if ($HAVE_PARTITION) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l2; --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l2 ( @@ -263,91 +173,74 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); --enable_ps_protocol UPDATE ta_l2 SET a = 4 WHERE a = 3; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%update %'; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo index merge with partition -if ($HAVE_PARTITION) -{ --connection master_1 --disable_warnings DROP TABLE IF EXISTS ta_l_int; --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_2_DROP_TABLES5; - echo CHILD2_2_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_2_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } - } --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -358,14 +251,20 @@ if ($HAVE_PARTITION) KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; - eval CREATE TABLE ta_l_int ( +CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "ta_r_int"' + PARTITION BY LIST(MOD(a, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='srv "s_2_1", priority "1000"', +PARTITION pt2 VALUES IN (1) +COMMENT='srv "s_2_2", priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); @@ -374,149 +273,65 @@ if ($HAVE_PARTITION) INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } -} - --echo --echo 2.26 --echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_1; --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 2; TRUNCATE TABLE mysql.general_log; - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; +DROP TABLE IF EXISTS t1_2; --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE t1_2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 4; +SET GLOBAL AUTO_INCREMENT_OFFSET = 3; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 - if ($USE_REPLICATION) - { save_master_pos; --source include/save_master_pos.inc --connection slave1_1 --let $rc= `select master_pos_wait('$_master_file', $_master_pos, 300, '')` - if (`select $rc is NULL OR $rc < 0`) - { - --vertical_results - show slave status; - --horizontal_results - show global status; - show global variables; - --let $MYSQLD_DATADIR= `select @@datadir` - --exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/mysqld-relay-bin.000001; - # Check that the relay-log file is fully on disk. - --exec ls -l $MYSQLD_DATADIR; - # After that try to restart the slave SQL thread - start slave sql_thread; - } sync_with_master; --connection master_1 --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -527,16 +342,28 @@ if ($HAVE_PARTITION) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; echo MASTER_1_AUTO_INCREMENT_INCREMENT2; echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT 'aim "0"' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='tbl "t1_1", srv "s_2_1"', +PARTITION pt2 VALUES IN (1) +COMMENT='tbl "t1_2", srv "s_2_2"' + ); --disable_ps_protocol - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; +SET SESSION AUTO_INCREMENT_INCREMENT = 777 ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') ; +SELECT spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"'); +SET SESSION AUTO_INCREMENT_OFFSET = 777 ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') ; +SELECT spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"'); --enable_ps_protocol - if ($USE_REPLICATION) - { SET SESSION sql_log_bin= 1; --connection slave1_1 --disable_warnings @@ -546,12 +373,17 @@ if ($HAVE_PARTITION) id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( +CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT '' + PARTITION BY LIST(MOD(id, 2)) ( +PARTITION pt1 VALUES IN (0) +COMMENT='', +PARTITION pt2 VALUES IN (1) +COMMENT='' + ); --connection master_1 - } --enable_query_log --disable_ps_protocol INSERT INTO t1 () VALUES (); @@ -580,8 +412,6 @@ if ($HAVE_PARTITION) INSERT INTO t1 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; - if ($USE_REPLICATION) - { save_master_pos; --connection slave1_1 sync_with_master; @@ -590,94 +420,41 @@ if ($HAVE_PARTITION) --disable_query_log SET SESSION sql_log_bin= 0; --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } +SELECT id FROM t1_1 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT id FROM t1_2 ORDER BY id; +SET GLOBAL AUTO_INCREMENT_INCREMENT = 1; +SET GLOBAL AUTO_INCREMENT_OFFSET = 1; --enable_query_log --enable_result_log - } - } -} --echo --echo Test ORDER BY with LIMIT and OFFSET -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES7; - echo CHILD2_1_CREATE_TABLES7; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES7; +DROP TABLE IF EXISTS ta_ob; --enable_warnings - eval $CHILD2_1_CREATE_TABLES7; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_ob ( +a VARCHAR(50) NOT NULL, +b VARCHAR(50) NULL DEFAULT NULL, +c VARCHAR(100) NULL DEFAULT NULL, +d DATETIME(0) NULL DEFAULT NULL, +e INT(11) NOT NULL, +f INT(10) NULL DEFAULT NULL, +PRIMARY KEY (a, e) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log --disable_warnings @@ -691,8 +468,10 @@ if ($HAVE_PARTITION) e INT(11) NOT NULL, f INT(10) NULL DEFAULT NULL, PRIMARY KEY (a, e) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT6_P_1_1; - eval CREATE TABLE ta_ob ( +) $MASTER_1_ENGINE COMMENT='database "auto_test_remote", table "ta_ob"' + PARTITION BY LIST COLUMNS (e) PARTITIONS 1 + (PARTITION pt1 values in (510411) COMMENT = 'srv "s_2_1"'); +CREATE TABLE ta_ob ( a VARCHAR(50) NOT NULL, b VARCHAR(50) NULL DEFAULT NULL, c VARCHAR(100) NULL DEFAULT NULL, @@ -700,7 +479,9 @@ if ($HAVE_PARTITION) e INT(11) NOT NULL, f INT(10) NULL DEFAULT NULL, PRIMARY KEY (a, e) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT6_P_1_1; +) ENGINE=Spider COMMENT='database "auto_test_remote", table "ta_ob"' + PARTITION BY LIST COLUMNS (e) PARTITIONS 1 +(PARTITION pt1 values in (510411) COMMENT = 'srv "s_2_1"'); --enable_query_log --disable_ps_protocol INSERT INTO ta_ob VALUES ('0B95CD65DF994BC9A09A6AABE53A2733', @@ -733,27 +514,13 @@ if ($HAVE_PARTITION) '51041110620310', '2018-08-02 13:48:28', 510411, 0); SELECT * FROM ta_ob WHERE c LIKE "%510411106%" AND e = 510411 AND f != 1 ORDER BY d,c LIMIT 5 OFFSET 1; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES7; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT * FROM ta_ob WHERE c LIKE "%510411106%" AND e = 510411 AND f != 1 ORDER BY d,c LIMIT 6 OFFSET 0; --enable_query_log --enable_result_log - } - } -} - --echo # --echo # MDEV-25985 Spider handle ">=" as ">" in some cases @@ -763,13 +530,13 @@ if ($HAVE_PARTITION) --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( a int, b int, c int, PRIMARY KEY (a), KEY (b,c) -) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES (1, 1, 1), (2, 2, 1); @@ -777,13 +544,16 @@ INSERT INTO t1 VALUES (1, 1, 1), (2, 2, 1); --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings -eval CREATE TABLE t1 ( +CREATE TABLE t1 ( a int, b int, c int, PRIMARY KEY (a), KEY (b,c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_MDEV_25985; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "t1"' + PARTITION BY LIST COLUMNS(`a`) ( +PARTITION `pt1` DEFAULT COMMENT = 'srv "s_2_1"' + ); --connection master_1 --disable_ps_protocol @@ -795,59 +565,32 @@ SELECT * FROM t1 WHERE c < 3 AND b <= 2; --echo Crash from b4a2baffa82e5c07b96a1c752228560dcac1359b (MDEV-11084) --echo Fixed with 4968049799193394d442f26b4e3a8d95b185be72 --echo Spider crashed if the first partition was not used first -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_2_DROP_TABLES; +DROP TABLE IF EXISTS ta_r3; --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r3 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES2; +DROP TABLE IF EXISTS ta_r2; --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r2 ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } - } --connection master_1 --disable_query_log --disable_warnings @@ -859,12 +602,18 @@ if ($HAVE_PARTITION) c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( +CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; +) ENGINE=Spider COMMENT='table "ta_r3"' + PARTITION BY RANGE(a) ( +PARTITION pt1 VALUES LESS THAN (4) COMMENT='srv "s_2_1", + table "ta_r2", priority "1000"', +PARTITION pt2 VALUES LESS THAN MAXVALUE +COMMENT='srv "s_2_2", priority "1000001"' + ); --enable_query_log --disable_ps_protocol INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; @@ -876,50 +625,28 @@ if ($HAVE_PARTITION) --echo Query a Spider table by all paritions, then the second partition SELECT min(a), max(a), min(b), max(b) FROM ta_l2; SELECT a,b,c FROM ta_l2 PARTITION (pt2); - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_2 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r3 ORDER BY a; --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r2 ORDER BY a; --enable_query_log --enable_result_log - } - } -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_REPLICATION) -{ --connection slave1_1 DROP DATABASE IF EXISTS auto_test_local; -} -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source slave_test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/timestamp.test b/storage/spider/mysql-test/spider/t/timestamp.test index a7d6ce0ae05..7d800a48fdc 100644 --- a/storage/spider/mysql-test/spider/t/timestamp.test +++ b/storage/spider/mysql-test/spider/t/timestamp.test @@ -1,16 +1,15 @@ --source timestamp_init.inc +let $MASTER_1_COMMENT_2_1_F= + COMMENT='database "ts_test_remote", table "tbl_f", srv "s_2_1"'; --echo --echo Initialize Time Zone --connection master_1 SET GLOBAL time_zone='MET'; SET time_zone='MET'; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 SET GLOBAL time_zone='MET'; SET time_zone='MET'; -} --echo --echo drop and create databases @@ -19,78 +18,47 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS ts_test_local; CREATE DATABASE ts_test_local; USE ts_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 - if ($USE_GENERAL_LOG) - { SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; - } DROP DATABASE IF EXISTS ts_test_remote; CREATE DATABASE ts_test_remote; USE ts_test_remote; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --echo --echo create table -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { --disable_query_log echo CHILD2_1_DROP_TABLE; echo CHILD2_1_DROP_TABLE_F; echo CHILD2_1_CREATE_TABLE; echo CHILD2_1_CREATE_TABLE_F; - } --disable_warnings - eval $CHILD2_1_DROP_TABLE; - eval $CHILD2_1_DROP_TABLE_F; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_f; --enable_warnings - eval $CHILD2_1_CREATE_TABLE; - eval $CHILD2_1_CREATE_TABLE_F; - if ($OUTPUT_CHILD_GROUP2) - { +CREATE TABLE tbl_a ( +col_a INT UNSIGNED NOT NULL AUTO_INCREMENT, +col_dt DATETIME, +col_ts TIMESTAMP NOT NULL +DEFAULT current_timestamp() ON UPDATE current_timestamp(), +PRIMARY KEY(col_a), +UNIQUE INDEX i_ts (col_ts) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4; +CREATE TABLE tbl_f ( +col_d DATE, +col_t TIME +) ENGINE=InnoDB; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tbl_a; @@ -104,22 +72,22 @@ echo CREATE TABLE tbl_a ( PRIMARY KEY(col_a), UNIQUE INDEX i_ts (col_ts) ) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1; -eval CREATE TABLE tbl_a ( +CREATE TABLE tbl_a ( col_a INT UNSIGNED NOT NULL AUTO_INCREMENT, col_dt DATETIME, col_ts TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY(col_a), UNIQUE INDEX i_ts (col_ts) -) $MASTER_1_ENGINE $MASTER_1_AUTO_INCREMENT_2_1 $MASTER_1_COMMENT_2_1; +) ENGINE=Spider AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='database "ts_test_remote", table "tbl_a", srv "s_2_1"'; echo CREATE TABLE tbl_f ( col_d DATE, col_t TIME ) $MASTER_1_ENGINE $MASTER_1_COMMENT_2_1_F; -eval CREATE TABLE tbl_f ( +CREATE TABLE tbl_f ( col_d DATE, col_t TIME -) $MASTER_1_ENGINE $MASTER_1_COMMENT_2_1_F; +) ENGINE=Spider COMMENT='database "ts_test_remote", table "tbl_f", srv "s_2_1"'; --enable_query_log --disable_ps_protocol SHOW CREATE TABLE tbl_a; @@ -154,118 +122,38 @@ SET @@timestamp=0; --echo --echo SELECTs -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLE; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; --enable_ps2_protocol --echo --echo DELETEs -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 DELETE FROM tbl_a WHERE col_ts='1970-01-01 01:00:01'; --disable_ps2_protocol --disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLE; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; --enable_ps2_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 SET @@timestamp=1; INSERT INTO tbl_a VALUES (1, now(), now()); @@ -274,98 +162,34 @@ SET @@timestamp=0; --disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLE; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; --enable_ps2_protocol --echo --echo UPDATEs -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 UPDATE tbl_a SET col_ts=col_dt; --disable_ps2_protocol --disable_view_protocol SELECT *, unix_timestamp(col_ts) FROM tbl_a; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLE; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; --enable_ps2_protocol --echo --echo Lookups -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol @@ -377,55 +201,20 @@ SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts >= '2018-10-28 01:30:00 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 180325020000; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 19700101010001; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLE; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; --enable_ps2_protocol --echo --echo Drop the index on the timestamp column -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - eval $CHILD2_1_DROP_INDEX; - eval $CHILD2_1_SHOW_CREATE_TABLE; - if ($OUTPUT_CHILD_GROUP2) - { +DROP INDEX i_ts ON tbl_a; +SHOW CREATE TABLE tbl_a; --enable_query_log - } - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 DROP INDEX i_ts ON tbl_a; --disable_ps_protocol @@ -434,24 +223,8 @@ SHOW CREATE TABLE tbl_a; --echo --echo Retry lookups on unindexed timestamp column -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol @@ -463,27 +236,11 @@ SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts >= '2018-10-28 01:30:00 SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 180325020000; SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > 19700101010001; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLE; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; --enable_ps2_protocol --echo @@ -492,24 +249,8 @@ if ($USE_CHILD_GROUP2) INSERT INTO tbl_f VALUES ('2018-06-24', '01:23:45'), ('2018-06-24', '01:23:45'), ('2018-08-01', '12:34:56'); -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} --connection master_1 --disable_ps2_protocol --disable_view_protocol @@ -519,27 +260,11 @@ SELECT TIMESTAMP('2018-06-25', col_t) FROM tbl_f; SELECT TIMESTAMP(col_d, '10:43:21') FROM tbl_f; SELECT TIMESTAMP('2018-06-25', '10:43:21') FROM tbl_f; --enable_view_protocol -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { --disable_view_protocol - eval $CHILD2_1_SELECT_ARGUMENT1; +SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; --enable_view_protocol - } - eval $CHILD2_1_SELECT_TABLE_F; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } -} +SELECT col_d, col_t FROM tbl_f; --enable_ps2_protocol --echo @@ -547,27 +272,18 @@ if ($USE_CHILD_GROUP2) --connection master_1 SET GLOBAL time_zone=DEFAULT; SET time_zone=DEFAULT; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 SET GLOBAL time_zone=DEFAULT; SET time_zone=DEFAULT; -} --echo --echo deinit --disable_warnings --connection master_1 DROP DATABASE IF EXISTS ts_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS ts_test_remote; - if ($USE_GENERAL_LOG) - { SET GLOBAL log_output = @old_log_output; - } -} --enable_warnings --source timestamp_deinit.inc --echo diff --git a/storage/spider/mysql-test/spider/t/timestamp_deinit.inc b/storage/spider/mysql-test/spider/t/timestamp_deinit.inc index 52be67a1d09..ecb5622af14 100644 --- a/storage/spider/mysql-test/spider/t/timestamp_deinit.inc +++ b/storage/spider/mysql-test/spider/t/timestamp_deinit.inc @@ -1,9 +1,3 @@ ---let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP ---let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP ---let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP ---let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP ---let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP ---let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP --disable_warnings --disable_query_log --disable_result_log diff --git a/storage/spider/mysql-test/spider/t/timestamp_init.inc b/storage/spider/mysql-test/spider/t/timestamp_init.inc index 22587bcf65a..6cf6b0c1f41 100644 --- a/storage/spider/mysql-test/spider/t/timestamp_init.inc +++ b/storage/spider/mysql-test/spider/t/timestamp_init.inc @@ -5,58 +5,3 @@ --enable_result_log --enable_query_log --enable_warnings - ---let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 ---let $MASTER_1_COMMENT_2_1_F_BACKUP= $MASTER_1_COMMENT_2_1_F -let $MASTER_1_COMMENT_2_1= - COMMENT='database "ts_test_remote", table "tbl_a", srv "s_2_1"'; -let $MASTER_1_COMMENT_2_1_F= - COMMENT='database "ts_test_remote", table "tbl_f", srv "s_2_1"'; -let $MASTER_1_AUTO_INCREMENT_2_1= - AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4; -let $MASTER_1_AUTO_INCREMENT1= - AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4; -let $MASTER_1_AUTO_INCREMENT2= - AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4; -let $CHILD2_1_AUTO_INCREMENT= - AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4; ---let $CHILD2_1_DROP_TABLE_BACKUP= $CHILD2_1_DROP_TABLE ---let $CHILD2_1_DROP_TABLE_F_BACKUP= $CHILD2_1_DROP_TABLE_F -let $CHILD2_1_DROP_TABLE= - DROP TABLE IF EXISTS tbl_a; -let $CHILD2_1_DROP_TABLE_F= - DROP TABLE IF EXISTS tbl_f; ---let $CHILD2_1_CREATE_TABLE_BACKUP= $CHILD2_1_CREATE_TABLE ---let $CHILD2_1_CREATE_TABLE_F_BACKUP= $CHILD2_1_CREATE_TABLE_F -let $CHILD2_1_CREATE_TABLE= - CREATE TABLE tbl_a ( - col_a INT UNSIGNED NOT NULL AUTO_INCREMENT, - col_dt DATETIME, - col_ts TIMESTAMP NOT NULL - DEFAULT current_timestamp() ON UPDATE current_timestamp(), - PRIMARY KEY(col_a), - UNIQUE INDEX i_ts (col_ts) - ) $CHILD2_1_ENGINE $CHILD2_1_AUTO_INCREMENT; -let $CHILD2_1_CREATE_TABLE_F= - CREATE TABLE tbl_f ( - col_d DATE, - col_t TIME - ) $CHILD2_1_ENGINE; ---let $CHILD2_1_SELECT_TABLE_BACKUP= $CHILD2_1_SELECT_TABLE ---let $CHILD2_1_SELECT_TABLE_F_BACKUP= $CHILD2_1_SELECT_TABLE_F -let $CHILD2_1_SELECT_TABLE= - SELECT col_a, col_dt, col_ts, unix_timestamp(col_ts) FROM tbl_a ORDER BY col_a; -let $CHILD2_1_SELECT_TABLE_F= - SELECT col_d, col_t FROM tbl_f; -let $CHILD2_1_SELECT_ARGUMENT1= - SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; -let $CHILD2_1_DROP_INDEX= - DROP INDEX i_ts ON tbl_a; -let $CHILD2_1_SHOW_CREATE_TABLE= - SHOW CREATE TABLE tbl_a; -let $CHILD2_1_SHOW_CREATE_TABLE_F= - SHOW CREATE TABLE tbl_f; ---let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 ---let $OUTPUT_CHILD_GROUP2= 1 ---let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG ---let $USE_GENERAL_LOG= 1 diff --git a/storage/spider/mysql-test/spider/t/udf_pushdown.test b/storage/spider/mysql-test/spider/t/udf_pushdown.test index 2eadbbbb40b..6fdc8039275 100644 --- a/storage/spider/mysql-test/spider/t/udf_pushdown.test +++ b/storage/spider/mysql-test/spider/t/udf_pushdown.test @@ -44,29 +44,34 @@ TRUNCATE TABLE mysql.general_log; --connection master_1 CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 CREATE DATABASE auto_test_remote; USE auto_test_remote; -} --echo --echo ##### create tables ##### -if ($USE_CHILD_GROUP2) -{ --connection child2_1 --disable_query_log echo CHILD_CREATE_TABLE; - eval $CHILD_CREATE_TABLE; +CREATE TABLE ta_r ( +id INT NOT NULL, +a INT, +PRIMARY KEY(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log -} --connection master_1 --disable_query_log echo MASTER_CREATE_TABLE; echo $MASTER_CREATE_TABLE_OUTPUT; -eval $MASTER_CREATE_TABLE; +eval +CREATE TABLE ta_l ( +id INT NOT NULL, +a INT, +PRIMARY KEY(id) +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log INSERT INTO ta_l VALUES @@ -123,14 +128,11 @@ SET @@spider_use_pushdown_udf = 1; --connection master_1 DROP FUNCTION `plusone`; DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 SET @@global.general_log = @general_log_backup; SET @@global.log_output = @log_output_backup; DROP FUNCTION `plusone`; DROP DATABASE IF EXISTS auto_test_remote; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/mysql-test/spider/t/vp_fixes.test b/storage/spider/mysql-test/spider/t/vp_fixes.test index 2061cf253ba..3442d5a0877 100644 --- a/storage/spider/mysql-test/spider/t/vp_fixes.test +++ b/storage/spider/mysql-test/spider/t/vp_fixes.test @@ -12,8 +12,6 @@ DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; @@ -22,65 +20,39 @@ if ($USE_CHILD_GROUP2) DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; -} --enable_warnings --echo --echo test select 1 --connection master_1 SELECT 1; -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 SELECT 1; --connection child2_2 SELECT 1; - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --echo --echo create table and insert -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_CREATE_TABLES; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES; +DROP TABLE IF EXISTS ta_r; --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { +CREATE TABLE ta_r ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --disable_warnings DROP TABLE IF EXISTS tb_l; @@ -92,12 +64,12 @@ echo CREATE TABLE tb_l ( c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2; -eval CREATE TABLE tb_l ( +CREATE TABLE tb_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; --enable_query_log INSERT INTO tb_l (a, b, c) VALUES (1, 'a', '2008-08-01 10:21:39'), @@ -112,12 +84,15 @@ DROP TABLE IF EXISTS ta_l; echo CREATE TABLE ta_l ( PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; -eval CREATE TABLE ta_l ( +eval +CREATE TABLE ta_l ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log --disable_ps_protocol INSERT INTO ta_l SELECT a, b, c FROM tb_l; @@ -126,29 +101,22 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l; --echo --echo 0.9 --echo create different primary key table -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -157,67 +125,38 @@ echo CREATE TABLE ta_l_int ( c INT DEFAULT 11, PRIMARY KEY(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT DEFAULT 10, b INT AUTO_INCREMENT, c INT DEFAULT 11, PRIMARY KEY(b) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { --enable_query_log --enable_result_log - } -} --connection master_1 --let $MASTER_1_IS_VP= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'VP', 1, 0)` --disable_ps_protocol -if ($MASTER_1_IS_VP) -{ - --error 14514 - INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); -} -if (!$MASTER_1_IS_VP) -{ INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); --disable_query_log --disable_result_log TRUNCATE TABLE ta_l_int; --enable_query_log --enable_result_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES5; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, c FROM ta_r_int ORDER BY a; --enable_query_log --enable_result_log - } -} --enable_ps_protocol --echo create un-correspond primary key table @@ -225,29 +164,22 @@ if ($USE_CHILD_GROUP2) --disable_warnings DROP TABLE IF EXISTS ta_l_int; --enable_warnings -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_result_log - } --disable_query_log --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } --disable_warnings - eval $CHILD2_1_DROP_TABLES5; +DROP TABLE IF EXISTS ta_r_int; --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; +CREATE TABLE ta_r_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { --enable_result_log - } -} --connection master_1 --disable_query_log echo CREATE TABLE ta_l_int ( @@ -256,67 +188,38 @@ echo CREATE TABLE ta_l_int ( c INT DEFAULT 11, PRIMARY KEY(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1; -eval CREATE TABLE ta_l_int ( +eval +CREATE TABLE ta_l_int ( a INT DEFAULT 10, b INT DEFAULT 12, c INT DEFAULT 11, PRIMARY KEY(c) -) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT4_2_1; +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='database "auto_test_remote", table "ta_r_int"' + CONNECTION='host "localhost", socket "$CHILD2_1_MYSOCK", user "root", + password ""'; --enable_query_log -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { TRUNCATE TABLE mysql.general_log; - } - eval $CHILD2_1_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; --enable_query_log --enable_result_log - } -} --connection master_1 --disable_ps_protocol -if ($MASTER_1_IS_VP) -{ - --error 14514 - INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); -} -if (!$MASTER_1_IS_VP) -{ INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); --disable_query_log --disable_result_log TRUNCATE TABLE ta_l_int; --enable_query_log --enable_result_log -} -if ($USE_CHILD_GROUP2) -{ - if (!$OUTPUT_CHILD_GROUP2) - { --disable_query_log --disable_result_log - } --connection child2_1 - if ($USE_GENERAL_LOG) - { SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES5; - if (!$OUTPUT_CHILD_GROUP2) - { +SELECT a, b, c FROM ta_r_int ORDER BY a; --enable_query_log --enable_result_log - } -} --enable_ps_protocol --echo @@ -324,13 +227,10 @@ if ($USE_CHILD_GROUP2) --disable_warnings --connection master_1 DROP DATABASE IF EXISTS auto_test_local; -if ($USE_CHILD_GROUP2) -{ --connection child2_1 DROP DATABASE IF EXISTS auto_test_remote; --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; -} --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index 9dd56ac0ea6..5ac4ba408fd 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -2885,21 +2885,15 @@ int spider_commit( { if (trx->trx_xa) { - if (trx->internal_xa && !trx->trx_xa_prepared) + if ((trx->internal_xa || thd->lex->xa_opt == XA_ONE_PHASE) && + !trx->trx_xa_prepared) { if ( (error_num = spider_internal_xa_prepare( thd, trx, table_xa, table_xa_member, TRUE)) ) { -/* - if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) - { -*/ /* rollback for semi_trx */ spider_rollback(thd, all); -/* - } -*/ DBUG_RETURN(error_num); } trx->trx_xa_prepared = TRUE; diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index 3e779d9a842..f1c87b2a700 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -51,10 +51,6 @@ Group=mysql # These are enabled by default AmbientCapabilities=CAP_IPC_LOCK -# PrivateDevices=true implies NoNewPrivileges=true and -# SUID auth_pam_tool suddenly doesn't do setuid anymore -PrivateDevices=false - # Prevent writes to /usr, /boot, and /etc ProtectSystem=full diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index 01859763eb0..3fd37c38862 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -181,10 +181,6 @@ PrivateNetwork=false # These are enabled by default AmbientCapabilities=CAP_IPC_LOCK -# PrivateDevices=true implies NoNewPrivileges=true and -# SUID auth_pam_tool suddenly doesn't do setuid anymore -PrivateDevices=false - # Prevent writes to /usr, /boot, and /etc ProtectSystem=full