diff options
169 files changed, 3384 insertions, 4769 deletions
diff --git a/.travis.yml b/.travis.yml index d7657509297..454bd351627 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,13 +40,15 @@ matrix: include: - os: linux compiler: gcc + # disable cache - was out of disk space + cache: false script: - ${CC} --version ; ${CXX} --version - source .travis.compiler.sh # https://github.com/travis-ci/travis-ci/issues/7062 - /run/shm isn't writable or executable # in trusty containers - export MTR_MEM=/tmp - - env DEB_BUILD_OPTIONS="parallel=6" debian/autobake-deb.sh; + - env DEB_BUILD_OPTIONS="parallel=6" MYSQL_BUILD_PATH=/usr/local/bin:/usr/bin:/bin debian/autobake-deb.sh; - ccache --show-stats # Until OSX becomes a bit more stable: MDEV-12435 allow_failures: @@ -62,13 +64,6 @@ matrix: - os: osx compiler: clang env: GCC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,percona,perfschema,plugins,multi_source,roles - # MDEV-13002 plugins.server_audit and plugins.thread_pool_server_audit test fail due to mysqltest error - - os: linux - compiler: gcc - env: GCC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,percona,perfschema,plugins,multi_source,roles - - os: linux - compiler: clang - env: GCC_VERSION=6 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,percona,perfschema,plugins,multi_source,roles # Matrix include for coverity # - env: @@ -151,6 +146,7 @@ addons: - libdistro-info-perl - uuid-dev - devscripts # implicit for any build on Ubuntu + - fakeroot # libsystemd-daemon-dev # https://github.com/travis-ci/apt-package-whitelist/issues/3882 diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh index 070fed6da7c..cae34885145 100644 --- a/BUILD/FINISH.sh +++ b/BUILD/FINISH.sh @@ -35,6 +35,11 @@ fi # git clean -fdX removes all ignored (build) files commands="\ git clean -fdX +cd ./libmariadb +git submodule update +cd ../storage/rocksdb/rocksdb +git submodule update +cd ../../.. path=`dirname $0` . \"$path/autorun.sh\"" diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 8aeefe39120..2d6548dda0e 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -289,6 +289,11 @@ gcov_compile_flags="-fprofile-arcs -ftest-coverage" gcov_compile_flags="$gcov_compile_flags -DDISABLE_TAO_ASM" gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov" +# +# The following plugins doesn't work on 32 bit systems +disable_64_bit_plugins="--without-plugin-tokudb --without-plugin-rocksdb" + + # GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well # as on the compiler command line), and this requires setting LDFLAGS for BDB. diff --git a/BUILD/compile-amd64-debug-max-no-ndb b/BUILD/compile-amd64-debug-max-no-ndb deleted file mode 100755 index d45a51eba54..00000000000 --- a/BUILD/compile-amd64-debug-max-no-ndb +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh - -# Copyright (C) 2005, 2006 MySQL AB -# Use is subject to license terms -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA - -path=`dirname $0` -. "$path/SETUP.sh" -extra_flags="$amd64_cflags $debug_cflags" -extra_configs="$amd64_configs $debug_configs $max_configs" - -. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-gprof-no-ndb b/BUILD/compile-amd64-gprof-no-ndb deleted file mode 100755 index ef684274658..00000000000 --- a/BUILD/compile-amd64-gprof-no-ndb +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh -path=`dirname $0` -. "$path/SETUP.sh" -extra_flags="$amd64_cflags -pg -g" -extra_configs="$amd64_configs $max_configs --disable-shared $static_link" - -. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium b/BUILD/compile-pentium index c197d9b49bf..af8e5b53a30 100755 --- a/BUILD/compile-pentium +++ b/BUILD/compile-pentium @@ -20,7 +20,7 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $fast_cflags" -extra_configs="$pentium_configs" +extra_configs="$pentium_configs $disable_64_bit_plugins" strip=yes . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug index faeb1b89597..ecbe04087c3 100755 --- a/BUILD/compile-pentium-debug +++ b/BUILD/compile-pentium-debug @@ -19,6 +19,6 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs" +extra_configs="$pentium_configs $debug_configs $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-all b/BUILD/compile-pentium-debug-all index 710ce8af63c..9ed5bf6b2cd 100755 --- a/BUILD/compile-pentium-debug-all +++ b/BUILD/compile-pentium-debug-all @@ -5,6 +5,6 @@ set -- "$@" --with-debug=full . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs $all_configs $error_inject --with-experimental-collations" +extra_configs="$pentium_configs $debug_configs $all_configs $error_inject --with-experimental-collations $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max index 0c925d8426f..68784eb34ea 100755 --- a/BUILD/compile-pentium-debug-max +++ b/BUILD/compile-pentium-debug-max @@ -19,6 +19,6 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs $max_configs $error_inject --with-experimental-collations" +extra_configs="$pentium_configs $debug_configs $max_configs $error_inject --with-experimental-collations $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded index 2394c8aa2c7..d8bc896f89c 100755 --- a/BUILD/compile-pentium-debug-max-no-embedded +++ b/BUILD/compile-pentium-debug-max-no-embedded @@ -20,6 +20,6 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs $max_no_embedded_configs" +extra_configs="$pentium_configs $debug_configs $max_no_embedded_configs $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb deleted file mode 100755 index 705164c20bc..00000000000 --- a/BUILD/compile-pentium-debug-max-no-ndb +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh - -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -path=`dirname $0` -. "$path/SETUP.sh" - -extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs $max_configs" - -. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max-no-qc b/BUILD/compile-pentium-debug-max-no-qc deleted file mode 100755 index 6407b4b09ad..00000000000 --- a/BUILD/compile-pentium-debug-max-no-qc +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh -# Builds server without query cache support - -path=`dirname $0` -. "$path/SETUP.sh" - -extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs $max_no_qc_configs" - -. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-openssl b/BUILD/compile-pentium-debug-openssl index abf6b41a2d2..697b937bc93 100755 --- a/BUILD/compile-pentium-debug-openssl +++ b/BUILD/compile-pentium-debug-openssl @@ -19,7 +19,7 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs" +extra_configs="$pentium_configs $debug_configs $disable_64_bit_plugins" extra_configs="$extra_configs --with-debug --with-ssl=/usr" diff --git a/BUILD/compile-pentium-debug-wsrep b/BUILD/compile-pentium-debug-wsrep index ee68e3fd0c1..6528ed77f95 100644 --- a/BUILD/compile-pentium-debug-wsrep +++ b/BUILD/compile-pentium-debug-wsrep @@ -7,6 +7,6 @@ set -- "$@" --with-debug=full extra_flags="$pentium_cflags $debug_cflags -g -O0 $wsrep_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" -extra_configs="$pentium_configs $debug_configs $wsrep_configs --with-wsrep" +extra_configs="$pentium_configs $debug_configs $wsrep_configs --with-wsrep $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov index 56072f619e5..9c5a61e9089 100755 --- a/BUILD/compile-pentium-gcov +++ b/BUILD/compile-pentium-gcov @@ -40,6 +40,6 @@ export LDFLAGS="$gcov_link_flags" extra_flags="$pentium_cflags $debug_cflags $max_cflags $gcov_compile_flags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" -extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs" +extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-gprof b/BUILD/compile-pentium-gprof index 52231e7832a..de014e3ae8b 100755 --- a/BUILD/compile-pentium-gprof +++ b/BUILD/compile-pentium-gprof @@ -19,6 +19,6 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $gprof_compile_flags" -extra_configs="$pentium_configs $debug_configs $gprof_link_flags" +extra_configs="$pentium_configs $debug_configs $gprof_link_flags $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-icc b/BUILD/compile-pentium-icc index 23333a13c15..4fdc37b0667 100755 --- a/BUILD/compile-pentium-icc +++ b/BUILD/compile-pentium-icc @@ -35,6 +35,6 @@ extra_flags="$fast_cflags -unroll2 -ip -mp -restrict" # icpc: error: problem during multi-file optimization compilation (code 1) extra_flags="$extra_flags -no-ipo" base_cxxflags="-fno-exceptions -fno-rtti" -extra_configs="$pentium_configs $static_link" +extra_configs="$pentium_configs $static_link $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max index 470596f8eb9..d2a61de8e13 100755 --- a/BUILD/compile-pentium-max +++ b/BUILD/compile-pentium-max @@ -20,6 +20,6 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $fast_cflags -g" -extra_configs="$pentium_configs $max_configs" +extra_configs="$pentium_configs $max_configs $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-myodbc b/BUILD/compile-pentium-myodbc deleted file mode 100755 index d9b1dd47129..00000000000 --- a/BUILD/compile-pentium-myodbc +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/sh - -# Copyright (C) 2000 MySQL AB -# Use is subject to license terms -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -path=`dirname $0` -. "$path/SETUP.sh" - -extra_flags="$pentium_cflags $fast_cflags" -extra_configs="$pentium_configs --without-server" - -make=no -strip=yes - -. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index c4cb1845ba1..4f21e3574ff 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -33,6 +33,6 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" -extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs" +extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-valgrind-max-no-ndb b/BUILD/compile-pentium-valgrind-max-no-ndb deleted file mode 100755 index 4eb47cb2fe2..00000000000 --- a/BUILD/compile-pentium-valgrind-max-no-ndb +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/sh - -# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA - -path=`dirname $0` -. "$path/SETUP.sh" - -extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" -extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs" - -. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-wsrep b/BUILD/compile-pentium-wsrep index eeb14310e4e..b0b8e408370 100644 --- a/BUILD/compile-pentium-wsrep +++ b/BUILD/compile-pentium-wsrep @@ -4,7 +4,7 @@ path=`dirname $0` . "$path/SETUP.sh" extra_flags="$pentium_cflags $fast_cflags $wsrep_cflags" -extra_configs="$pentium_configs $wsrep_configs --with-wsrep" +extra_configs="$pentium_configs $wsrep_configs --with-wsrep $disable_64_bit_plugins" #strip=yes diff --git a/BUILD/compile-ppc-debug-max-no-ndb b/BUILD/compile-ppc-debug-max-no-ndb deleted file mode 100755 index 0642ddf7a57..00000000000 --- a/BUILD/compile-ppc-debug-max-no-ndb +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh - -# Copyright (c) 2005, 2006 MySQL AB -# Use is subject to license terms -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -path=`dirname $0` -. "$path/SETUP.sh" - -extra_flags="$ppc_cflags $debug_cflags" -extra_configs="$debug_configs $max_configs" - -. "$path/FINISH.sh" diff --git a/include/my_sys.h b/include/my_sys.h index ed5a7200ec8..fb3e15b64a4 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -423,14 +423,6 @@ typedef struct st_io_cache /* Used when cacheing files */ uchar *write_end; /* - Current_pos and current_end are convenience variables used by - my_b_tell() and other routines that need to know the current offset - current_pos points to &write_pos, and current_end to &write_end in a - WRITE_CACHE, and &read_pos and &read_end respectively otherwise - */ - uchar **current_pos, **current_end; - - /* The lock is for append buffer used in SEQ_READ_APPEND cache need mutex copying from append buffer to read buffer. */ @@ -584,7 +576,11 @@ static inline size_t my_b_fill(IO_CACHE *info) static inline my_off_t my_b_tell(const IO_CACHE *info) { - return info->pos_in_file + (*info->current_pos - info->request_pos); + if (info->type == WRITE_CACHE) { + return info->pos_in_file + (info->write_pos - info->request_pos); + + } + return info->pos_in_file + (info->read_pos - info->request_pos); } static inline my_off_t my_b_write_tell(const IO_CACHE *info) @@ -609,7 +605,10 @@ static inline my_off_t my_b_get_pos_in_file(const IO_CACHE *info) static inline size_t my_b_bytes_in_cache(const IO_CACHE *info) { - return *info->current_end - *info->current_pos; + if (info->type == WRITE_CACHE) { + return info->write_end - info->write_pos; + } + return info->read_end - info->read_pos; } int my_b_copy_to_file(IO_CACHE *cache, FILE *file); @@ -803,7 +802,6 @@ extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize, extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, my_off_t seek_offset, my_bool use_async_io, my_bool clear_cache); -extern void setup_io_cache(IO_CACHE* info); extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, IO_CACHE *write_cache, uint num_threads); diff --git a/mysql-test/include/have_wsrep_enabled.inc b/mysql-test/include/have_wsrep_enabled.inc index 94eccadec3b..9287369c87c 100644 --- a/mysql-test/include/have_wsrep_enabled.inc +++ b/mysql-test/include/have_wsrep_enabled.inc @@ -8,4 +8,5 @@ if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_N { --skip Test requires wsrep_on=ON } +--source include/wait_until_ready.inc diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result index 262b49e9a60..2fceebd1971 100644 --- a/mysql-test/r/cte_nonrecursive.result +++ b/mysql-test/r/cte_nonrecursive.result @@ -1002,3 +1002,56 @@ f 2 DROP TABLE cte; DROP TABLE t; +# +# MDEV-13107: SHOW TABLE STATUS, SHOW CREATE VIEW +# for CTEs that use derived tables +# +create table t1(a int) engine=myisam; +insert into t1 values (3), (1), (2); +create table t2 (b int) engine=myisam; +insert into t2 values (2), (10); +create view v1 as +with t as (select s.a from (select t1.a from t1) s), +r as(select t.a from t2, t where t2.b=t.a) +select a from r; +create view v2 as +with t as (select s.a from (select t1.a from t1) s), +r as(select t.a from t2, t where t2.b=t.a) +select a from t1; +show table status; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `s`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1`) `s`), r as (select `t`.`a` AS `a` from (`test`.`t2` join `t`) where `test`.`t2`.`b` = `t`.`a`)select `r`.`a` AS `a` from `r` latin1 latin1_swedish_ci +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS with t as (select `s`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1`) `s`), r as (select `t`.`a` AS `a` from (`test`.`t2` join `t`) where `test`.`t2`.`b` = `t`.`a`)select `test`.`t1`.`a` AS `a` from `test`.`t1` latin1 latin1_swedish_ci +select * from v1; +a +2 +select * from v2; +a +3 +1 +2 +prepare stmt1 from "select * from v1"; +execute stmt1; +a +2 +execute stmt1; +a +2 +prepare stmt2 from "select * from v2"; +execute stmt2; +a +3 +1 +2 +execute stmt2; +a +3 +1 +2 +deallocate prepare stmt1; +deallocate prepare stmt2; +drop view v1,v2; +drop table t1,t2; diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 8a90df3bc4d..5b07b0488e0 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -8725,3 +8725,60 @@ EXPLAIN } DROP VIEW v1; DROP TABLE t1; +# +# MDEV-13193: pushdown of equality extracted from multiple equality +# +CREATE TABLE t1 (i1 int, KEY(i1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (i2 int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2),(4); +CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2; +SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq +WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 ); +i1 i2 +explain format=json SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq +WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 ); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t1", + "access_type": "ref", + "possible_keys": ["i1"], + "key": "i1", + "key_length": "5", + "used_key_parts": ["i1"], + "ref": ["const"], + "rows": 1, + "filtered": 100, + "using_index": true + }, + "block-nl-join": { + "table": { + "table_name": "<derived3>", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "v2.i2 = 1" + }, + "buffer_type": "flat", + "buffer_size": "256Kb", + "join_type": "BNL", + "materialized": { + "query_block": { + "select_id": 3, + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t2.i2 = 1" + } + } + } + } + } +} +DROP VIEW v2; +DROP TABLE t1,t2; diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index a8068006e0a..9221c6240bd 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -1107,7 +1107,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 1 PRIMARY t2 ref a a 4 const 1 Using index 1 PRIMARY <derived2> ref key0 key0 8 const,const 1 -2 DERIVED t3 ALL NULL NULL NULL NULL 12 Using where; Using temporary; Using filesort +2 DERIVED t3 ALL NULL NULL NULL NULL 12 Using temporary; Using filesort SELECT * FROM t1, t2, v1 WHERE t2.a=t1.a AND t2.a=v1.a AND t2.a=v1.b; a a a b c c c c diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index b9f745b745d..44447653119 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -1146,9 +1146,17 @@ The following options may be given as the first argument: --time-format=name The TIME format (ignored) --timed-mutexes Specify whether to time mutexes. Deprecated, has no effect. - --tmp-table-size=# If an internal in-memory temporary table exceeds this + --tmp-disk-table-size=# + Max size for data for an internal temporary on-disk + MyISAM or Aria table. + --tmp-memory-table-size=# + If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk - MyISAM or Aria table + MyISAM or Aria table. Same as tmp_table_size. + --tmp-table-size=# Alias for tmp_memory_table_size. If an internal in-memory + temporary table exceeds this size, MySQL will + automatically convert it to an on-disk MyISAM or Aria + table. -t, --tmpdir=name Path for temporary files. Several paths may be specified, separated by a colon (:), in this case they are used in a round-robin fashion @@ -1499,6 +1507,8 @@ thread-pool-stall-limit 500 thread-stack 299008 time-format %H:%i:%s timed-mutexes FALSE +tmp-disk-table-size 18446744073709551615 +tmp-memory-table-size 16777216 tmp-table-size 16777216 transaction-alloc-block-size 8192 transaction-isolation REPEATABLE-READ diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result index 3aece252991..4a06a8382c4 100644 --- a/mysql-test/r/win.result +++ b/mysql-test/r/win.result @@ -3086,6 +3086,48 @@ max(id) rank() over (order by max(id)) 2 1 drop table t1; # +# main.win failure post MDEV-12336 +# +create table t(a decimal(35,10), b int); +insert into t values (1, 10), (2, 20), (3, 30); +prepare stmt from "SELECT (CASE WHEN sum(t.a) over (partition by t.b)=1 THEN 1000 ELSE 300 END) AS a FROM t"; +execute stmt; +a +1000 +300 +300 +drop table t; +# +# MDEV-12851 case with window functions query crashes server +# +create table t1(dt datetime); +insert into t1 values ('2017-05-17'), ('2017-05-18'); +select dt, +case when (max(dt) over (order by dt rows between 1 following and 1 following) is null) +then '9999-12-31 12:00:00' + else max(dt) over (order by dt rows between 1 following and 1 following) +end x, +case when (max(dt) over (order by dt rows between 1 following and 1 following) is not null) +then '9999-12-31 12:00:00' + else max(dt) over (order by dt rows between 1 following and 1 following) +end x +from t1; +dt x x +2017-05-17 00:00:00 2017-05-18 00:00:00 9999-12-31 12:00:00 +2017-05-18 00:00:00 9999-12-31 12:00:00 NULL +drop table t1; +create table t1(i int); +insert into t1 values (null),(1),(2); +select max(i) over (order by i), +max(i) over (order by i) is null, +max(i) over (order by i) is not null +from t1; +max(i) over (order by i) max(i) over (order by i) is null max(i) over (order by i) is not null +NULL 1 0 +1 0 1 +2 0 1 +drop table t1; +# # Start of 10.3 tests # # diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result index 616790c8b37..4de7cc8e43a 100644 --- a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result +++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result @@ -43,6 +43,6 @@ a 1 2 3 -InnoDB: Last MySQL binlog file position 0 <pos>, file name ./master-bin.000001 +InnoDB: Last binlog file './master-bin.000001', position <pos> SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result index f338761aea8..faf57de1750 100644 --- a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result +++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result @@ -44,6 +44,6 @@ a 1 2 3 -InnoDB: Last MySQL binlog file position 0 <pos>, file name ./master-bin.000001 +InnoDB: Last binlog file './master-bin.000001', position <pos> SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/log_file.result b/mysql-test/suite/innodb/r/log_file.result index f0f8007cb09..b93bfc0d02b 100644 --- a/mysql-test/suite/innodb/r/log_file.result +++ b/mysql-test/suite/innodb/r/log_file.result @@ -340,7 +340,7 @@ WHERE engine='innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED'); 1 1 -FOUND 1 /Resizing redo log from 1\*\d+ to 3\*\d+ pages; LSN=\d+/ in mysqld.1.err +FOUND 1 /Resizing redo log from 1\*\d+ to 3\*\d+ bytes; LSN=\d+/ in mysqld.1.err # Cleanup bak_ib_logfile0 bak_ib_logfile1 diff --git a/mysql-test/suite/innodb/r/log_file_size.result b/mysql-test/suite/innodb/r/log_file_size.result index 9e0cb4dbbf7..b576061e74b 100644 --- a/mysql-test/suite/innodb/r/log_file_size.result +++ b/mysql-test/suite/innodb/r/log_file_size.result @@ -33,16 +33,16 @@ ERROR 42000: Unknown storage engine 'InnoDB' FOUND 1 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' -FOUND 2 /redo log from 3\*[0-9]+ to 2\*[0-9]+ pages/ in mysqld.1.err +FOUND 2 /redo log from 3\*[0-9]+ to 2\*[0-9]+ bytes/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' -FOUND 3 /redo log from 3\*[0-9]+ to 2\*[0-9]+ pages/ in mysqld.1.err +FOUND 3 /redo log from 3\*[0-9]+ to 2\*[0-9]+ bytes/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' FOUND 2 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' -FOUND 4 /redo log from 3\*[0-9]+ to 2\*[0-9]+ pages/ in mysqld.1.err +FOUND 4 /redo log from 3\*[0-9]+ to 2\*[0-9]+ bytes/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' SELECT * FROM t1; @@ -56,7 +56,7 @@ ERROR 42000: Unknown storage engine 'InnoDB' FOUND 1 /InnoDB: Setting log file .*ib_logfile[0-9]+ size to/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' -FOUND 1 /InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of innodb_page_size/ in mysqld.1.err +FOUND 1 /InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of 512 bytes/ in mysqld.1.err SELECT * FROM t1; ERROR 42000: Unknown storage engine 'InnoDB' FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files/ in mysqld.1.err diff --git a/mysql-test/suite/innodb/t/group_commit_binlog_pos.test b/mysql-test/suite/innodb/t/group_commit_binlog_pos.test index 7148733dc43..801895e825d 100644 --- a/mysql-test/suite/innodb/t/group_commit_binlog_pos.test +++ b/mysql-test/suite/innodb/t/group_commit_binlog_pos.test @@ -9,7 +9,7 @@ # Don't test this under valgrind, memory leaks will occur as we crash --source include/not_valgrind.inc -# The test case currently uses grep and tail, which may be unavailable on +# The test case currently uses sed and tail, which may be unavailable on # some windows systems. But see MWL#191 for how to remove the need for grep. --source include/not_windows.inc @@ -99,7 +99,7 @@ SELECT * FROM t1 ORDER BY a; let $MYSQLD_DATADIR= `SELECT @@datadir`; let pos=`select $binlog_start_pos + 730`; --replace_result $pos <pos> ---exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1 +--exec sed -ne 's/.*\(InnoDB: Last binlog file .* position.*\)/\1/p' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1 SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test index a2dab551cec..116bc54441e 100644 --- a/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test +++ b/mysql-test/suite/innodb/t/group_commit_binlog_pos_no_optimize_thread.test @@ -9,7 +9,7 @@ # Don't test this under valgrind, memory leaks will occur as we crash --source include/not_valgrind.inc -# The test case currently uses grep and tail, which may be unavailable on +# The test case currently uses sed and tail, which may be unavailable on # some windows systems. But see MWL#191 for how to remove the need for grep. --source include/not_windows.inc @@ -100,6 +100,6 @@ SELECT * FROM t1 ORDER BY a; let $MYSQLD_DATADIR= `SELECT @@datadir`; let pos=`select $binlog_start_pos + 730`; --replace_result $pos <pos> ---exec grep 'InnoDB: Last MySQL binlog file position' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1 +--exec sed -ne 's/.*\(InnoDB: Last binlog file .* position.*\)/\1/p' $MYSQLD_DATADIR/../../log/mysqld.1.err | tail -1 SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/log_file.test b/mysql-test/suite/innodb/t/log_file.test index f5d46b1db10..8a82ab7f29f 100644 --- a/mysql-test/suite/innodb/t/log_file.test +++ b/mysql-test/suite/innodb/t/log_file.test @@ -218,7 +218,7 @@ eval $check_no_innodb; --source include/start_mysqld.inc eval $check_yes_innodb; --source include/shutdown_mysqld.inc ---let SEARCH_PATTERN=Resizing redo log from 1\*\d+ to 3\*\d+ pages; LSN=\d+ +--let SEARCH_PATTERN=Resizing redo log from 1\*\d+ to 3\*\d+ bytes; LSN=\d+ --source include/search_pattern_in_file.inc --let $restart_parameters= diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test index 14cc889e34b..2a7ca9e0e45 100644 --- a/mysql-test/suite/innodb/t/log_file_size.test +++ b/mysql-test/suite/innodb/t/log_file_size.test @@ -100,14 +100,14 @@ let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery; --source include/restart_mysqld.inc --error ER_UNKNOWN_STORAGE_ENGINE SELECT * FROM t1; -let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ pages; +let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ bytes; --source include/search_pattern_in_file.inc --let $restart_parameters= --debug=d,innodb_log_abort_5 --source include/restart_mysqld.inc --error ER_UNKNOWN_STORAGE_ENGINE SELECT * FROM t1; -let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ pages; +let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ bytes; --source include/search_pattern_in_file.inc --let $restart_parameters= --innodb-read-only @@ -122,7 +122,7 @@ let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery; --error ER_UNKNOWN_STORAGE_ENGINE SELECT * FROM t1; -let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ pages; +let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 2\*[0-9]+ bytes; --source include/search_pattern_in_file.inc --let $restart_parameters= --debug=d,innodb_log_abort_7 @@ -170,7 +170,7 @@ EOF --source include/start_mysqld.inc --error ER_UNKNOWN_STORAGE_ENGINE SELECT * FROM t1; -let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of innodb_page_size; +let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of 512 bytes; --source include/search_pattern_in_file.inc --remove_file $MYSQLD_DATADIR/ib_logfile0 --move_file $MYSQLD_DATADIR/ib_logfile101 $MYSQLD_DATADIR/ib_logfile0 diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result index f057db1d284..b7688e9ef0f 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_plugin.result @@ -135,12 +135,29 @@ INSERT INTO articles (title, body) VALUES ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','How to use full-text search engine'), -('Go MySQL Tricks','How to use full text search engine'); +('Go MariaDB Tricks','How to use full text search engine'); +SELECT * FROM articles WHERE +MATCH(title, body) AGAINST('MySQL'); +id title body +6 MySQL Tutorial DBMS stands for MySQL DataBase ... +7 How To Use MySQL Well After you went through a ... +8 Optimizing MySQL In this tutorial we will show ... +9 1001 MySQL Tricks How to use full-text search engine +SELECT * FROM articles WHERE +MATCH(title, body) AGAINST('tutorial'); +id title body +6 MySQL Tutorial DBMS stands for MySQL DataBase ... +8 Optimizing MySQL In this tutorial we will show ... SELECT * FROM articles WHERE MATCH(title, body) AGAINST('Tricks'); id title body 9 1001 MySQL Tricks How to use full-text search engine -10 Go MySQL Tricks How to use full text search engine +10 Go MariaDB Tricks How to use full text search engine +SELECT * FROM articles WHERE +MATCH(title, body) AGAINST('full text search'); +id title body +10 Go MariaDB Tricks How to use full text search engine +9 1001 MySQL Tricks How to use full-text search engine SELECT COUNT(*) FROM articles; COUNT(*) 5 diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test index 9cc1afd4e60..cd31500b23f 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test +++ b/mysql-test/suite/innodb_fts/t/innodb_fts_plugin.test @@ -145,13 +145,18 @@ INSERT INTO articles (title, body) VALUES ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','How to use full-text search engine'), - ('Go MySQL Tricks','How to use full text search engine'); + ('Go MariaDB Tricks','How to use full text search engine'); --source include/restart_mysqld.inc -# Simple term search - 4 records expected +SELECT * FROM articles WHERE + MATCH(title, body) AGAINST('MySQL'); +SELECT * FROM articles WHERE + MATCH(title, body) AGAINST('tutorial'); SELECT * FROM articles WHERE MATCH(title, body) AGAINST('Tricks'); +SELECT * FROM articles WHERE + MATCH(title, body) AGAINST('full text search'); SELECT COUNT(*) FROM articles; DROP TABLE articles; diff --git a/mysql-test/suite/innodb_zip/r/bug36172.result b/mysql-test/suite/innodb_zip/r/bug36172.result index 23c5b0cc2f7..727f100d064 100644 --- a/mysql-test/suite/innodb_zip/r/bug36172.result +++ b/mysql-test/suite/innodb_zip/r/bug36172.result @@ -1 +1,4 @@ -SET default_storage_engine=InnoDB; +set @file_per_table=@@global.innodb_file_per_table; +SET GLOBAL innodb_file_per_table=on; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +SET GLOBAL innodb_file_per_table=@file_per_table; diff --git a/mysql-test/suite/innodb_zip/r/cmp_drop_table.result b/mysql-test/suite/innodb_zip/r/cmp_drop_table.result index c1743cac2e1..e1f63268d0b 100644 --- a/mysql-test/suite/innodb_zip/r/cmp_drop_table.result +++ b/mysql-test/suite/innodb_zip/r/cmp_drop_table.result @@ -1,12 +1,12 @@ set global innodb_file_per_table=on; -create table t1(a text) engine=innodb key_block_size=8; +create table t1(a text) engine=innodb key_block_size=4; SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; page_size -8192 +4096 drop table t1; SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; page_size -8192 +4096 create table t2(a text) engine=innodb; SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; page_size diff --git a/mysql-test/suite/innodb_zip/r/innodb_bug36169.result b/mysql-test/suite/innodb_zip/r/innodb_bug36169.result deleted file mode 100644 index bae08bd54a2..00000000000 --- a/mysql-test/suite/innodb_zip/r/innodb_bug36169.result +++ /dev/null @@ -1 +0,0 @@ -call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size .* for a record on index leaf page."); diff --git a/mysql-test/suite/innodb_zip/r/innodb_bug36172.result b/mysql-test/suite/innodb_zip/r/innodb_bug36172.result deleted file mode 100644 index 195775f74c8..00000000000 --- a/mysql-test/suite/innodb_zip/r/innodb_bug36172.result +++ /dev/null @@ -1 +0,0 @@ -SET storage_engine=InnoDB; diff --git a/mysql-test/suite/innodb_zip/r/innodb_bug52745.result b/mysql-test/suite/innodb_zip/r/innodb_bug52745.result deleted file mode 100644 index 1556c313994..00000000000 --- a/mysql-test/suite/innodb_zip/r/innodb_bug52745.result +++ /dev/null @@ -1,127 +0,0 @@ -SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR -CREATE TABLE bug52745 ( -a2 int(10) unsigned DEFAULT NULL, -col37 time DEFAULT NULL, -col38 char(229) CHARACTER SET utf8 DEFAULT NULL, -col39 text, -col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -col41 int(10) unsigned DEFAULT NULL, -col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL, -col43 smallint(5) unsigned zerofill DEFAULT NULL, -col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL, -col45 float unsigned zerofill DEFAULT NULL, -col46 binary(1) DEFAULT NULL, -col47 tinyint(4) DEFAULT NULL, -col48 tinyint(1) DEFAULT NULL, -col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', -col50 binary(1) DEFAULT NULL, -col51 double unsigned zerofill DEFAULT NULL, -col52 int(10) unsigned DEFAULT NULL, -col53 time DEFAULT NULL, -col54 double unsigned DEFAULT NULL, -col55 time DEFAULT NULL, -col56 mediumtext CHARACTER SET latin2, -col57 blob, -col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000', -col59 binary(1) DEFAULT NULL, -col60 longblob, -col61 time DEFAULT NULL, -col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci, -col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', -col64 int(10) unsigned DEFAULT NULL, -col65 date DEFAULT NULL, -col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', -col67 binary(1) DEFAULT NULL, -col68 tinyblob, -col69 date DEFAULT NULL, -col70 tinyint(3) unsigned zerofill DEFAULT NULL, -col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL, -col72 datetime DEFAULT NULL, -col73 smallint(5) unsigned zerofill DEFAULT NULL, -col74 longblob, -col75 bit(34) DEFAULT NULL, -col76 float unsigned zerofill DEFAULT NULL, -col77 year(2) DEFAULT NULL, -col78 tinyint(3) unsigned DEFAULT NULL, -col79 set('msfheowh','tbpxbgf','by','wahnrjw','myqfasxz','rsokyumrt') CHARACTER SET latin2 DEFAULT NULL, -col80 datetime DEFAULT NULL, -col81 smallint(6) DEFAULT NULL, -col82 enum('xtaurnqfqz','rifrse','kuzwpbvb','niisabk','zxavro','rbvasv','','uulrfaove','','') DEFAULT NULL, -col83 bigint(20) unsigned zerofill DEFAULT NULL, -col84 float unsigned zerofill DEFAULT NULL, -col85 double DEFAULT NULL, -col86 enum('ylannv','','vlkhycqc','snke','cxifustp','xiaxaswzp','oxl') CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL, -col87 varbinary(221) DEFAULT NULL, -col88 double unsigned DEFAULT NULL, -col89 float unsigned zerofill DEFAULT NULL, -col90 tinyblob -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead -Note 1291 Column 'col82' has duplicated value '' in ENUM -Note 1291 Column 'col82' has duplicated value '' in ENUM -INSERT IGNORE INTO bug52745 SET -col40='0000-00-00 00:00:00', -col51=16547, -col53='7711484', -col54=-28604, -col55='7112612', -col56='wakefulness\'', -col57=repeat('absorbefacient\'',106), -col58=11027, -col59='AM09gW7', -col60=repeat('Noelani\'',16), -col61='2520576', -col62='substitutiv', -col63='19950106155112', -col64=-12038, -col65='86238806', -col66='19600719080256', -col68=repeat('Sagittarius\'',54), -col69='38943902', -col70=1232, -col71='Elora\'', -col74=repeat('zipp',11), -col75='0', -col76=23254, -col78=13247, -col79='56219', -col80='20500609035724', -col81=11632, -col82=7, -col84=-23863, -col85=6341, -col87='HZdkf.4 s7t,5Rmq 8so fmr,ruGLUG25TrtI.yQ 2SuHq0ML7rw7.4 b2yf2E5TJxOtBBZImezDnzpj,uPYfznnEUDN1e9aQoO 2DsplB7TFWy oQJ br HLF :F,eQ p4i1oWsr lL3PG,hjCz6hYqN h1QTjLCjrv:QCdSzpYBibJAtZCxLOk3l6Blsh.W', -col88=16894, -col89=6161, -col90=repeat('gale',48); -Warnings: -Warning 1265 Data truncated for column 'col53' at row 1 -Warning 1264 Out of range value for column 'col54' at row 1 -Warning 1265 Data truncated for column 'col59' at row 1 -Warning 1265 Data truncated for column 'col61' at row 1 -Warning 1264 Out of range value for column 'col64' at row 1 -Warning 1265 Data truncated for column 'col65' at row 1 -Warning 1264 Out of range value for column 'col66' at row 1 -Warning 1265 Data truncated for column 'col68' at row 1 -Warning 1265 Data truncated for column 'col69' at row 1 -Warning 1264 Out of range value for column 'col70' at row 1 -Warning 1264 Out of range value for column 'col78' at row 1 -Warning 1265 Data truncated for column 'col79' at row 1 -Warning 1264 Out of range value for column 'col84' at row 1 -SHOW WARNINGS; -Level Code Message -Warning 1265 Data truncated for column 'col53' at row 1 -Warning 1264 Out of range value for column 'col54' at row 1 -Warning 1265 Data truncated for column 'col59' at row 1 -Warning 1265 Data truncated for column 'col61' at row 1 -Warning 1264 Out of range value for column 'col64' at row 1 -Warning 1265 Data truncated for column 'col65' at row 1 -Warning 1264 Out of range value for column 'col66' at row 1 -Warning 1265 Data truncated for column 'col68' at row 1 -Warning 1265 Data truncated for column 'col69' at row 1 -Warning 1264 Out of range value for column 'col70' at row 1 -Warning 1264 Out of range value for column 'col78' at row 1 -Warning 1265 Data truncated for column 'col79' at row 1 -Warning 1264 Out of range value for column 'col84' at row 1 -DROP TABLE bug52745; diff --git a/mysql-test/suite/innodb_zip/r/innodb_bug53591.result b/mysql-test/suite/innodb_zip/r/innodb_bug53591.result deleted file mode 100644 index 0222ad64fa2..00000000000 --- a/mysql-test/suite/innodb_zip/r/innodb_bug53591.result +++ /dev/null @@ -1,11 +0,0 @@ -SET GLOBAL innodb_strict_mode=on; -set old_alter_table=0; -CREATE TABLE bug53591(a text charset utf8 not null) -ENGINE=InnoDB KEY_BLOCK_SIZE=1; -ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -SHOW WARNINGS; -Level Code Message -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -DROP TABLE bug53591; -SET GLOBAL innodb_strict_mode=DEFAULT; diff --git a/mysql-test/suite/innodb_zip/r/innodb_bug56680.result b/mysql-test/suite/innodb_zip/r/innodb_bug56680.result deleted file mode 100644 index c509c5bad21..00000000000 --- a/mysql-test/suite/innodb_zip/r/innodb_bug56680.result +++ /dev/null @@ -1,119 +0,0 @@ -SET GLOBAL tx_isolation='REPEATABLE-READ'; -CREATE TABLE bug56680( -a INT AUTO_INCREMENT PRIMARY KEY, -b CHAR(1), -c INT, -INDEX(b)) -ENGINE=InnoDB; -INSERT INTO bug56680 VALUES(0,'x',1); -BEGIN; -SELECT b FROM bug56680; -b -x -connect con1,localhost,root,,; -connection con1; -BEGIN; -UPDATE bug56680 SET b='X'; -connection default; -SELECT b FROM bug56680; -b -x -SELECT * FROM bug56680; -a b c -1 x 1 -connection con1; -ROLLBACK; -disconnect con1; -connection default; -SELECT b FROM bug56680; -b -x -SET GLOBAL tx_isolation='READ-UNCOMMITTED'; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -BEGIN; -SELECT b FROM bug56680 LIMIT 2; -b -x -x -connect con1,localhost,root,,; -connection con1; -BEGIN; -DELETE FROM bug56680 WHERE a=1; -INSERT INTO bug56680 VALUES(1,'X',1); -SELECT b FROM bug56680 LIMIT 3; -b -X -x -x -connection default; -SELECT b FROM bug56680 LIMIT 2; -b -x -x -CHECK TABLE bug56680; -Table Op Msg_type Msg_text -test.bug56680 check status OK -connection con1; -ROLLBACK; -SELECT b FROM bug56680 LIMIT 2; -b -x -x -CHECK TABLE bug56680; -Table Op Msg_type Msg_text -test.bug56680 check status OK -connection default; -disconnect con1; -SELECT b FROM bug56680 LIMIT 2; -b -x -x -CREATE TABLE bug56680_2( -a INT AUTO_INCREMENT PRIMARY KEY, -b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci, -c INT, -INDEX(b)) -ENGINE=InnoDB; -INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680; -BEGIN; -SELECT HEX(b) FROM bug56680_2 LIMIT 2; -HEX(b) -DF -DF -DELETE FROM bug56680_2 WHERE a=1; -INSERT INTO bug56680_2 VALUES(1,'SS',1); -SELECT HEX(b) FROM bug56680_2 LIMIT 3; -HEX(b) -5353 -DF -DF -CHECK TABLE bug56680_2; -Table Op Msg_type Msg_text -test.bug56680_2 check status OK -ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; -SELECT HEX(b) FROM bug56680_2 LIMIT 2; -HEX(b) -5353 -DF -DELETE FROM bug56680_2 WHERE a=1; -INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1); -SELECT HEX(b) FROM bug56680_2 LIMIT 3; -HEX(b) -DF -DF -DF -CHECK TABLE bug56680_2; -Table Op Msg_type Msg_text -test.bug56680_2 check status OK -DROP TABLE bug56680_2; -DROP TABLE bug56680; diff --git a/mysql-test/suite/innodb_zip/r/innodb_cmp_drop_table.result b/mysql-test/suite/innodb_zip/r/innodb_cmp_drop_table.result deleted file mode 100644 index 11e90b9e7d6..00000000000 --- a/mysql-test/suite/innodb_zip/r/innodb_cmp_drop_table.result +++ /dev/null @@ -1,18 +0,0 @@ -set global innodb_file_per_table=on; -set global innodb_file_format=`1`; -Warnings: -Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create table t1(a text) engine=innodb key_block_size=8; -SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; -page_size -8192 -drop table t1; -SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; -page_size -8192 -create table t2(a text) engine=innodb; -SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; -page_size -drop table t2; -Warnings: -Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html diff --git a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result deleted file mode 100644 index 5be18b84065..00000000000 --- a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result +++ /dev/null @@ -1,538 +0,0 @@ -SET default_storage_engine=InnoDB; -call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page."); -set global innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -set global innodb_strict_mode=1; -### Test 1 ### -create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC; -show warnings; -Level Code Message -insert into worklog5743 values(repeat("a", 20000)); -update worklog5743 set a = (repeat("b", 16000)); -create index idx on worklog5743(a(2000)); -show warnings; -Level Code Message -begin; -update worklog5743 set a = (repeat("x", 17000)); -select @@session.tx_isolation; -@@session.tx_isolation -REPEATABLE-READ -connect con1,localhost,root,,; -select a = repeat("x", 17000) from worklog5743; -a = repeat("x", 17000) -0 -select a = repeat("b", 16000) from worklog5743; -a = repeat("b", 16000) -1 -connect con2,localhost,root,,; -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -@@session.tx_isolation -READ-UNCOMMITTED -select a = repeat("x", 17000) from worklog5743; -a = repeat("x", 17000) -1 -connection default; -rollback; -drop table worklog5743; -### Test 2 ### -create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; -show warnings; -Level Code Message -create index idx on worklog5743(a1, a2(2000)); -show warnings; -Level Code Message -insert into worklog5743 values(9, repeat("a", 10000)); -begin; -update worklog5743 set a1 = 1000; -connection con1; -select @@session.tx_isolation; -@@session.tx_isolation -REPEATABLE-READ -explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743 ref idx idx 5 const 1 -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -a1 a2 = repeat("a", 10000) -9 1 -connection con2; -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -@@session.tx_isolation -READ-UNCOMMITTED -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -a1 a2 = repeat("a", 10000) -connection default; -rollback; -drop table worklog5743; -### Test 3 ### -create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; -create index idx on worklog5743(a1, a2(50)); -insert into worklog5743 values(9, repeat("a", 10000)); -begin; -update worklog5743 set a1 = 1000; -connection con1; -select @@session.tx_isolation; -@@session.tx_isolation -REPEATABLE-READ -explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743 ref idx idx 5 const 1 -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -a1 a2 = repeat("a", 10000) -9 1 -connection con2; -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -@@session.tx_isolation -READ-UNCOMMITTED -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -a1 a2 = repeat("a", 10000) -connection default; -rollback; -drop table worklog5743; -### Test 4 ### -create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1; -create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2; -create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; -create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8; -create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16; -set sql_mode=''; -set global innodb_large_prefix=0; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx1 on worklog5743_1(a2(4000)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 767 bytes -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -set global innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx2 on worklog5743_1(a2(4000)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 3072 bytes -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx3 on worklog5743_1(a2(436)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx4 on worklog5743_1(a2(434)); -show warnings; -Level Code Message -create index idx5 on worklog5743_1(a1, a2(430)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx6 on worklog5743_1(a1, a2(428)); -show warnings; -Level Code Message -set global innodb_large_prefix=0; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx1 on worklog5743_2(a2(4000)); -Warnings: -Note 1071 Specified key was too long; max key length is 767 bytes -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 767 bytes -set global innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx2 on worklog5743_2(a2(4000)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 3072 bytes -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx3 on worklog5743_2(a2(948)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx4 on worklog5743_2(a2(946)); -show warnings; -Level Code Message -create index idx5 on worklog5743_2(a1, a2(942)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx6 on worklog5743_2(a1, a2(940)); -show warnings; -Level Code Message -set global innodb_large_prefix=0; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx1 on worklog5743_4(a2(4000)); -Warnings: -Note 1071 Specified key was too long; max key length is 767 bytes -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 767 bytes -set global innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx2 on worklog5743_4(a2(4000)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 3072 bytes -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx3 on worklog5743_4(a2(1972)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx4 on worklog5743_4(a2(1970)); -show warnings; -Level Code Message -create index idx5 on worklog5743_4(a1, a2(1966)); -ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -show warnings; -Level Code Message -Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs -create index idx6 on worklog5743_4(a1, a2(1964)); -show warnings; -Level Code Message -set global innodb_large_prefix=0; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx1 on worklog5743_8(a2(1000)); -Warnings: -Note 1071 Specified key was too long; max key length is 767 bytes -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 767 bytes -set global innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx2 on worklog5743_8(a2(3073)); -Warnings: -Note 1071 Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 3072 bytes -create index idx3 on worklog5743_8(a2(3072)); -Warnings: -Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release -show warnings; -Level Code Message -Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release -create index idx4 on worklog5743_8(a1, a2(3069)); -ERROR 42000: Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Error 1071 Specified key was too long; max key length is 3072 bytes -create index idx5 on worklog5743_8(a1, a2(3068)); -show warnings; -Level Code Message -create index idx6 on worklog5743_8(a1, a2(2000), a3(1069)); -ERROR 42000: Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Error 1071 Specified key was too long; max key length is 3072 bytes -create index idx7 on worklog5743_8(a1, a2(2000), a3(1068)); -show warnings; -Level Code Message -set global innodb_large_prefix=0; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx1 on worklog5743_16(a2(1000)); -Warnings: -Note 1071 Specified key was too long; max key length is 767 bytes -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 767 bytes -set global innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -create index idx2 on worklog5743_16(a2(3073)); -Warnings: -Note 1071 Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Note 1071 Specified key was too long; max key length is 3072 bytes -create index idx3 on worklog5743_16(a2(3072)); -Warnings: -Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release -show warnings; -Level Code Message -Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release -create index idx4 on worklog5743_16(a1, a2(3069)); -ERROR 42000: Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Error 1071 Specified key was too long; max key length is 3072 bytes -create index idx5 on worklog5743_16(a1, a2(3068)); -show warnings; -Level Code Message -create index idx6 on worklog5743_16(a1, a2(2000), a3(1069)); -ERROR 42000: Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Error 1071 Specified key was too long; max key length is 3072 bytes -create index idx7 on worklog5743_16(a1, a2(2000), a3(1068)); -show warnings; -Level Code Message -set sql_mode=default; -insert into worklog5743_1 values(9, repeat("a", 10000)); -insert into worklog5743_2 values(9, repeat("a", 10000)); -insert into worklog5743_4 values(9, repeat("a", 10000)); -insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000)); -insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000)); -set global innodb_large_prefix=0; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -insert into worklog5743_1 values(2, repeat("b", 10000)); -insert into worklog5743_2 values(2, repeat("b", 10000)); -insert into worklog5743_4 values(2, repeat("b", 10000)); -insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000)); -insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000)); -set global innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -select a1, left(a2, 20) from worklog5743_1; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -2 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_2; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -2 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_4; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -2 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_8; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -2 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_16; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -2 bbbbbbbbbbbbbbbbbbbb -begin; -update worklog5743_1 set a1 = 1000; -update worklog5743_2 set a1 = 1000; -update worklog5743_4 set a1 = 1000; -update worklog5743_8 set a1 = 1000; -update worklog5743_16 set a1 = 1000; -select a1, left(a2, 20) from worklog5743_1; -a1 left(a2, 20) -1000 aaaaaaaaaaaaaaaaaaaa -1000 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_2; -a1 left(a2, 20) -1000 aaaaaaaaaaaaaaaaaaaa -1000 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_4; -a1 left(a2, 20) -1000 aaaaaaaaaaaaaaaaaaaa -1000 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_8; -a1 left(a2, 20) -1000 aaaaaaaaaaaaaaaaaaaa -1000 bbbbbbbbbbbbbbbbbbbb -select a1, left(a2, 20) from worklog5743_16; -a1 left(a2, 20) -1000 aaaaaaaaaaaaaaaaaaaa -1000 bbbbbbbbbbbbbbbbbbbb -connection con1; -select @@session.tx_isolation; -@@session.tx_isolation -REPEATABLE-READ -explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743_1 ref idx6 idx6 5 const 1 -explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743_2 ref idx6 idx6 5 const 1 -explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743_4 ref idx6 idx6 5 const 1 -explain select a1, left(a2, 20) from worklog5743_8 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743_8 ref idx5,idx7 idx5 5 const 1 -explain select a1, left(a2, 20) from worklog5743_16 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743_16 ref idx5,idx7 idx5 5 const 1 -select a1, left(a2, 20) from worklog5743_1 where a1 = 9; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -select a1, left(a2, 20) from worklog5743_2 where a1 = 9; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -select a1, left(a2, 20) from worklog5743_4 where a1 = 9; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -select a1, left(a2, 20) from worklog5743_8 where a1 = 9; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -select a1, left(a2, 20) from worklog5743_16 where a1 = 9; -a1 left(a2, 20) -9 aaaaaaaaaaaaaaaaaaaa -connection con2; -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -@@session.tx_isolation -READ-UNCOMMITTED -select a1, left(a2, 20) from worklog5743_1 where a1 = 9; -a1 left(a2, 20) -select a1, left(a2, 20) from worklog5743_2 where a1 = 9; -a1 left(a2, 20) -select a1, left(a2, 20) from worklog5743_4 where a1 = 9; -a1 left(a2, 20) -select a1, left(a2, 20) from worklog5743_8 where a1 = 9; -a1 left(a2, 20) -select a1, left(a2, 20) from worklog5743_16 where a1 = 9; -a1 left(a2, 20) -connection default; -rollback; -drop table worklog5743_1; -drop table worklog5743_2; -drop table worklog5743_4; -drop table worklog5743_8; -drop table worklog5743_16; -### Test 5 ### -create table worklog5743(a1 int, -a2 varchar(20000), -a3 varchar(3073), -a4 varchar(3072), -a5 varchar(3069), -a6 varchar(3068)) -ROW_FORMAT=DYNAMIC; -set sql_mode=''; -create index idx1 on worklog5743(a2); -Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes -create index idx2 on worklog5743(a3); -Warnings: -Warning 1071 Specified key was too long; max key length is 3072 bytes -create index idx3 on worklog5743(a4); -show warnings; -Level Code Message -create index idx4 on worklog5743(a1, a2); -ERROR 42000: Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Warning 1071 Specified key was too long; max key length is 3072 bytes -Error 1071 Specified key was too long; max key length is 3072 bytes -create index idx5 on worklog5743(a1, a5); -ERROR 42000: Specified key was too long; max key length is 3072 bytes -show warnings; -Level Code Message -Error 1071 Specified key was too long; max key length is 3072 bytes -create index idx6 on worklog5743(a1, a6); -show warnings; -Level Code Message -show create table worklog5743; -Table Create Table -worklog5743 CREATE TABLE `worklog5743` ( - `a1` int(11) DEFAULT NULL, - `a2` varchar(20000) DEFAULT NULL, - `a3` varchar(3073) DEFAULT NULL, - `a4` varchar(3072) DEFAULT NULL, - `a5` varchar(3069) DEFAULT NULL, - `a6` varchar(3068) DEFAULT NULL, - KEY `idx1` (`a2`(3072)), - KEY `idx2` (`a3`(3072)), - KEY `idx3` (`a4`), - KEY `idx6` (`a1`,`a6`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -set sql_mode=default; -insert into worklog5743 values(9, -repeat("a", 20000), repeat("a", 3073), -repeat("a", 3072), repeat("a", 3069), -repeat("a", 3068)); -begin; -update worklog5743 set a1 = 1000; -connection con1; -select @@session.tx_isolation; -@@session.tx_isolation -REPEATABLE-READ -explain select a1 from worklog5743 where a1 = 9; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743 ref idx6 idx6 5 const 1 Using index -select a1 from worklog5743 where a1 = 9; -a1 -9 -connection con2; -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -@@session.tx_isolation -READ-UNCOMMITTED -select a1 from worklog5743 where a1 = 9; -a1 -connection default; -rollback; -drop table worklog5743; -### Test 6 ### -create table worklog5743(a TEXT not null, primary key (a(1000))) row_format=COMPACT; -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create table worklog5743(a TEXT) row_format=COMPACT; -create index idx on worklog5743(a(768)); -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create index idx on worklog5743(a(767)); -insert into worklog5743 values(repeat("a", 20000)); -begin; -insert into worklog5743 values(repeat("b", 20000)); -update worklog5743 set a = (repeat("x", 25000)); -select @@session.tx_isolation; -@@session.tx_isolation -REPEATABLE-READ -connection con1; -select a = repeat("a", 20000) from worklog5743; -a = repeat("a", 20000) -1 -disconnect con1; -connection con2; -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -@@session.tx_isolation -READ-UNCOMMITTED -select a = repeat("x", 25000) from worklog5743; -a = repeat("x", 25000) -1 -1 -disconnect con2; -connection default; -rollback; -drop table worklog5743; -### Test 7 ### -create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC; -set statement sql_mode = '' for -create index idx1 on worklog5743(a(3073)); -Warnings: -Note 1071 Specified key was too long; max key length is 3072 bytes -create index idx2 on worklog5743(a(3072)); -Warnings: -Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release -show create table worklog5743; -Table Create Table -worklog5743 CREATE TABLE `worklog5743` ( - `a` text NOT NULL, - KEY `idx1` (`a`(3072)), - KEY `idx2` (`a`(3072)) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -drop table worklog5743; -create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT; -create index idx on worklog5743(a(768)); -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create index idx2 on worklog5743(a(767)); -drop table worklog5743; -create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT; -create index idx on worklog5743(a(768)); -ERROR HY000: Index column size too large. The maximum column size is 767 bytes -create index idx2 on worklog5743(a(767)); -drop table worklog5743; -SET GLOBAL innodb_large_prefix=1; -Warnings: -Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html -SET GLOBAL innodb_strict_mode = DEFAULT; diff --git a/mysql-test/suite/innodb_zip/t/bug36172.test b/mysql-test/suite/innodb_zip/t/bug36172.test index 49590f40192..1f6533d07bf 100644 --- a/mysql-test/suite/innodb_zip/t/bug36172.test +++ b/mysql-test/suite/innodb_zip/t/bug36172.test @@ -1,12 +1,12 @@ +--source include/innodb_page_size_small.inc # # Test case for bug 36172 # --- source include/not_embedded.inc --- source include/have_innodb.inc --- source include/have_innodb_16k.inc +set @file_per_table=@@global.innodb_file_per_table; +SET GLOBAL innodb_file_per_table=on; -SET default_storage_engine=InnoDB; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; # we do not really care about what gets printed, we are only # interested in getting success or failure according to our @@ -15,11 +15,6 @@ SET default_storage_engine=InnoDB; -- disable_query_log -- disable_result_log -let $file_per_table=`select @@innodb_file_per_table`; -SET GLOBAL innodb_file_per_table=on; - -DROP TABLE IF EXISTS `table0`; -SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; CREATE TABLE `table0` ( `col0` tinyint(1) DEFAULT NULL, `col1` tinyint(1) DEFAULT NULL, `col2` tinyint(4) DEFAULT NULL, `col3` date DEFAULT NULL, `col4` time DEFAULT NULL, `col5` set('test1','test2','test3') DEFAULT NULL, `col6` time DEFAULT NULL, `col7` text, `col8` decimal(10,0) DEFAULT NULL, `col9` set('test1','test2','test3') DEFAULT NULL, `col10` float DEFAULT NULL, `col11` double DEFAULT NULL, `col12` enum('test1','test2','test3') DEFAULT NULL, `col13` tinyblob, `col14` year(4) DEFAULT NULL, `col15` set('test1','test2','test3') DEFAULT NULL, `col16` decimal(10,0) DEFAULT NULL, `col17` decimal(10,0) DEFAULT NULL, `col18` blob, `col19` datetime DEFAULT NULL, `col20` double DEFAULT NULL, `col21` decimal(10,0) DEFAULT NULL, `col22` datetime DEFAULT NULL, `col23` decimal(10,0) DEFAULT NULL, `col24` decimal(10,0) DEFAULT NULL, `col25` longtext, `col26` tinyblob, `col27` time DEFAULT NULL, `col28` tinyblob, `col29` enum('test1','test2','test3') DEFAULT NULL, `col30` smallint(6) DEFAULT NULL, `col31` double DEFAULT NULL, `col32` float DEFAULT NULL, `col33` char(175) DEFAULT NULL, `col34` tinytext, `col35` tinytext, `col36` tinyblob, `col37` tinyblob, `col38` tinytext, `col39` mediumblob, `col40` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col41` double DEFAULT NULL, `col42` smallint(6) DEFAULT NULL, `col43` longblob, `col44` varchar(80) DEFAULT NULL, `col45` mediumtext, `col46` decimal(10,0) DEFAULT NULL, `col47` bigint(20) DEFAULT NULL, `col48` date DEFAULT NULL, `col49` tinyblob, `col50` date DEFAULT NULL, `col51` tinyint(1) DEFAULT NULL, `col52` mediumint(9) DEFAULT NULL, `col53` float DEFAULT NULL, `col54` tinyblob, `col55` longtext, `col56` smallint(6) DEFAULT NULL, `col57` enum('test1','test2','test3') DEFAULT NULL, `col58` datetime DEFAULT NULL, `col59` mediumtext, `col60` varchar(232) DEFAULT NULL, `col61` decimal(10,0) DEFAULT NULL, `col62` year(4) DEFAULT NULL, `col63` smallint(6) DEFAULT NULL, `col64` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col65` blob, `col66` longblob, `col67` int(11) DEFAULT NULL, `col68` longtext, `col69` enum('test1','test2','test3') DEFAULT NULL, `col70` int(11) DEFAULT NULL, `col71` time DEFAULT NULL, `col72` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col74` varchar(170) DEFAULT NULL, `col75` set('test1','test2','test3') DEFAULT NULL, `col76` tinyblob, `col77` bigint(20) DEFAULT NULL, `col78` decimal(10,0) DEFAULT NULL, `col79` datetime DEFAULT NULL, `col80` year(4) DEFAULT NULL, `col81` decimal(10,0) DEFAULT NULL, `col82` longblob, `col83` text, `col84` char(83) DEFAULT NULL, `col85` decimal(10,0) DEFAULT NULL, `col86` float DEFAULT NULL, `col87` int(11) DEFAULT NULL, `col88` varchar(145) DEFAULT NULL, `col89` date DEFAULT NULL, `col90` decimal(10,0) DEFAULT NULL, `col91` decimal(10,0) DEFAULT NULL, `col92` mediumblob, `col93` time DEFAULT NULL, KEY `idx0` (`col69`,`col90`,`col8`), KEY `idx1` (`col60`), KEY `idx2` (`col60`,`col70`,`col74`), KEY `idx3` (`col22`,`col32`,`col72`,`col30`), KEY `idx4` (`col29`), KEY `idx5` (`col19`,`col45`(143)), KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)), KEY `idx7` (`col48`,`col61`), KEY `idx8` (`col93`), KEY `idx9` (`col31`), KEY `idx10` (`col30`,`col21`), KEY `idx11` (`col67`), KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)), KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)), KEY `idx14` (`col78`), KEY `idx15` (`col63`,`col67`,`col64`), KEY `idx16` (`col17`,`col86`), KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)), KEY `idx18` (`col62`), KEY `idx19` (`col31`,`col57`,`col56`,`col53`), KEY `idx20` (`col46`), KEY `idx21` (`col83`(54)), KEY `idx22` (`col51`,`col7`(120)), KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; SET sql_mode = default; insert ignore into `table0` set `col23` = 7887371.5084383683, `col24` = 4293854615.6906948000, `col25` = 'vitalist', `col26` = 'widespread', `col27` = '3570490', `col28` = 'habitual', `col30` = -5471, `col31` = 4286985783.6771750000, `col32` = 6354540.9826654866, `col33` = 'defoliation', `col34` = 'logarithms', `col35` = 'tegument\'s', `col36` = 'scouting\'s', `col37` = 'intermittency', `col38` = 'elongates', `col39` = 'prophecies', `col40` = '20560103035939', `col41` = 4292809130.0544143000, `col42` = 22057, `col43` = 'Hess\'s', `col44` = 'bandstand', `col45` = 'phenylketonuria', `col46` = 6338767.4018677324, `col47` = 5310247, `col48` = '12592418', `col49` = 'churchman\'s', `col50` = '32226125', `col51` = -58, `col52` = -6207968, `col53` = 1244839.3255104220, `col54` = 'robotized', `col55` = 'monotonous', `col56` = -26909, `col58` = '20720107023550', `col59` = 'suggestiveness\'s', `col60` = 'gemology', `col61` = 4287800670.2229986000, `col62` = '1944', `col63` = -16827, `col64` = '20700107212324', `col65` = 'Nicolais', `col66` = 'apteryx', `col67` = 6935317, `col68` = 'stroganoff', `col70` = 3316430, `col71` = '3277608', `col72` = '19300511045918', `col73` = '20421201003327', `col74` = 'attenuant', `col75` = '15173', `col76` = 'upstroke\'s', `col77` = 8118987, `col78` = 6791516.2735374002, `col79` = '20780701144624', `col80` = '2134', `col81` = 4290682351.3127537000, `col82` = 'unexplainably', `col83` = 'Storm', `col84` = 'Greyso\'s', `col85` = 4289119212.4306774000, `col86` = 7617575.8796655172, `col87` = -6325335, `col88` = 'fondue\'s', `col89` = '40608940', `col90` = 1659421.8093508712, `col91` = 8346904.6584368423, `col92` = 'reloads', `col93` = '5188366'; @@ -27,4 +22,6 @@ CHECK TABLE table0 EXTENDED; INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col60` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278'; CHECK TABLE table0 EXTENDED; DROP TABLE table0; -EVAL SET GLOBAL innodb_file_per_table=$file_per_table; +-- enable_query_log +-- enable_result_log +SET GLOBAL innodb_file_per_table=@file_per_table; diff --git a/mysql-test/suite/innodb_zip/t/cmp_drop_table.test b/mysql-test/suite/innodb_zip/t/cmp_drop_table.test index 145f55bb160..ae6bfd9fb59 100644 --- a/mysql-test/suite/innodb_zip/t/cmp_drop_table.test +++ b/mysql-test/suite/innodb_zip/t/cmp_drop_table.test @@ -1,13 +1,15 @@ --- source include/have_innodb.inc --- source include/have_innodb_16k.inc +-- source include/innodb_page_size_small.inc +# lazy eviction might not be lazy enough when key rotation +# scans through pages +-- source include/not_encrypted.inc let $per_table=`select @@innodb_file_per_table`; -- let $query_i_s = SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0 set global innodb_file_per_table=on; - -create table t1(a text) engine=innodb key_block_size=8; + +create table t1(a text) engine=innodb key_block_size=4; -- disable_query_log @@ -20,13 +22,13 @@ while ($i) } -- enable_query_log -# we should be using some 8K pages +# we should be using some 4K pages -- eval $query_i_s drop table t1; # because of lazy eviction at drop table there should still be some -# used 8K pages +# used 4K pages -- eval $query_i_s # create a non-compressed table and insert enough into it to evict @@ -44,7 +46,7 @@ while ($i) -- enable_query_log -# now there should be no 8K pages in the buffer pool +# now there should be no 4K pages in the buffer pool -- eval $query_i_s drop table t2; diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug36169.opt b/mysql-test/suite/innodb_zip/t/innodb_bug36169.opt deleted file mode 100644 index 3a4e594f382..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_bug36169.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb_large_prefix=ON
\ No newline at end of file diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug36169.test b/mysql-test/suite/innodb_zip/t/innodb_bug36169.test deleted file mode 100644 index 6a9b2099fa8..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_bug36169.test +++ /dev/null @@ -1,1153 +0,0 @@ ---source include/innodb_page_size_small.inc -# -# Bug#36169 create innodb compressed table with too large row size crashed -# http://bugs.mysql.com/36169 -# - -call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size .* for a record on index leaf page."); - -# -# The following is copied from http://bugs.mysql.com/36169 -# (http://bugs.mysql.com/file.php?id=9121) -# Probably it can be simplified but that is not obvious. -# - -# we care only that the following SQL commands do produce errors -# as expected and do not crash the server --- disable_query_log --- disable_result_log - -# Generating 10 tables -# Creating a table with 94 columns and 24 indexes -DROP TABLE IF EXISTS `table0`; -set innodb_strict_mode=on; ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE IF NOT EXISTS `table0` -(`col0` BOOL, -`col1` BOOL, -`col2` TINYINT, -`col3` DATE, -`col4` TIME, -`col5` SET ('test1','test2','test3'), -`col6` TIME, -`col7` TEXT, -`col8` DECIMAL, -`col9` SET ('test1','test2','test3'), -`col10` FLOAT, -`col11` DOUBLE PRECISION, -`col12` ENUM ('test1','test2','test3'), -`col13` TINYBLOB, -`col14` YEAR, -`col15` SET ('test1','test2','test3'), -`col16` NUMERIC, -`col17` NUMERIC, -`col18` BLOB, -`col19` DATETIME, -`col20` DOUBLE PRECISION, -`col21` DECIMAL, -`col22` DATETIME, -`col23` NUMERIC, -`col24` NUMERIC, -`col25` LONGTEXT, -`col26` TINYBLOB, -`col27` TIME, -`col28` TINYBLOB, -`col29` ENUM ('test1','test2','test3'), -`col30` SMALLINT, -`col31` REAL, -`col32` FLOAT, -`col33` CHAR (175), -`col34` TINYTEXT, -`col35` TINYTEXT, -`col36` TINYBLOB, -`col37` TINYBLOB, -`col38` TINYTEXT, -`col39` MEDIUMBLOB, -`col40` TIMESTAMP, -`col41` DOUBLE, -`col42` SMALLINT, -`col43` LONGBLOB, -`col44` VARCHAR (80), -`col45` MEDIUMTEXT, -`col46` NUMERIC, -`col47` BIGINT, -`col48` DATE, -`col49` TINYBLOB, -`col50` DATE, -`col51` BOOL, -`col52` MEDIUMINT, -`col53` FLOAT, -`col54` TINYBLOB, -`col55` LONGTEXT, -`col56` SMALLINT, -`col57` ENUM ('test1','test2','test3'), -`col58` DATETIME, -`col59` MEDIUMTEXT, -`col60` VARCHAR (232), -`col61` NUMERIC, -`col62` YEAR, -`col63` SMALLINT, -`col64` TIMESTAMP, -`col65` BLOB, -`col66` LONGBLOB, -`col67` INT, -`col68` LONGTEXT, -`col69` ENUM ('test1','test2','test3'), -`col70` INT, -`col71` TIME, -`col72` TIMESTAMP, -`col73` TIMESTAMP, -`col74` VARCHAR (170), -`col75` SET ('test1','test2','test3'), -`col76` TINYBLOB, -`col77` BIGINT, -`col78` NUMERIC, -`col79` DATETIME, -`col80` YEAR, -`col81` NUMERIC, -`col82` LONGBLOB, -`col83` TEXT, -`col84` CHAR (83), -`col85` DECIMAL, -`col86` FLOAT, -`col87` INT, -`col88` VARCHAR (145), -`col89` DATE, -`col90` DECIMAL, -`col91` DECIMAL, -`col92` MEDIUMBLOB, -`col93` TIME, -KEY `idx0` (`col69`,`col90`,`col8`), -KEY `idx1` (`col60`), -KEY `idx2` (`col60`,`col70`,`col74`), -KEY `idx3` (`col22`,`col32`,`col72`,`col30`), -KEY `idx4` (`col29`), -KEY `idx5` (`col19`,`col45`(143)), -KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)), -KEY `idx7` (`col48`,`col61`), -KEY `idx8` (`col93`), -KEY `idx9` (`col31`), -KEY `idx10` (`col30`,`col21`), -KEY `idx11` (`col67`), -KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)), -KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)), -KEY `idx14` (`col78`), -KEY `idx15` (`col63`,`col67`,`col64`), -KEY `idx16` (`col17`,`col86`), -KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)), -KEY `idx18` (`col62`), -KEY `idx19` (`col31`,`col57`,`col56`,`col53`), -KEY `idx20` (`col46`), -KEY `idx21` (`col83`(54)), -KEY `idx22` (`col51`,`col7`(120)), -KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`) -)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -# Creating a table with 10 columns and 32 indexes -DROP TABLE IF EXISTS `table1`; ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE IF NOT EXISTS `table1` -(`col0` CHAR (113), -`col1` FLOAT, -`col2` BIGINT, -`col3` DECIMAL, -`col4` BLOB, -`col5` LONGTEXT, -`col6` SET ('test1','test2','test3'), -`col7` BIGINT, -`col8` BIGINT, -`col9` TINYBLOB, -KEY `idx0` (`col5`(101),`col7`,`col8`), -KEY `idx1` (`col8`), -KEY `idx2` (`col4`(177),`col9`(126),`col6`,`col3`), -KEY `idx3` (`col5`(160)), -KEY `idx4` (`col9`(242)), -KEY `idx5` (`col4`(139),`col2`,`col3`), -KEY `idx6` (`col7`), -KEY `idx7` (`col6`,`col2`,`col0`,`col3`), -KEY `idx8` (`col9`(66)), -KEY `idx9` (`col5`(253)), -KEY `idx10` (`col1`,`col7`,`col2`), -KEY `idx11` (`col9`(242),`col0`,`col8`,`col5`(163)), -KEY `idx12` (`col8`), -KEY `idx13` (`col0`,`col9`(37)), -KEY `idx14` (`col0`), -KEY `idx15` (`col5`(111)), -KEY `idx16` (`col8`,`col0`,`col5`(13)), -KEY `idx17` (`col4`(139)), -KEY `idx18` (`col5`(189),`col2`,`col3`,`col9`(136)), -KEY `idx19` (`col0`,`col3`,`col1`,`col8`), -KEY `idx20` (`col8`), -KEY `idx21` (`col0`,`col7`,`col9`(227),`col3`), -KEY `idx22` (`col0`), -KEY `idx23` (`col2`), -KEY `idx24` (`col3`), -KEY `idx25` (`col2`,`col3`), -KEY `idx26` (`col0`), -KEY `idx27` (`col5`(254)), -KEY `idx28` (`col3`), -KEY `idx29` (`col3`), -KEY `idx30` (`col7`,`col3`,`col0`,`col4`(220)), -KEY `idx31` (`col4`(1),`col0`) -)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -# Creating a table with 141 columns and 18 indexes -DROP TABLE IF EXISTS `table2`; ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE IF NOT EXISTS `table2` -(`col0` BOOL, -`col1` MEDIUMINT, -`col2` VARCHAR (209), -`col3` MEDIUMBLOB, -`col4` CHAR (13), -`col5` DOUBLE, -`col6` TINYTEXT, -`col7` REAL, -`col8` SMALLINT, -`col9` BLOB, -`col10` TINYINT, -`col11` DECIMAL, -`col12` BLOB, -`col13` DECIMAL, -`col14` LONGBLOB, -`col15` SMALLINT, -`col16` LONGBLOB, -`col17` TINYTEXT, -`col18` FLOAT, -`col19` CHAR (78), -`col20` MEDIUMTEXT, -`col21` SET ('test1','test2','test3'), -`col22` MEDIUMINT, -`col23` INT, -`col24` MEDIUMBLOB, -`col25` ENUM ('test1','test2','test3'), -`col26` TINYBLOB, -`col27` VARCHAR (116), -`col28` TIMESTAMP, -`col29` BLOB, -`col30` SMALLINT, -`col31` DOUBLE PRECISION, -`col32` DECIMAL, -`col33` DECIMAL, -`col34` TEXT, -`col35` MEDIUMINT, -`col36` MEDIUMINT, -`col37` BIGINT, -`col38` VARCHAR (253), -`col39` TINYBLOB, -`col40` MEDIUMBLOB, -`col41` BIGINT, -`col42` DOUBLE, -`col43` TEXT, -`col44` BLOB, -`col45` TIME, -`col46` MEDIUMINT, -`col47` DOUBLE PRECISION, -`col48` SET ('test1','test2','test3'), -`col49` DOUBLE PRECISION, -`col50` VARCHAR (97), -`col51` TEXT, -`col52` NUMERIC, -`col53` ENUM ('test1','test2','test3'), -`col54` MEDIUMTEXT, -`col55` MEDIUMINT, -`col56` DATETIME, -`col57` DATETIME, -`col58` MEDIUMTEXT, -`col59` CHAR (244), -`col60` LONGBLOB, -`col61` MEDIUMBLOB, -`col62` DOUBLE, -`col63` SMALLINT, -`col64` BOOL, -`col65` SMALLINT, -`col66` VARCHAR (212), -`col67` TIME, -`col68` REAL, -`col69` BOOL, -`col70` BIGINT, -`col71` DATE, -`col72` TINYINT, -`col73` ENUM ('test1','test2','test3'), -`col74` DATE, -`col75` TIME, -`col76` DATETIME, -`col77` BOOL, -`col78` TINYTEXT, -`col79` MEDIUMINT, -`col80` NUMERIC, -`col81` LONGTEXT, -`col82` SET ('test1','test2','test3'), -`col83` DOUBLE PRECISION, -`col84` NUMERIC, -`col85` VARCHAR (184), -`col86` DOUBLE PRECISION, -`col87` MEDIUMTEXT, -`col88` MEDIUMBLOB, -`col89` BOOL, -`col90` SMALLINT, -`col91` TINYINT, -`col92` ENUM ('test1','test2','test3'), -`col93` BOOL, -`col94` TIMESTAMP, -`col95` BOOL, -`col96` MEDIUMTEXT, -`col97` DECIMAL, -`col98` BOOL, -`col99` DECIMAL, -`col100` MEDIUMINT, -`col101` DOUBLE PRECISION, -`col102` TINYINT, -`col103` BOOL, -`col104` MEDIUMINT, -`col105` DECIMAL, -`col106` NUMERIC, -`col107` TIMESTAMP, -`col108` MEDIUMBLOB, -`col109` TINYBLOB, -`col110` SET ('test1','test2','test3'), -`col111` YEAR, -`col112` TIMESTAMP, -`col113` CHAR (201), -`col114` BOOL, -`col115` TINYINT, -`col116` DOUBLE, -`col117` TINYINT, -`col118` TIMESTAMP, -`col119` SET ('test1','test2','test3'), -`col120` SMALLINT, -`col121` TINYBLOB, -`col122` TIMESTAMP, -`col123` BLOB, -`col124` DATE, -`col125` SMALLINT, -`col126` ENUM ('test1','test2','test3'), -`col127` MEDIUMBLOB, -`col128` DOUBLE PRECISION, -`col129` REAL, -`col130` VARCHAR (159), -`col131` MEDIUMBLOB, -`col132` BIGINT, -`col133` INT, -`col134` SET ('test1','test2','test3'), -`col135` CHAR (198), -`col136` SET ('test1','test2','test3'), -`col137` MEDIUMTEXT, -`col138` SMALLINT, -`col139` BLOB, -`col140` LONGBLOB, -KEY `idx0` (`col14`(139),`col24`(208),`col38`,`col35`), -KEY `idx1` (`col48`,`col118`,`col29`(131),`col100`), -KEY `idx2` (`col86`,`col67`,`col43`(175)), -KEY `idx3` (`col19`), -KEY `idx4` (`col40`(220),`col67`), -KEY `idx5` (`col99`,`col56`), -KEY `idx6` (`col68`,`col28`,`col137`(157)), -KEY `idx7` (`col51`(160),`col99`,`col45`,`col39`(9)), -KEY `idx8` (`col15`,`col52`,`col90`,`col94`), -KEY `idx9` (`col24`(3),`col139`(248),`col108`(118),`col41`), -KEY `idx10` (`col36`,`col92`,`col114`), -KEY `idx11` (`col115`,`col9`(116)), -KEY `idx12` (`col130`,`col93`,`col134`), -KEY `idx13` (`col123`(65)), -KEY `idx14` (`col44`(90),`col86`,`col119`), -KEY `idx15` (`col69`), -KEY `idx16` (`col132`,`col81`(118),`col18`), -KEY `idx17` (`col24`(250),`col7`,`col92`,`col45`) -)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -# Creating a table with 199 columns and 1 indexes -DROP TABLE IF EXISTS `table3`; ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE IF NOT EXISTS `table3` -(`col0` SMALLINT, -`col1` SET ('test1','test2','test3'), -`col2` TINYTEXT, -`col3` DOUBLE, -`col4` NUMERIC, -`col5` DATE, -`col6` BIGINT, -`col7` DOUBLE, -`col8` TEXT, -`col9` INT, -`col10` REAL, -`col11` TINYINT, -`col12` NUMERIC, -`col13` NUMERIC, -`col14` TIME, -`col15` DOUBLE, -`col16` REAL, -`col17` MEDIUMBLOB, -`col18` YEAR, -`col19` TINYTEXT, -`col20` YEAR, -`col21` CHAR (250), -`col22` TINYINT, -`col23` TINYINT, -`col24` SMALLINT, -`col25` DATETIME, -`col26` MEDIUMINT, -`col27` LONGBLOB, -`col28` VARCHAR (106), -`col29` FLOAT, -`col30` MEDIUMTEXT, -`col31` TINYBLOB, -`col32` BIGINT, -`col33` YEAR, -`col34` REAL, -`col35` MEDIUMBLOB, -`col36` LONGTEXT, -`col37` LONGBLOB, -`col38` BIGINT, -`col39` FLOAT, -`col40` TIME, -`col41` DATETIME, -`col42` BOOL, -`col43` BIGINT, -`col44` SMALLINT, -`col45` TIME, -`col46` DOUBLE PRECISION, -`col47` TIME, -`col48` TINYTEXT, -`col49` DOUBLE PRECISION, -`col50` BIGINT, -`col51` NUMERIC, -`col52` TINYBLOB, -`col53` DATE, -`col54` DECIMAL, -`col55` SMALLINT, -`col56` TINYTEXT, -`col57` ENUM ('test1','test2','test3'), -`col58` YEAR, -`col59` TIME, -`col60` TINYINT, -`col61` DECIMAL, -`col62` DOUBLE, -`col63` DATE, -`col64` LONGTEXT, -`col65` DOUBLE, -`col66` VARCHAR (88), -`col67` MEDIUMTEXT, -`col68` DATE, -`col69` MEDIUMINT, -`col70` DECIMAL, -`col71` MEDIUMTEXT, -`col72` LONGTEXT, -`col73` REAL, -`col74` DOUBLE, -`col75` TIME, -`col76` DATE, -`col77` DECIMAL, -`col78` MEDIUMBLOB, -`col79` NUMERIC, -`col80` BIGINT, -`col81` YEAR, -`col82` SMALLINT, -`col83` MEDIUMINT, -`col84` TINYINT, -`col85` MEDIUMBLOB, -`col86` TIME, -`col87` MEDIUMBLOB, -`col88` LONGTEXT, -`col89` BOOL, -`col90` BLOB, -`col91` LONGBLOB, -`col92` YEAR, -`col93` BLOB, -`col94` INT, -`col95` TINYTEXT, -`col96` TINYINT, -`col97` DECIMAL, -`col98` ENUM ('test1','test2','test3'), -`col99` MEDIUMINT, -`col100` TINYINT, -`col101` MEDIUMBLOB, -`col102` TINYINT, -`col103` SET ('test1','test2','test3'), -`col104` TIMESTAMP, -`col105` TEXT, -`col106` DATETIME, -`col107` MEDIUMTEXT, -`col108` CHAR (220), -`col109` TIME, -`col110` VARCHAR (131), -`col111` DECIMAL, -`col112` FLOAT, -`col113` SMALLINT, -`col114` BIGINT, -`col115` LONGBLOB, -`col116` SET ('test1','test2','test3'), -`col117` ENUM ('test1','test2','test3'), -`col118` BLOB, -`col119` MEDIUMTEXT, -`col120` SET ('test1','test2','test3'), -`col121` DATETIME, -`col122` FLOAT, -`col123` VARCHAR (242), -`col124` YEAR, -`col125` MEDIUMBLOB, -`col126` TIME, -`col127` BOOL, -`col128` TINYBLOB, -`col129` DOUBLE, -`col130` TINYINT, -`col131` BIGINT, -`col132` SMALLINT, -`col133` INT, -`col134` DOUBLE PRECISION, -`col135` MEDIUMBLOB, -`col136` SET ('test1','test2','test3'), -`col137` TINYTEXT, -`col138` DOUBLE PRECISION, -`col139` NUMERIC, -`col140` BLOB, -`col141` SET ('test1','test2','test3'), -`col142` INT, -`col143` VARCHAR (26), -`col144` BLOB, -`col145` REAL, -`col146` SET ('test1','test2','test3'), -`col147` LONGBLOB, -`col148` TEXT, -`col149` BLOB, -`col150` CHAR (189), -`col151` LONGTEXT, -`col152` INT, -`col153` FLOAT, -`col154` LONGTEXT, -`col155` DATE, -`col156` LONGBLOB, -`col157` TINYBLOB, -`col158` REAL, -`col159` DATE, -`col160` TIME, -`col161` YEAR, -`col162` DOUBLE, -`col163` VARCHAR (90), -`col164` FLOAT, -`col165` NUMERIC, -`col166` ENUM ('test1','test2','test3'), -`col167` DOUBLE PRECISION, -`col168` DOUBLE PRECISION, -`col169` TINYBLOB, -`col170` TIME, -`col171` SMALLINT, -`col172` TINYTEXT, -`col173` SMALLINT, -`col174` DOUBLE, -`col175` VARCHAR (14), -`col176` VARCHAR (90), -`col177` REAL, -`col178` MEDIUMINT, -`col179` TINYBLOB, -`col180` FLOAT, -`col181` TIMESTAMP, -`col182` REAL, -`col183` DOUBLE PRECISION, -`col184` BIGINT, -`col185` INT, -`col186` MEDIUMTEXT, -`col187` TIME, -`col188` FLOAT, -`col189` TIME, -`col190` INT, -`col191` FLOAT, -`col192` MEDIUMINT, -`col193` TINYINT, -`col194` MEDIUMTEXT, -`col195` DATE, -`col196` TIME, -`col197` YEAR, -`col198` CHAR (206), -KEY `idx0` (`col39`,`col23`) -)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -# Creating a table with 133 columns and 16 indexes -DROP TABLE IF EXISTS `table4`; ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE IF NOT EXISTS `table4` -(`col0` VARCHAR (60), -`col1` NUMERIC, -`col2` LONGTEXT, -`col3` MEDIUMTEXT, -`col4` LONGTEXT, -`col5` LONGBLOB, -`col6` LONGBLOB, -`col7` DATETIME, -`col8` TINYTEXT, -`col9` BLOB, -`col10` BOOL, -`col11` BIGINT, -`col12` TEXT, -`col13` VARCHAR (213), -`col14` TINYBLOB, -`col15` BOOL, -`col16` MEDIUMTEXT, -`col17` DOUBLE, -`col18` TEXT, -`col19` BLOB, -`col20` SET ('test1','test2','test3'), -`col21` TINYINT, -`col22` DATETIME, -`col23` TINYINT, -`col24` ENUM ('test1','test2','test3'), -`col25` REAL, -`col26` BOOL, -`col27` FLOAT, -`col28` LONGBLOB, -`col29` DATETIME, -`col30` FLOAT, -`col31` SET ('test1','test2','test3'), -`col32` LONGBLOB, -`col33` NUMERIC, -`col34` YEAR, -`col35` VARCHAR (146), -`col36` BIGINT, -`col37` DATETIME, -`col38` DATE, -`col39` SET ('test1','test2','test3'), -`col40` CHAR (112), -`col41` FLOAT, -`col42` YEAR, -`col43` TIME, -`col44` DOUBLE, -`col45` NUMERIC, -`col46` FLOAT, -`col47` DECIMAL, -`col48` BIGINT, -`col49` DECIMAL, -`col50` YEAR, -`col51` MEDIUMTEXT, -`col52` LONGBLOB, -`col53` SET ('test1','test2','test3'), -`col54` BLOB, -`col55` FLOAT, -`col56` REAL, -`col57` REAL, -`col58` TEXT, -`col59` MEDIUMBLOB, -`col60` INT, -`col61` INT, -`col62` DATE, -`col63` TEXT, -`col64` DATE, -`col65` ENUM ('test1','test2','test3'), -`col66` DOUBLE PRECISION, -`col67` TINYTEXT, -`col68` TINYBLOB, -`col69` FLOAT, -`col70` BLOB, -`col71` DATETIME, -`col72` DOUBLE, -`col73` LONGTEXT, -`col74` TIME, -`col75` DATETIME, -`col76` VARCHAR (122), -`col77` MEDIUMTEXT, -`col78` MEDIUMTEXT, -`col79` BOOL, -`col80` LONGTEXT, -`col81` TINYTEXT, -`col82` NUMERIC, -`col83` DOUBLE PRECISION, -`col84` DATE, -`col85` YEAR, -`col86` BLOB, -`col87` TINYTEXT, -`col88` DOUBLE PRECISION, -`col89` MEDIUMINT, -`col90` MEDIUMTEXT, -`col91` NUMERIC, -`col92` DATETIME, -`col93` NUMERIC, -`col94` SET ('test1','test2','test3'), -`col95` TINYTEXT, -`col96` SET ('test1','test2','test3'), -`col97` YEAR, -`col98` MEDIUMINT, -`col99` TEXT, -`col100` TEXT, -`col101` TIME, -`col102` VARCHAR (225), -`col103` TINYTEXT, -`col104` TEXT, -`col105` MEDIUMTEXT, -`col106` TINYINT, -`col107` TEXT, -`col108` LONGBLOB, -`col109` LONGTEXT, -`col110` TINYTEXT, -`col111` CHAR (56), -`col112` YEAR, -`col113` ENUM ('test1','test2','test3'), -`col114` TINYBLOB, -`col115` DATETIME, -`col116` DATE, -`col117` TIME, -`col118` MEDIUMTEXT, -`col119` DOUBLE PRECISION, -`col120` FLOAT, -`col121` TIMESTAMP, -`col122` MEDIUMINT, -`col123` YEAR, -`col124` DATE, -`col125` TEXT, -`col126` FLOAT, -`col127` TINYTEXT, -`col128` BOOL, -`col129` NUMERIC, -`col130` TIMESTAMP, -`col131` INT, -`col132` MEDIUMBLOB, -KEY `idx0` (`col130`), -KEY `idx1` (`col30`,`col55`,`col19`(31)), -KEY `idx2` (`col104`(186)), -KEY `idx3` (`col131`), -KEY `idx4` (`col64`,`col93`,`col2`(11)), -KEY `idx5` (`col34`,`col121`,`col22`), -KEY `idx6` (`col33`,`col55`,`col83`), -KEY `idx7` (`col17`,`col87`(245),`col99`(17)), -KEY `idx8` (`col65`,`col120`), -KEY `idx9` (`col82`), -KEY `idx10` (`col9`(72)), -KEY `idx11` (`col88`), -KEY `idx12` (`col128`,`col9`(200),`col71`,`col66`), -KEY `idx13` (`col77`(126)), -KEY `idx14` (`col105`(26),`col13`,`col117`), -KEY `idx15` (`col4`(246),`col130`,`col115`,`col3`(141)) -)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -# Creating a table with 176 columns and 13 indexes -DROP TABLE IF EXISTS `table5`; ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE IF NOT EXISTS `table5` -(`col0` MEDIUMTEXT, -`col1` VARCHAR (90), -`col2` TINYTEXT, -`col3` TIME, -`col4` BOOL, -`col5` TINYTEXT, -`col6` BOOL, -`col7` TIMESTAMP, -`col8` TINYBLOB, -`col9` TINYINT, -`col10` YEAR, -`col11` SET ('test1','test2','test3'), -`col12` TEXT, -`col13` CHAR (248), -`col14` BIGINT, -`col15` TEXT, -`col16` TINYINT, -`col17` NUMERIC, -`col18` SET ('test1','test2','test3'), -`col19` LONGBLOB, -`col20` FLOAT, -`col21` INT, -`col22` TEXT, -`col23` BOOL, -`col24` DECIMAL, -`col25` DOUBLE PRECISION, -`col26` FLOAT, -`col27` TINYBLOB, -`col28` NUMERIC, -`col29` MEDIUMBLOB, -`col30` DATE, -`col31` LONGTEXT, -`col32` DATE, -`col33` FLOAT, -`col34` BIGINT, -`col35` TINYTEXT, -`col36` MEDIUMTEXT, -`col37` TIME, -`col38` INT, -`col39` TINYINT, -`col40` SET ('test1','test2','test3'), -`col41` CHAR (130), -`col42` SMALLINT, -`col43` INT, -`col44` MEDIUMTEXT, -`col45` VARCHAR (126), -`col46` INT, -`col47` DOUBLE PRECISION, -`col48` BIGINT, -`col49` MEDIUMTEXT, -`col50` TINYBLOB, -`col51` MEDIUMINT, -`col52` TEXT, -`col53` VARCHAR (208), -`col54` VARCHAR (207), -`col55` NUMERIC, -`col56` DATETIME, -`col57` ENUM ('test1','test2','test3'), -`col58` NUMERIC, -`col59` TINYBLOB, -`col60` VARCHAR (73), -`col61` MEDIUMTEXT, -`col62` TINYBLOB, -`col63` DATETIME, -`col64` NUMERIC, -`col65` MEDIUMINT, -`col66` DATETIME, -`col67` NUMERIC, -`col68` TINYINT, -`col69` VARCHAR (58), -`col70` DECIMAL, -`col71` MEDIUMTEXT, -`col72` DATE, -`col73` TIME, -`col74` DOUBLE PRECISION, -`col75` DECIMAL, -`col76` MEDIUMBLOB, -`col77` REAL, -`col78` YEAR, -`col79` YEAR, -`col80` LONGBLOB, -`col81` BLOB, -`col82` BIGINT, -`col83` ENUM ('test1','test2','test3'), -`col84` NUMERIC, -`col85` SET ('test1','test2','test3'), -`col86` MEDIUMTEXT, -`col87` LONGBLOB, -`col88` TIME, -`col89` ENUM ('test1','test2','test3'), -`col90` DECIMAL, -`col91` FLOAT, -`col92` DATETIME, -`col93` TINYTEXT, -`col94` TIMESTAMP, -`col95` TIMESTAMP, -`col96` TEXT, -`col97` REAL, -`col98` VARCHAR (198), -`col99` TIME, -`col100` TINYINT, -`col101` BIGINT, -`col102` LONGBLOB, -`col103` LONGBLOB, -`col104` MEDIUMINT, -`col105` MEDIUMTEXT, -`col106` TIMESTAMP, -`col107` SMALLINT, -`col108` NUMERIC, -`col109` DECIMAL, -`col110` FLOAT, -`col111` DECIMAL, -`col112` REAL, -`col113` TINYTEXT, -`col114` FLOAT, -`col115` VARCHAR (7), -`col116` LONGTEXT, -`col117` DATE, -`col118` BIGINT, -`col119` TEXT, -`col120` BIGINT, -`col121` BLOB, -`col122` CHAR (110), -`col123` NUMERIC, -`col124` MEDIUMBLOB, -`col125` NUMERIC, -`col126` NUMERIC, -`col127` BOOL, -`col128` TIME, -`col129` TINYBLOB, -`col130` TINYBLOB, -`col131` DATE, -`col132` INT, -`col133` VARCHAR (123), -`col134` CHAR (238), -`col135` VARCHAR (225), -`col136` LONGTEXT, -`col137` LONGBLOB, -`col138` REAL, -`col139` TINYBLOB, -`col140` DATETIME, -`col141` TINYTEXT, -`col142` LONGBLOB, -`col143` BIGINT, -`col144` VARCHAR (236), -`col145` TEXT, -`col146` YEAR, -`col147` DECIMAL, -`col148` TEXT, -`col149` MEDIUMBLOB, -`col150` TINYINT, -`col151` BOOL, -`col152` VARCHAR (72), -`col153` INT, -`col154` VARCHAR (165), -`col155` TINYINT, -`col156` MEDIUMTEXT, -`col157` DOUBLE PRECISION, -`col158` TIME, -`col159` MEDIUMBLOB, -`col160` LONGBLOB, -`col161` DATETIME, -`col162` DOUBLE PRECISION, -`col163` BLOB, -`col164` ENUM ('test1','test2','test3'), -`col165` TIMESTAMP, -`col166` DATE, -`col167` TINYBLOB, -`col168` TINYBLOB, -`col169` LONGBLOB, -`col170` DATETIME, -`col171` BIGINT, -`col172` VARCHAR (30), -`col173` LONGTEXT, -`col174` TIME, -`col175` FLOAT, -KEY `idx0` (`col16`,`col156`(139),`col97`,`col120`), -KEY `idx1` (`col24`,`col0`(108)), -KEY `idx2` (`col117`,`col173`(34),`col132`,`col82`), -KEY `idx3` (`col2`(86)), -KEY `idx4` (`col2`(43)), -KEY `idx5` (`col83`,`col35`(87),`col111`), -KEY `idx6` (`col6`,`col134`,`col92`), -KEY `idx7` (`col56`), -KEY `idx8` (`col30`,`col53`,`col129`(66)), -KEY `idx9` (`col53`,`col113`(211),`col32`,`col15`(75)), -KEY `idx10` (`col34`), -KEY `idx11` (`col126`), -KEY `idx12` (`col24`) -)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -# Creating a table with 179 columns and 46 indexes -DROP TABLE IF EXISTS `table6`; --- error ER_TOO_BIG_ROWSIZE ---error ER_TOO_BIG_ROWSIZE -CREATE TABLE IF NOT EXISTS `table6` -(`col0` ENUM ('test1','test2','test3'), -`col1` MEDIUMBLOB, -`col2` MEDIUMBLOB, -`col3` DATETIME, -`col4` DATE, -`col5` YEAR, -`col6` REAL, -`col7` NUMERIC, -`col8` MEDIUMBLOB, -`col9` TEXT, -`col10` TIMESTAMP, -`col11` DOUBLE, -`col12` DOUBLE, -`col13` SMALLINT, -`col14` TIMESTAMP, -`col15` DECIMAL, -`col16` DATE, -`col17` TEXT, -`col18` LONGBLOB, -`col19` BIGINT, -`col20` FLOAT, -`col21` DATETIME, -`col22` TINYINT, -`col23` MEDIUMBLOB, -`col24` SET ('test1','test2','test3'), -`col25` TIME, -`col26` TEXT, -`col27` LONGTEXT, -`col28` BIGINT, -`col29` REAL, -`col30` YEAR, -`col31` MEDIUMBLOB, -`col32` MEDIUMINT, -`col33` FLOAT, -`col34` TEXT, -`col35` DATE, -`col36` TIMESTAMP, -`col37` REAL, -`col38` BLOB, -`col39` BLOB, -`col40` BLOB, -`col41` TINYBLOB, -`col42` INT, -`col43` TINYINT, -`col44` REAL, -`col45` BIGINT, -`col46` TIMESTAMP, -`col47` BLOB, -`col48` ENUM ('test1','test2','test3'), -`col49` BOOL, -`col50` CHAR (109), -`col51` DOUBLE, -`col52` DOUBLE PRECISION, -`col53` ENUM ('test1','test2','test3'), -`col54` FLOAT, -`col55` DOUBLE PRECISION, -`col56` CHAR (166), -`col57` TEXT, -`col58` TIME, -`col59` DECIMAL, -`col60` TEXT, -`col61` ENUM ('test1','test2','test3'), -`col62` LONGTEXT, -`col63` YEAR, -`col64` DOUBLE, -`col65` CHAR (87), -`col66` DATE, -`col67` BOOL, -`col68` MEDIUMBLOB, -`col69` DATETIME, -`col70` DECIMAL, -`col71` TIME, -`col72` REAL, -`col73` LONGTEXT, -`col74` BLOB, -`col75` REAL, -`col76` INT, -`col77` INT, -`col78` FLOAT, -`col79` DOUBLE, -`col80` MEDIUMINT, -`col81` ENUM ('test1','test2','test3'), -`col82` VARCHAR (221), -`col83` BIGINT, -`col84` TINYINT, -`col85` BIGINT, -`col86` FLOAT, -`col87` MEDIUMBLOB, -`col88` CHAR (126), -`col89` MEDIUMBLOB, -`col90` DATETIME, -`col91` TINYINT, -`col92` DOUBLE, -`col93` NUMERIC, -`col94` DATE, -`col95` BLOB, -`col96` DATETIME, -`col97` TIME, -`col98` LONGBLOB, -`col99` INT, -`col100` SET ('test1','test2','test3'), -`col101` TINYBLOB, -`col102` INT, -`col103` MEDIUMBLOB, -`col104` MEDIUMTEXT, -`col105` FLOAT, -`col106` TINYBLOB, -`col107` VARCHAR (26), -`col108` TINYINT, -`col109` TIME, -`col110` TINYBLOB, -`col111` LONGBLOB, -`col112` TINYTEXT, -`col113` FLOAT, -`col114` TINYINT, -`col115` NUMERIC, -`col116` TIME, -`col117` SET ('test1','test2','test3'), -`col118` DATE, -`col119` SMALLINT, -`col120` BLOB, -`col121` TINYTEXT, -`col122` REAL, -`col123` YEAR, -`col124` REAL, -`col125` BOOL, -`col126` BLOB, -`col127` REAL, -`col128` MEDIUMBLOB, -`col129` TIMESTAMP, -`col130` LONGBLOB, -`col131` MEDIUMBLOB, -`col132` YEAR, -`col133` YEAR, -`col134` INT, -`col135` MEDIUMINT, -`col136` MEDIUMINT, -`col137` TINYTEXT, -`col138` TINYBLOB, -`col139` BLOB, -`col140` SET ('test1','test2','test3'), -`col141` ENUM ('test1','test2','test3'), -`col142` ENUM ('test1','test2','test3'), -`col143` TINYTEXT, -`col144` DATETIME, -`col145` TEXT, -`col146` DOUBLE PRECISION, -`col147` DECIMAL, -`col148` MEDIUMTEXT, -`col149` TINYTEXT, -`col150` SET ('test1','test2','test3'), -`col151` MEDIUMTEXT, -`col152` CHAR (126), -`col153` DOUBLE, -`col154` CHAR (243), -`col155` SET ('test1','test2','test3'), -`col156` SET ('test1','test2','test3'), -`col157` DATETIME, -`col158` DOUBLE, -`col159` NUMERIC, -`col160` DECIMAL, -`col161` FLOAT, -`col162` LONGBLOB, -`col163` LONGTEXT, -`col164` INT, -`col165` TIME, -`col166` CHAR (27), -`col167` VARCHAR (63), -`col168` TEXT, -`col169` TINYBLOB, -`col170` TINYBLOB, -`col171` ENUM ('test1','test2','test3'), -`col172` INT, -`col173` TIME, -`col174` DECIMAL, -`col175` DOUBLE, -`col176` MEDIUMBLOB, -`col177` LONGBLOB, -`col178` CHAR (43), -KEY `idx0` (`col131`(219)), -KEY `idx1` (`col67`,`col122`,`col59`,`col87`(33)), -KEY `idx2` (`col83`,`col42`,`col57`(152)), -KEY `idx3` (`col106`(124)), -KEY `idx4` (`col173`,`col80`,`col165`,`col89`(78)), -KEY `idx5` (`col174`,`col145`(108),`col23`(228),`col141`), -KEY `idx6` (`col157`,`col140`), -KEY `idx7` (`col130`(188),`col15`), -KEY `idx8` (`col52`), -KEY `idx9` (`col144`), -KEY `idx10` (`col155`), -KEY `idx11` (`col62`(230),`col1`(109)), -KEY `idx12` (`col151`(24),`col95`(85)), -KEY `idx13` (`col114`), -KEY `idx14` (`col42`,`col98`(56),`col146`), -KEY `idx15` (`col147`,`col39`(254),`col35`), -KEY `idx16` (`col79`), -KEY `idx17` (`col65`), -KEY `idx18` (`col149`(165),`col168`(119),`col32`,`col117`), -KEY `idx19` (`col64`), -KEY `idx20` (`col93`), -KEY `idx21` (`col64`,`col113`,`col104`(182)), -KEY `idx22` (`col52`,`col111`(189)), -KEY `idx23` (`col45`), -KEY `idx24` (`col154`,`col107`,`col110`(159)), -KEY `idx25` (`col149`(1),`col87`(131)), -KEY `idx26` (`col58`,`col115`,`col63`), -KEY `idx27` (`col95`(9),`col0`,`col87`(113)), -KEY `idx28` (`col92`,`col130`(1)), -KEY `idx29` (`col151`(129),`col137`(254),`col13`), -KEY `idx30` (`col49`), -KEY `idx31` (`col28`), -KEY `idx32` (`col83`,`col146`), -KEY `idx33` (`col155`,`col90`,`col17`(245)), -KEY `idx34` (`col174`,`col169`(44),`col107`), -KEY `idx35` (`col113`), -KEY `idx36` (`col52`), -KEY `idx37` (`col16`,`col120`(190)), -KEY `idx38` (`col28`), -KEY `idx39` (`col131`(165)), -KEY `idx40` (`col135`,`col26`(86)), -KEY `idx41` (`col69`,`col94`), -KEY `idx42` (`col105`,`col151`(38),`col97`), -KEY `idx43` (`col88`), -KEY `idx44` (`col176`(100),`col42`,`col73`(189),`col94`), -KEY `idx45` (`col2`(27),`col27`(116)) -)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -DROP TABLE IF EXISTS table0; -DROP TABLE IF EXISTS table1; -DROP TABLE IF EXISTS table2; -DROP TABLE IF EXISTS table3; -DROP TABLE IF EXISTS table4; -DROP TABLE IF EXISTS table5; -DROP TABLE IF EXISTS table6; diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug36172.test b/mysql-test/suite/innodb_zip/t/innodb_bug36172.test deleted file mode 100644 index 6d21d656fd8..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_bug36172.test +++ /dev/null @@ -1,22 +0,0 @@ ---source include/innodb_page_size_small.inc -# -# Test case for bug 36172 -# - --- source include/not_embedded.inc - -SET storage_engine=InnoDB; - -# we do not really care about what gets printed, we are only -# interested in getting success or failure according to our -# expectations - --- disable_query_log --- disable_result_log - -CREATE TABLE `table0` ( `col0` tinyint(1) DEFAULT NULL, `col1` tinyint(1) DEFAULT NULL, `col2` tinyint(4) DEFAULT NULL, `col3` date DEFAULT NULL, `col4` time DEFAULT NULL, `col5` set('test1','test2','test3') DEFAULT NULL, `col6` time DEFAULT NULL, `col7` text, `col8` decimal(10,0) DEFAULT NULL, `col9` set('test1','test2','test3') DEFAULT NULL, `col10` float DEFAULT NULL, `col11` double DEFAULT NULL, `col12` enum('test1','test2','test3') DEFAULT NULL, `col13` tinyblob, `col14` year(4) DEFAULT NULL, `col15` set('test1','test2','test3') DEFAULT NULL, `col16` decimal(10,0) DEFAULT NULL, `col17` decimal(10,0) DEFAULT NULL, `col18` blob, `col19` datetime DEFAULT NULL, `col20` double DEFAULT NULL, `col21` decimal(10,0) DEFAULT NULL, `col22` datetime DEFAULT NULL, `col23` decimal(10,0) DEFAULT NULL, `col24` decimal(10,0) DEFAULT NULL, `col25` longtext, `col26` tinyblob, `col27` time DEFAULT NULL, `col28` tinyblob, `col29` enum('test1','test2','test3') DEFAULT NULL, `col30` smallint(6) DEFAULT NULL, `col31` double DEFAULT NULL, `col32` float DEFAULT NULL, `col33` char(175) DEFAULT NULL, `col34` tinytext, `col35` tinytext, `col36` tinyblob, `col37` tinyblob, `col38` tinytext, `col39` mediumblob, `col40` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col41` double DEFAULT NULL, `col42` smallint(6) DEFAULT NULL, `col43` longblob, `col44` varchar(80) DEFAULT NULL, `col45` mediumtext, `col46` decimal(10,0) DEFAULT NULL, `col47` bigint(20) DEFAULT NULL, `col48` date DEFAULT NULL, `col49` tinyblob, `col50` date DEFAULT NULL, `col51` tinyint(1) DEFAULT NULL, `col52` mediumint(9) DEFAULT NULL, `col53` float DEFAULT NULL, `col54` tinyblob, `col55` longtext, `col56` smallint(6) DEFAULT NULL, `col57` enum('test1','test2','test3') DEFAULT NULL, `col58` datetime DEFAULT NULL, `col59` mediumtext, `col60` varchar(232) DEFAULT NULL, `col61` decimal(10,0) DEFAULT NULL, `col62` year(4) DEFAULT NULL, `col63` smallint(6) DEFAULT NULL, `col64` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col65` blob, `col66` longblob, `col67` int(11) DEFAULT NULL, `col68` longtext, `col69` enum('test1','test2','test3') DEFAULT NULL, `col70` int(11) DEFAULT NULL, `col71` time DEFAULT NULL, `col72` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col74` varchar(170) DEFAULT NULL, `col75` set('test1','test2','test3') DEFAULT NULL, `col76` tinyblob, `col77` bigint(20) DEFAULT NULL, `col78` decimal(10,0) DEFAULT NULL, `col79` datetime DEFAULT NULL, `col80` year(4) DEFAULT NULL, `col81` decimal(10,0) DEFAULT NULL, `col82` longblob, `col83` text, `col84` char(83) DEFAULT NULL, `col85` decimal(10,0) DEFAULT NULL, `col86` float DEFAULT NULL, `col87` int(11) DEFAULT NULL, `col88` varchar(145) DEFAULT NULL, `col89` date DEFAULT NULL, `col90` decimal(10,0) DEFAULT NULL, `col91` decimal(10,0) DEFAULT NULL, `col92` mediumblob, `col93` time DEFAULT NULL, KEY `idx0` (`col69`,`col90`,`col8`), KEY `idx1` (`col60`), KEY `idx2` (`col60`,`col70`,`col74`), KEY `idx3` (`col22`,`col32`,`col72`,`col30`), KEY `idx4` (`col29`), KEY `idx5` (`col19`,`col45`(143)), KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)), KEY `idx7` (`col48`,`col61`), KEY `idx8` (`col93`), KEY `idx9` (`col31`), KEY `idx10` (`col30`,`col21`), KEY `idx11` (`col67`), KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)), KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)), KEY `idx14` (`col78`), KEY `idx15` (`col63`,`col67`,`col64`), KEY `idx16` (`col17`,`col86`), KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)), KEY `idx18` (`col62`), KEY `idx19` (`col31`,`col57`,`col56`,`col53`), KEY `idx20` (`col46`), KEY `idx21` (`col83`(54)), KEY `idx22` (`col51`,`col7`(120)), KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; -insert ignore into `table0` set `col23` = 7887371.5084383683, `col24` = 4293854615.6906948000, `col25` = 'vitalist', `col26` = 'widespread', `col27` = '3570490', `col28` = 'habitual', `col30` = -5471, `col31` = 4286985783.6771750000, `col32` = 6354540.9826654866, `col33` = 'defoliation', `col34` = 'logarithms', `col35` = 'tegument\'s', `col36` = 'scouting\'s', `col37` = 'intermittency', `col38` = 'elongates', `col39` = 'prophecies', `col40` = '20560103035939', `col41` = 4292809130.0544143000, `col42` = 22057, `col43` = 'Hess\'s', `col44` = 'bandstand', `col45` = 'phenylketonuria', `col46` = 6338767.4018677324, `col47` = 5310247, `col48` = '12592418', `col49` = 'churchman\'s', `col50` = '32226125', `col51` = -58, `col52` = -6207968, `col53` = 1244839.3255104220, `col54` = 'robotized', `col55` = 'monotonous', `col56` = -26909, `col58` = '20720107023550', `col59` = 'suggestiveness\'s', `col60` = 'gemology', `col61` = 4287800670.2229986000, `col62` = '1944', `col63` = -16827, `col64` = '20700107212324', `col65` = 'Nicolais', `col66` = 'apteryx', `col67` = 6935317, `col68` = 'stroganoff', `col70` = 3316430, `col71` = '3277608', `col72` = '19300511045918', `col73` = '20421201003327', `col74` = 'attenuant', `col75` = '15173', `col76` = 'upstroke\'s', `col77` = 8118987, `col78` = 6791516.2735374002, `col79` = '20780701144624', `col80` = '2134', `col81` = 4290682351.3127537000, `col82` = 'unexplainably', `col83` = 'Storm', `col84` = 'Greyso\'s', `col85` = 4289119212.4306774000, `col86` = 7617575.8796655172, `col87` = -6325335, `col88` = 'fondue\'s', `col89` = '40608940', `col90` = 1659421.8093508712, `col91` = 8346904.6584368423, `col92` = 'reloads', `col93` = '5188366'; -CHECK TABLE table0 EXTENDED; -INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col60` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278'; -CHECK TABLE table0 EXTENDED; -DROP TABLE table0; diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug52745.test b/mysql-test/suite/innodb_zip/t/innodb_bug52745.test deleted file mode 100644 index b7efd0692ca..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_bug52745.test +++ /dev/null @@ -1,100 +0,0 @@ ---source include/innodb_page_size_small.inc - -SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR -CREATE TABLE bug52745 ( - a2 int(10) unsigned DEFAULT NULL, - col37 time DEFAULT NULL, - col38 char(229) CHARACTER SET utf8 DEFAULT NULL, - col39 text, - col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - col41 int(10) unsigned DEFAULT NULL, - col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL, - col43 smallint(5) unsigned zerofill DEFAULT NULL, - col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL, - col45 float unsigned zerofill DEFAULT NULL, - col46 binary(1) DEFAULT NULL, - col47 tinyint(4) DEFAULT NULL, - col48 tinyint(1) DEFAULT NULL, - col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - col50 binary(1) DEFAULT NULL, - col51 double unsigned zerofill DEFAULT NULL, - col52 int(10) unsigned DEFAULT NULL, - col53 time DEFAULT NULL, - col54 double unsigned DEFAULT NULL, - col55 time DEFAULT NULL, - col56 mediumtext CHARACTER SET latin2, - col57 blob, - col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000', - col59 binary(1) DEFAULT NULL, - col60 longblob, - col61 time DEFAULT NULL, - col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci, - col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - col64 int(10) unsigned DEFAULT NULL, - col65 date DEFAULT NULL, - col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - col67 binary(1) DEFAULT NULL, - col68 tinyblob, - col69 date DEFAULT NULL, - col70 tinyint(3) unsigned zerofill DEFAULT NULL, - col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL, - col72 datetime DEFAULT NULL, - col73 smallint(5) unsigned zerofill DEFAULT NULL, - col74 longblob, - col75 bit(34) DEFAULT NULL, - col76 float unsigned zerofill DEFAULT NULL, - col77 year(2) DEFAULT NULL, - col78 tinyint(3) unsigned DEFAULT NULL, - col79 set('msfheowh','tbpxbgf','by','wahnrjw','myqfasxz','rsokyumrt') CHARACTER SET latin2 DEFAULT NULL, - col80 datetime DEFAULT NULL, - col81 smallint(6) DEFAULT NULL, - col82 enum('xtaurnqfqz','rifrse','kuzwpbvb','niisabk','zxavro','rbvasv','','uulrfaove','','') DEFAULT NULL, - col83 bigint(20) unsigned zerofill DEFAULT NULL, - col84 float unsigned zerofill DEFAULT NULL, - col85 double DEFAULT NULL, - col86 enum('ylannv','','vlkhycqc','snke','cxifustp','xiaxaswzp','oxl') CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL, - col87 varbinary(221) DEFAULT NULL, - col88 double unsigned DEFAULT NULL, - col89 float unsigned zerofill DEFAULT NULL, - col90 tinyblob -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -INSERT IGNORE INTO bug52745 SET -col40='0000-00-00 00:00:00', -col51=16547, -col53='7711484', -col54=-28604, -col55='7112612', -col56='wakefulness\'', -col57=repeat('absorbefacient\'',106), -col58=11027, -col59='AM09gW7', -col60=repeat('Noelani\'',16), -col61='2520576', -col62='substitutiv', -col63='19950106155112', -col64=-12038, -col65='86238806', -col66='19600719080256', -col68=repeat('Sagittarius\'',54), -col69='38943902', -col70=1232, -col71='Elora\'', -col74=repeat('zipp',11), -col75='0', -col76=23254, -col78=13247, -col79='56219', -col80='20500609035724', -col81=11632, -col82=7, -col84=-23863, -col85=6341, -col87='HZdkf.4 s7t,5Rmq 8so fmr,ruGLUG25TrtI.yQ 2SuHq0ML7rw7.4 b2yf2E5TJxOtBBZImezDnzpj,uPYfznnEUDN1e9aQoO 2DsplB7TFWy oQJ br HLF :F,eQ p4i1oWsr lL3PG,hjCz6hYqN h1QTjLCjrv:QCdSzpYBibJAtZCxLOk3l6Blsh.W', -col88=16894, -col89=6161, -col90=repeat('gale',48); - -SHOW WARNINGS; - -DROP TABLE bug52745; diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug53591.test b/mysql-test/suite/innodb_zip/t/innodb_bug53591.test deleted file mode 100644 index 0bce587f106..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_bug53591.test +++ /dev/null @@ -1,16 +0,0 @@ ---source include/innodb_page_size_small.inc - -SET GLOBAL innodb_strict_mode=on; -set old_alter_table=0; - -CREATE TABLE bug53591(a text charset utf8 not null) -ENGINE=InnoDB KEY_BLOCK_SIZE=1; --- replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid} --- error ER_TOO_BIG_ROWSIZE -ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); --- replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid} -SHOW WARNINGS; - -DROP TABLE bug53591; - -SET GLOBAL innodb_strict_mode=DEFAULT; diff --git a/mysql-test/suite/innodb_zip/t/innodb_bug56680.test b/mysql-test/suite/innodb_zip/t/innodb_bug56680.test deleted file mode 100644 index 0cb1c897f2e..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_bug56680.test +++ /dev/null @@ -1,133 +0,0 @@ ---source include/innodb_page_size_small.inc -# -# Bug #56680 InnoDB may return wrong results from a case-insensitive index -# --- disable_query_log -SET @tx_isolation_orig = @@tx_isolation; -# The flag innodb_change_buffering_debug is only available in debug builds. -# It instructs InnoDB to try to evict pages from the buffer pool when -# change buffering is possible, so that the change buffer will be used -# whenever possible. --- error 0,ER_UNKNOWN_SYSTEM_VARIABLE -SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug; --- error 0,ER_UNKNOWN_SYSTEM_VARIABLE -SET GLOBAL innodb_change_buffering_debug = 1; --- enable_query_log -SET GLOBAL tx_isolation='REPEATABLE-READ'; - -CREATE TABLE bug56680( - a INT AUTO_INCREMENT PRIMARY KEY, - b CHAR(1), - c INT, - INDEX(b)) -ENGINE=InnoDB; - -INSERT INTO bug56680 VALUES(0,'x',1); -BEGIN; -SELECT b FROM bug56680; - -connect (con1,localhost,root,,); -connection con1; -BEGIN; -UPDATE bug56680 SET b='X'; - -connection default; -# This should return the last committed value 'x', but would return 'X' -# due to a bug in row_search_for_mysql(). -SELECT b FROM bug56680; -# This would always return the last committed value 'x'. -SELECT * FROM bug56680; - -connection con1; -ROLLBACK; -disconnect con1; - -connection default; - -SELECT b FROM bug56680; - -# For the rest of this test, use the READ UNCOMMITTED isolation level -# to see what exists in the secondary index. -SET GLOBAL tx_isolation='READ-UNCOMMITTED'; - -# Create enough rows for the table, so that the insert buffer will be -# used for modifying the secondary index page. There must be multiple -# index pages, because changes to the root page are never buffered. - -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; -INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; - -BEGIN; -SELECT b FROM bug56680 LIMIT 2; - -connect (con1,localhost,root,,); -connection con1; -BEGIN; -DELETE FROM bug56680 WHERE a=1; -# This should be buffered, if innodb_change_buffering_debug = 1 is in effect. -INSERT INTO bug56680 VALUES(1,'X',1); - -# This should force an insert buffer merge, and return 'X' in the first row. -SELECT b FROM bug56680 LIMIT 3; - -connection default; -SELECT b FROM bug56680 LIMIT 2; -CHECK TABLE bug56680; - -connection con1; -ROLLBACK; -SELECT b FROM bug56680 LIMIT 2; -CHECK TABLE bug56680; - -connection default; -disconnect con1; - -SELECT b FROM bug56680 LIMIT 2; - -CREATE TABLE bug56680_2( - a INT AUTO_INCREMENT PRIMARY KEY, - b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci, - c INT, - INDEX(b)) -ENGINE=InnoDB; - -INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680; - -BEGIN; -SELECT HEX(b) FROM bug56680_2 LIMIT 2; -DELETE FROM bug56680_2 WHERE a=1; -# This should be buffered, if innodb_change_buffering_debug = 1 is in effect. -INSERT INTO bug56680_2 VALUES(1,'SS',1); - -# This should force an insert buffer merge, and return 'SS' in the first row. -SELECT HEX(b) FROM bug56680_2 LIMIT 3; -CHECK TABLE bug56680_2; - -# Test this with compressed tables. -ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; - -SELECT HEX(b) FROM bug56680_2 LIMIT 2; -DELETE FROM bug56680_2 WHERE a=1; -# This should be buffered, if innodb_change_buffering_debug = 1 is in effect. -INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1); - -# This should force an insert buffer merge, and return 0xdf in the first row. -SELECT HEX(b) FROM bug56680_2 LIMIT 3; -CHECK TABLE bug56680_2; - -DROP TABLE bug56680_2; -DROP TABLE bug56680; - --- disable_query_log -SET GLOBAL tx_isolation = @tx_isolation_orig; --- error 0, ER_UNKNOWN_SYSTEM_VARIABLE -SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig; diff --git a/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table-master.opt b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table-master.opt deleted file mode 100644 index a9a3d8c3db8..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb-buffer-pool-size=8M diff --git a/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test deleted file mode 100644 index 35e4b2c6bf3..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test +++ /dev/null @@ -1,63 +0,0 @@ ---source include/have_innodb.inc - -# lazy evition might not be lazy enough when key rotation -# scans through pages --- source include/not_encrypted.inc - -let $per_table=`select @@innodb_file_per_table`; -let $format=`select @@innodb_file_format`; - --- let $query_i_s = SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0 - -set global innodb_file_per_table=on; -set global innodb_file_format=`1`; - -create table t1(a text) engine=innodb key_block_size=8; - --- disable_query_log - -# insert some rows so we are using compressed pages --- let $i = 10 -while ($i) -{ - insert into t1 values(repeat('abcdefghijklmnopqrstuvwxyz',100)); - dec $i; -} --- enable_query_log - -# we should be using some 8K pages --- eval $query_i_s - -drop table t1; - -# because of lazy eviction at drop table in 5.5 there should be some -# used 8K pages --- eval $query_i_s - -# create a non-compressed table and insert enough into it to evict -# compressed pages -create table t2(a text) engine=innodb; - --- disable_query_log - --- let $i = 400 -while ($i) -{ - insert into t2 values(repeat('abcdefghijklmnopqrstuvwxyz',1000)); - dec $i; -} - --- enable_query_log - -# now there should be no 8K pages in the buffer pool --- eval $query_i_s - -drop table t2; - -# -# restore environment to the state it was before this test execution -# - --- disable_query_log -eval set global innodb_file_format=$format; -eval set global innodb_file_per_table=$per_table; diff --git a/mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test b/mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test deleted file mode 100644 index d071e3833e9..00000000000 --- a/mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test +++ /dev/null @@ -1,434 +0,0 @@ -# Testcase for worklog #5743: Lift the limit of index key prefixes - ---source include/have_innodb.inc ---source include/have_innodb_16k.inc -SET default_storage_engine=InnoDB; - -call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page."); - -let $innodb_large_prefix_orig=`select @@innodb_large_prefix`; - -set global innodb_large_prefix=1; -set global innodb_strict_mode=1; - --- echo ### Test 1 ### -# Create a table of DYNAMIC format, with a primary index of 1000 bytes in -# size -create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC; -show warnings; - -# Do some insertion and update to excercise the external cache -# code path -insert into worklog5743 values(repeat("a", 20000)); - -# default session, update the table -update worklog5743 set a = (repeat("b", 16000)); - -# Create a secondary index -create index idx on worklog5743(a(2000)); -show warnings; - -# Start a few sessions to do selections on table being updated in default -# session, so it would rebuild the previous version from undo log. -# 1) Default session: Initiate an update on the externally stored column -# 2) Session con1: Select from table with repeated read -# 3) Session con2: Select from table with read uncommitted -# 4) Default session: rollback updates - -begin; -update worklog5743 set a = (repeat("x", 17000)); - -# Start a new session to select the column to force it build -# an earlier version of the clustered index through undo log. So it should -# just see the result of repeat("b", 16000) -select @@session.tx_isolation; ---connect (con1,localhost,root,,) -select a = repeat("x", 17000) from worklog5743; -select a = repeat("b", 16000) from worklog5743; - -# Start another session doing "read uncommitted" query, it -# should see the uncommitted update ---connect (con2,localhost,root,,) -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -select a = repeat("x", 17000) from worklog5743; - -# Roll back the transaction ---connection default -rollback; - -drop table worklog5743; - --- echo ### Test 2 ### -# Create a table with only a secondary index has large prefix column -create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; -show warnings; -create index idx on worklog5743(a1, a2(2000)); -show warnings; - -insert into worklog5743 values(9, repeat("a", 10000)); - -begin; - -update worklog5743 set a1 = 1000; - -# Do a select from another connection that would use the secondary index ---connection con1 -select @@session.tx_isolation; -explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; - -# Do read uncommitted in another session, it would show there is no -# row with a1 = 9 ---connection con2 -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; - ---connection default -rollback; - -drop table worklog5743; - --- echo ### Test 3 ### -# Create a table with a secondary index has small (50 bytes) prefix column -create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; - -create index idx on worklog5743(a1, a2(50)); - -insert into worklog5743 values(9, repeat("a", 10000)); - -begin; - -update worklog5743 set a1 = 1000; - -# Do a select from another connection that would use the secondary index ---connection con1 -select @@session.tx_isolation; -explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; - -# Do read uncommitted in another session, it would show there is no -# row with a1 = 9 ---connection con2 -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; - ---connection default -rollback; - -drop table worklog5743; - --- echo ### Test 4 ### -# Create compressed tables with each KEY_BLOCK_SIZE. -create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1; -create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2; -create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; -create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8; -create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16; - -# The maximum overall index record (not prefix) length of a -# compressed table is dependent on innodb-page-size (IPS), -# key_block_size (KBS) and the number of fields (NF). -# "Too big row" error (HA_ERR_TO_BIG_ROW) will be returned if this -# limit is exceeded. -# See page_zip_empty_size() and Bug #47495 for more detail. - -# Test edge cases for indexes using key_block_size=1 -set sql_mode=''; -set global innodb_large_prefix=0; --- error ER_TOO_BIG_ROWSIZE -create index idx1 on worklog5743_1(a2(4000)); -show warnings; -set global innodb_large_prefix=1; --- error ER_TOO_BIG_ROWSIZE -create index idx2 on worklog5743_1(a2(4000)); -show warnings; --- error ER_TOO_BIG_ROWSIZE -create index idx3 on worklog5743_1(a2(436)); -show warnings; -# Bug#13391353 Limit is one byte less on on 32bit-Linux only -create index idx4 on worklog5743_1(a2(434)); -show warnings; --- error ER_TOO_BIG_ROWSIZE -create index idx5 on worklog5743_1(a1, a2(430)); -show warnings; -# Bug#13391353 Limit is one byte less on on 32bit-Linux only -create index idx6 on worklog5743_1(a1, a2(428)); -show warnings; - -# Test edge cases for indexes using key_block_size=2 -set global innodb_large_prefix=0; -create index idx1 on worklog5743_2(a2(4000)); -show warnings; -set global innodb_large_prefix=1; --- error ER_TOO_BIG_ROWSIZE -create index idx2 on worklog5743_2(a2(4000)); -show warnings; --- error ER_TOO_BIG_ROWSIZE -create index idx3 on worklog5743_2(a2(948)); -show warnings; -# Bug#13391353 Limit is one byte less on on 32bit-Linux only -create index idx4 on worklog5743_2(a2(946)); -show warnings; --- error ER_TOO_BIG_ROWSIZE -create index idx5 on worklog5743_2(a1, a2(942)); -show warnings; -# Bug#13391353 Limit is one byte less on on 32bit-Linux only -create index idx6 on worklog5743_2(a1, a2(940)); -show warnings; - -# Test edge cases for indexes using key_block_size=4 -set global innodb_large_prefix=0; -create index idx1 on worklog5743_4(a2(4000)); -show warnings; -set global innodb_large_prefix=1; --- error ER_TOO_BIG_ROWSIZE -create index idx2 on worklog5743_4(a2(4000)); -show warnings; --- error ER_TOO_BIG_ROWSIZE -create index idx3 on worklog5743_4(a2(1972)); -show warnings; -# Bug#13391353 Limit is one byte less on on 32bit-Linux only -create index idx4 on worklog5743_4(a2(1970)); -show warnings; --- error ER_TOO_BIG_ROWSIZE -create index idx5 on worklog5743_4(a1, a2(1966)); -show warnings; -# Bug#13391353 Limit is one byte less on on 32bit-Linux only -create index idx6 on worklog5743_4(a1, a2(1964)); -show warnings; - -# Test edge cases for indexes using key_block_size=8 -set global innodb_large_prefix=0; -create index idx1 on worklog5743_8(a2(1000)); -show warnings; -set global innodb_large_prefix=1; -create index idx2 on worklog5743_8(a2(3073)); -show warnings; -create index idx3 on worklog5743_8(a2(3072)); -show warnings; --- error ER_TOO_LONG_KEY -create index idx4 on worklog5743_8(a1, a2(3069)); -show warnings; -create index idx5 on worklog5743_8(a1, a2(3068)); -show warnings; --- error ER_TOO_LONG_KEY -create index idx6 on worklog5743_8(a1, a2(2000), a3(1069)); -show warnings; -create index idx7 on worklog5743_8(a1, a2(2000), a3(1068)); -show warnings; - -# Test edge cases for indexes using key_block_size=16 -set global innodb_large_prefix=0; -create index idx1 on worklog5743_16(a2(1000)); -show warnings; -set global innodb_large_prefix=1; -create index idx2 on worklog5743_16(a2(3073)); -show warnings; -create index idx3 on worklog5743_16(a2(3072)); -show warnings; --- error ER_TOO_LONG_KEY -create index idx4 on worklog5743_16(a1, a2(3069)); -show warnings; -create index idx5 on worklog5743_16(a1, a2(3068)); -show warnings; --- error ER_TOO_LONG_KEY -create index idx6 on worklog5743_16(a1, a2(2000), a3(1069)); -show warnings; -create index idx7 on worklog5743_16(a1, a2(2000), a3(1068)); -show warnings; -set sql_mode=default; - -# Insert a large record into each of these tables. -insert into worklog5743_1 values(9, repeat("a", 10000)); -insert into worklog5743_2 values(9, repeat("a", 10000)); -insert into worklog5743_4 values(9, repeat("a", 10000)); -insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000)); -insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000)); - -# Now if we change the global innodb_large_prefix back to 767, -# updates to these indexes should still be allowed. -set global innodb_large_prefix=0; -insert into worklog5743_1 values(2, repeat("b", 10000)); -insert into worklog5743_2 values(2, repeat("b", 10000)); -insert into worklog5743_4 values(2, repeat("b", 10000)); -insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000)); -insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000)); -set global innodb_large_prefix=1; - -select a1, left(a2, 20) from worklog5743_1; -select a1, left(a2, 20) from worklog5743_2; -select a1, left(a2, 20) from worklog5743_4; -select a1, left(a2, 20) from worklog5743_8; -select a1, left(a2, 20) from worklog5743_16; - -begin; - -update worklog5743_1 set a1 = 1000; -update worklog5743_2 set a1 = 1000; -update worklog5743_4 set a1 = 1000; -update worklog5743_8 set a1 = 1000; -update worklog5743_16 set a1 = 1000; -select a1, left(a2, 20) from worklog5743_1; -select a1, left(a2, 20) from worklog5743_2; -select a1, left(a2, 20) from worklog5743_4; -select a1, left(a2, 20) from worklog5743_8; -select a1, left(a2, 20) from worklog5743_16; - - -# Do a select from another connection that would use the secondary index ---connection con1 -select @@session.tx_isolation; -explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9; -explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9; -explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9; -explain select a1, left(a2, 20) from worklog5743_8 where a1 = 9; -explain select a1, left(a2, 20) from worklog5743_16 where a1 = 9; -select a1, left(a2, 20) from worklog5743_1 where a1 = 9; -select a1, left(a2, 20) from worklog5743_2 where a1 = 9; -select a1, left(a2, 20) from worklog5743_4 where a1 = 9; -select a1, left(a2, 20) from worklog5743_8 where a1 = 9; -select a1, left(a2, 20) from worklog5743_16 where a1 = 9; - -# Do read uncommitted in another session, it would show there is no -# row with a1 = 9 ---connection con2 -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -select a1, left(a2, 20) from worklog5743_1 where a1 = 9; -select a1, left(a2, 20) from worklog5743_2 where a1 = 9; -select a1, left(a2, 20) from worklog5743_4 where a1 = 9; -select a1, left(a2, 20) from worklog5743_8 where a1 = 9; -select a1, left(a2, 20) from worklog5743_16 where a1 = 9; - ---connection default -rollback; - -drop table worklog5743_1; -drop table worklog5743_2; -drop table worklog5743_4; -drop table worklog5743_8; -drop table worklog5743_16; - --- echo ### Test 5 ### -# Create a table with large varchar columns and create indexes -# directly on these large columns to show that prefix limit is -# automatically applied and to show that limit. -create table worklog5743(a1 int, - a2 varchar(20000), - a3 varchar(3073), - a4 varchar(3072), - a5 varchar(3069), - a6 varchar(3068)) - ROW_FORMAT=DYNAMIC; -set sql_mode=''; -create index idx1 on worklog5743(a2); -create index idx2 on worklog5743(a3); -create index idx3 on worklog5743(a4); -show warnings; --- error ER_TOO_LONG_KEY -create index idx4 on worklog5743(a1, a2); -show warnings; --- error ER_TOO_LONG_KEY -create index idx5 on worklog5743(a1, a5); -show warnings; -create index idx6 on worklog5743(a1, a6); -show warnings; -show create table worklog5743; -set sql_mode=default; - -insert into worklog5743 values(9, - repeat("a", 20000), repeat("a", 3073), - repeat("a", 3072), repeat("a", 3069), - repeat("a", 3068)); - -begin; - -update worklog5743 set a1 = 1000; - -# Do a select from another connection that would use the secondary index ---connection con1 -select @@session.tx_isolation; -explain select a1 from worklog5743 where a1 = 9; -select a1 from worklog5743 where a1 = 9; - -# Do read uncommitted, it would show there is no row with a1 = 9 ---connection con2 -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -select a1 from worklog5743 where a1 = 9; - ---connection default -rollback; - -drop table worklog5743; - --- echo ### Test 6 ### -# Create a table with old format, and the limit is 768 bytes. --- error ER_INDEX_COLUMN_TOO_LONG -create table worklog5743(a TEXT not null, primary key (a(1000))) row_format=COMPACT; - -create table worklog5743(a TEXT) row_format=COMPACT; - -# Excercise the column length check in ha_innobase::add_index() --- error ER_INDEX_COLUMN_TOO_LONG -create index idx on worklog5743(a(768)); - -# This should be successful -create index idx on worklog5743(a(767)); - -# Perform some DMLs -insert into worklog5743 values(repeat("a", 20000)); - -begin; -insert into worklog5743 values(repeat("b", 20000)); -update worklog5743 set a = (repeat("x", 25000)); - -# Start a new session to select the table to force it build -# an earlier version of the cluster index through undo log -select @@session.tx_isolation; ---connection con1 -select a = repeat("a", 20000) from worklog5743; ---disconnect con1 - ---connection con2 -SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -select @@session.tx_isolation; -select a = repeat("x", 25000) from worklog5743; ---disconnect con2 - ---connection default -rollback; - -drop table worklog5743; - --- echo ### Test 7 ### -# Some border line tests on the column length. -# We have a limit of 3072 bytes for Barracuda table -create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC; - -# Length exceeds maximum supported key length -# It will be auto-truncated to 3072 -set statement sql_mode = '' for -create index idx1 on worklog5743(a(3073)); -create index idx2 on worklog5743(a(3072)); -show create table worklog5743; -drop table worklog5743; - -# We have a limit of 767 bytes for Antelope tables -create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT; --- error ER_INDEX_COLUMN_TOO_LONG -create index idx on worklog5743(a(768)); -create index idx2 on worklog5743(a(767)); -drop table worklog5743; - -create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT; --- error ER_INDEX_COLUMN_TOO_LONG -create index idx on worklog5743(a(768)); -create index idx2 on worklog5743(a(767)); -drop table worklog5743; - -eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig; -SET GLOBAL innodb_strict_mode = DEFAULT; diff --git a/mysql-test/suite/plugins/t/show_all_plugins.test b/mysql-test/suite/plugins/t/show_all_plugins.test index 74f9a99aef3..f8f375976fe 100644 --- a/mysql-test/suite/plugins/t/show_all_plugins.test +++ b/mysql-test/suite/plugins/t/show_all_plugins.test @@ -21,6 +21,7 @@ show status like '%libraries%'; --sorted_result --replace_result .dll .so show plugins soname like '%example%'; +--replace_result 8 7 show status like '%libraries%'; --sorted_result --replace_result .dll .so diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index b970292ff51..7402b84dc96 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1776,11 +1776,11 @@ GLOBAL_VALUE 5242880 GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 50331648 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT +VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Size of each log file in a log group. NUMERIC_MIN_VALUE 1048576 NUMERIC_MAX_VALUE 549755813888 -NUMERIC_BLOCK_SIZE 1048576 +NUMERIC_BLOCK_SIZE 65536 ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff index 88216992587..61dfdf5205f 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff @@ -1,5 +1,5 @@ ---- suite/sys_vars/r/sysvars_server_notembedded.result 2016-11-03 17:27:47.664855681 +0100 -+++ suite/sys_vars/r/sysvars_server_notembedded.reject 2016-11-03 17:23:05.686196749 +0100 +--- /home/my/maria-10.2/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result 2017-06-30 22:31:37.562118657 +0300 ++++ /home/my/maria-10.2/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.reject 2017-07-01 13:56:47.396950309 +0300 @@ -57,7 +57,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 1 @@ -226,7 +226,7 @@ NUMERIC_MAX_VALUE 1000 @@ -1040,7 +1040,7 @@ VARIABLE_TYPE BIGINT UNSIGNED - VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() + VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() NUMERIC_MIN_VALUE 4 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MAX_VALUE 4294967295 @@ -289,7 +289,7 @@ READ_ONLY NO @@ -1723,7 +1723,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME - DEFAULT_VALUE 31536000 + DEFAULT_VALUE 86400 VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED @@ -307,7 +307,7 @@ NUMERIC_MAX_VALUE 4294967295 @@ -1947,7 +1947,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME - DEFAULT_VALUE 1 + DEFAULT_VALUE 2 VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED @@ -316,7 +316,7 @@ NUMERIC_MAX_VALUE 4294967295 @@ -2003,7 +2003,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME - DEFAULT_VALUE 4194304 + DEFAULT_VALUE 16777216 VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED @@ -467,7 +467,7 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2255,7 +2255,7 @@ +@@ -2269,7 +2269,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -476,7 +476,7 @@ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2269,7 +2269,7 @@ +@@ -2283,7 +2283,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -485,7 +485,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2297,7 +2297,7 @@ +@@ -2311,7 +2311,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 VARIABLE_SCOPE SESSION @@ -494,7 +494,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2325,7 +2325,7 @@ +@@ -2339,7 +2339,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE GLOBAL @@ -503,7 +503,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2339,7 +2339,7 @@ +@@ -2353,7 +2353,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -512,7 +512,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2353,7 +2353,7 @@ +@@ -2367,7 +2367,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8 VARIABLE_SCOPE GLOBAL @@ -521,7 +521,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2367,7 +2367,7 @@ +@@ -2381,7 +2381,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -530,7 +530,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2381,7 +2381,7 @@ +@@ -2395,7 +2395,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -539,7 +539,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2395,10 +2395,10 @@ +@@ -2409,10 +2409,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE SESSION @@ -552,7 +552,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2409,7 +2409,7 @@ +@@ -2423,7 +2423,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -561,7 +561,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2423,7 +2423,7 @@ +@@ -2437,7 +2437,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 6 VARIABLE_SCOPE GLOBAL @@ -570,7 +570,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2433,9 +2433,9 @@ +@@ -2447,9 +2447,9 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE SESSION_VALUE NULL @@ -582,7 +582,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this -@@ -2447,14 +2447,14 @@ +@@ -2461,14 +2461,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MMAP_SIZE SESSION_VALUE NULL @@ -600,7 +600,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2479,10 +2479,10 @@ +@@ -2493,10 +2493,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -613,7 +613,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2496,7 +2496,7 @@ +@@ -2510,7 +2510,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 @@ -622,7 +622,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2549,7 +2549,7 @@ +@@ -2563,7 +2563,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -631,7 +631,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2563,7 +2563,7 @@ +@@ -2577,7 +2577,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 30 VARIABLE_SCOPE SESSION @@ -640,7 +640,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2577,7 +2577,7 @@ +@@ -2591,7 +2591,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE SESSION @@ -649,7 +649,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2591,7 +2591,7 @@ +@@ -2605,7 +2605,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 60 VARIABLE_SCOPE SESSION @@ -658,7 +658,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2661,7 +2661,7 @@ +@@ -2675,7 +2675,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -667,7 +667,7 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2675,7 +2675,7 @@ +@@ -2689,7 +2689,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION @@ -676,7 +676,7 @@ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 62 -@@ -2689,7 +2689,7 @@ +@@ -2703,7 +2703,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE SESSION @@ -685,7 +685,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2717,7 +2717,7 @@ +@@ -2731,7 +2731,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -694,7 +694,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2745,7 +2745,7 @@ +@@ -2759,7 +2759,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -703,7 +703,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2759,7 +2759,7 @@ +@@ -2773,7 +2773,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -712,7 +712,7 @@ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 200 -@@ -2773,7 +2773,7 @@ +@@ -2787,7 +2787,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -721,7 +721,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2787,7 +2787,7 @@ +@@ -2801,7 +2801,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -730,7 +730,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2801,7 +2801,7 @@ +@@ -2815,7 +2815,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -739,7 +739,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2815,7 +2815,7 @@ +@@ -2829,7 +2829,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -748,7 +748,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2829,7 +2829,7 @@ +@@ -2843,7 +2843,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -757,7 +757,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2843,7 +2843,7 @@ +@@ -2857,7 +2857,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -766,7 +766,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2857,7 +2857,7 @@ +@@ -2871,7 +2871,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -775,7 +775,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2871,7 +2871,7 @@ +@@ -2885,7 +2885,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 80 VARIABLE_SCOPE GLOBAL @@ -784,7 +784,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2885,7 +2885,7 @@ +@@ -2899,7 +2899,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -793,7 +793,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2899,7 +2899,7 @@ +@@ -2913,7 +2913,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -802,7 +802,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2913,7 +2913,7 @@ +@@ -2927,7 +2927,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -811,7 +811,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2927,7 +2927,7 @@ +@@ -2941,7 +2941,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE GLOBAL @@ -820,7 +820,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2941,7 +2941,7 @@ +@@ -2955,7 +2955,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -829,7 +829,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2955,7 +2955,7 @@ +@@ -2969,7 +2969,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 200 VARIABLE_SCOPE GLOBAL @@ -838,7 +838,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2969,7 +2969,7 @@ +@@ -2983,7 +2983,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -847,7 +847,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2983,7 +2983,7 @@ +@@ -2997,7 +2997,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 40 VARIABLE_SCOPE GLOBAL @@ -856,7 +856,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2997,7 +2997,7 @@ +@@ -3011,7 +3011,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -865,7 +865,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -3011,7 +3011,7 @@ +@@ -3025,7 +3025,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -874,7 +874,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3025,7 +3025,7 @@ +@@ -3039,7 +3039,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -883,7 +883,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3039,7 +3039,7 @@ +@@ -3053,7 +3053,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL @@ -892,16 +892,16 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3053,7 +3053,7 @@ +@@ -3067,7 +3067,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME - DEFAULT_VALUE 185 + DEFAULT_VALUE 188 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3067,7 +3067,7 @@ +@@ -3081,7 +3081,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -910,7 +910,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3081,7 +3081,7 @@ +@@ -3095,7 +3095,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -919,7 +919,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3095,7 +3095,7 @@ +@@ -3109,7 +3109,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -928,7 +928,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3109,7 +3109,7 @@ +@@ -3123,7 +3123,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -937,7 +937,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3123,7 +3123,7 @@ +@@ -3137,7 +3137,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -946,7 +946,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3137,7 +3137,7 @@ +@@ -3151,7 +3151,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -955,7 +955,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -3151,7 +3151,7 @@ +@@ -3165,7 +3165,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -964,7 +964,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -3165,7 +3165,7 @@ +@@ -3179,7 +3179,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -973,7 +973,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3235,7 +3235,7 @@ +@@ -3249,7 +3249,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE SESSION @@ -982,7 +982,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3263,7 +3263,7 @@ +@@ -3277,7 +3277,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -991,7 +991,7 @@ VARIABLE_COMMENT Limit of query profiling memory NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -3277,7 +3277,7 @@ +@@ -3291,7 +3291,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 5 VARIABLE_SCOPE SESSION @@ -1000,7 +1000,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3347,7 +3347,7 @@ +@@ -3361,7 +3361,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -1009,7 +1009,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3361,7 +3361,7 @@ +@@ -3375,7 +3375,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -1018,7 +1018,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3375,7 +3375,7 @@ +@@ -3389,7 +3389,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE GLOBAL @@ -1027,7 +1027,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3392,7 +3392,7 @@ +@@ -3406,7 +3406,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1036,7 +1036,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3445,7 +3445,7 @@ +@@ -3459,7 +3459,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 24576 VARIABLE_SCOPE SESSION @@ -1045,7 +1045,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3459,7 +3459,7 @@ +@@ -3473,7 +3473,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1054,7 +1054,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -3476,7 +3476,7 @@ +@@ -3490,7 +3490,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Maximum speed(KB/s) to read binlog from master (0 = no limit) NUMERIC_MIN_VALUE 0 @@ -1063,7 +1063,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3487,7 +3487,7 @@ +@@ -3501,7 +3501,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE SESSION @@ -1072,7 +1072,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -3515,7 +3515,7 @@ +@@ -3529,7 +3529,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -1081,7 +1081,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -3795,10 +3795,10 @@ +@@ -3809,10 +3809,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8388608 VARIABLE_SCOPE SESSION @@ -1094,7 +1094,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3837,7 +3837,7 @@ +@@ -3851,7 +3851,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -1103,7 +1103,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -4019,7 +4019,7 @@ +@@ -4033,7 +4033,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1112,7 +1112,7 @@ VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4061,7 +4061,7 @@ +@@ -4075,7 +4075,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -1121,7 +1121,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -4089,7 +4089,7 @@ +@@ -4103,7 +4103,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE GLOBAL @@ -1130,7 +1130,7 @@ VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 2147483647 -@@ -4117,7 +4117,7 @@ +@@ -4131,7 +4131,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1139,7 +1139,7 @@ VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4131,7 +4131,7 @@ +@@ -4145,7 +4145,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1148,7 +1148,7 @@ VARIABLE_COMMENT Alias for slave_parallel_threads NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4187,7 +4187,7 @@ +@@ -4201,7 +4201,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1157,7 +1157,7 @@ VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -4215,7 +4215,7 @@ +@@ -4229,7 +4229,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE GLOBAL @@ -1166,7 +1166,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -4274,7 +4274,7 @@ +@@ -4288,7 +4288,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1175,7 +1175,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4579,7 +4579,7 @@ +@@ -4593,7 +4593,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1184,7 +1184,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -4677,7 +4677,7 @@ +@@ -4691,7 +4691,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 400 VARIABLE_SCOPE GLOBAL @@ -1193,7 +1193,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 524288 -@@ -4691,7 +4691,7 @@ +@@ -4705,7 +4705,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL @@ -1202,7 +1202,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -4719,7 +4719,7 @@ +@@ -4733,7 +4733,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1211,7 +1211,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -4733,7 +4733,7 @@ +@@ -4747,7 +4747,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1220,16 +1220,45 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -4946,7 +4946,7 @@ +@@ -4952,15 +4952,15 @@ + READ_ONLY YES + COMMAND_LINE_ARGUMENT REQUIRED + VARIABLE_NAME TMP_DISK_TABLE_SIZE +-SESSION_VALUE 18446744073709551615 +-GLOBAL_VALUE 18446744073709551615 ++SESSION_VALUE 4294967295 ++GLOBAL_VALUE 4294967295 + GLOBAL_VALUE_ORIGIN COMPILE-TIME +-DEFAULT_VALUE 18446744073709551615 ++DEFAULT_VALUE 4294967295 + VARIABLE_SCOPE SESSION + VARIABLE_TYPE BIGINT UNSIGNED + VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table. + NUMERIC_MIN_VALUE 1024 +-NUMERIC_MAX_VALUE 18446744073709551615 ++NUMERIC_MAX_VALUE 4294967295 + NUMERIC_BLOCK_SIZE 1 + ENUM_VALUE_LIST NULL + READ_ONLY NO +@@ -4974,7 +4974,7 @@ + VARIABLE_TYPE BIGINT UNSIGNED + VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size. + NUMERIC_MIN_VALUE 1024 +-NUMERIC_MAX_VALUE 18446744073709551615 ++NUMERIC_MAX_VALUE 4294967295 + NUMERIC_BLOCK_SIZE 1 + ENUM_VALUE_LIST NULL + READ_ONLY NO +@@ -4988,7 +4988,7 @@ VARIABLE_TYPE BIGINT UNSIGNED - VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table + VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table. NUMERIC_MIN_VALUE 1024 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4957,7 +4957,7 @@ +@@ -4999,7 +4999,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8192 VARIABLE_SCOPE SESSION @@ -1238,7 +1267,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4971,7 +4971,7 @@ +@@ -5013,7 +5013,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1247,7 +1276,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -5069,7 +5069,7 @@ +@@ -5111,7 +5111,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -1256,7 +1285,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -5173,7 +5173,7 @@ +@@ -5215,7 +5215,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -1265,7 +1294,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -5186,7 +5186,7 @@ +@@ -5228,7 +5228,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1274,7 +1303,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -5196,7 +5196,7 @@ +@@ -5238,7 +5238,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1283,7 +1312,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -5281,7 +5281,7 @@ +@@ -5323,7 +5323,7 @@ VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index fdfcda8e0ca..af17ac34b61 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -4951,6 +4951,34 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME TMP_DISK_TABLE_SIZE +SESSION_VALUE 18446744073709551615 +GLOBAL_VALUE 18446744073709551615 +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE 18446744073709551615 +VARIABLE_SCOPE SESSION +VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table. +NUMERIC_MIN_VALUE 1024 +NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_BLOCK_SIZE 1 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME TMP_MEMORY_TABLE_SIZE +SESSION_VALUE 16777216 +GLOBAL_VALUE 16777216 +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE 16777216 +VARIABLE_SCOPE SESSION +VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size. +NUMERIC_MIN_VALUE 1024 +NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_BLOCK_SIZE 1 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TMP_TABLE_SIZE SESSION_VALUE 16777216 GLOBAL_VALUE 16777216 @@ -4958,7 +4986,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16777216 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table +VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 18446744073709551615 NUMERIC_BLOCK_SIZE 1 diff --git a/mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result b/mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result new file mode 100644 index 00000000000..0acf8428100 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/tmp_disk_table_size_basic.result @@ -0,0 +1,146 @@ +SET @start_global_value = @@global.tmp_disk_table_size; +SET @start_session_value = @@session.tmp_disk_table_size; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.tmp_disk_table_size = 100; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '100' +SET @@global.tmp_disk_table_size = DEFAULT; +SET @@session.tmp_disk_table_size = 200; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '200' +SET @@session.tmp_disk_table_size = DEFAULT; +'#--------------------FN_DYNVARS_005_02-------------------------#' +SELECT @@global.tmp_disk_table_size >= 16777216; +@@global.tmp_disk_table_size >= 16777216 +1 +SELECT @@session.tmp_disk_table_size >= 16777216; +@@session.tmp_disk_table_size >= 16777216 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.tmp_disk_table_size = 1024; +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +1024 +SET @@global.tmp_disk_table_size = 60020; +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +60020 +SET @@global.tmp_disk_table_size = 4294967295; +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +4294967295 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.tmp_disk_table_size = 1024; +SELECT @@session.tmp_disk_table_size; +@@session.tmp_disk_table_size +1024 +SET @@session.tmp_disk_table_size = 4294967295; +SELECT @@session.tmp_disk_table_size; +@@session.tmp_disk_table_size +4294967295 +SET @@session.tmp_disk_table_size = 65535; +SELECT @@session.tmp_disk_table_size; +@@session.tmp_disk_table_size +65535 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.tmp_disk_table_size = 0; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '0' +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +1024 +SET @@global.tmp_disk_table_size = -1024; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '-1024' +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +1024 +SET @@global.tmp_disk_table_size = 1000; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '1000' +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +1024 +SET @@global.tmp_disk_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_disk_table_size' +SET @@global.tmp_disk_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_disk_table_size' +SET @@global.tmp_disk_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '1' +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +1024 +SET @@global.tmp_disk_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '0' +SELECT @@global.tmp_disk_table_size; +@@global.tmp_disk_table_size +1024 +SET @@global.tmp_disk_table_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'tmp_disk_table_size' +SET @@global.tmp_disk_table_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_disk_table_size' +SET @@session.tmp_disk_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_disk_table_size' +SET @@session.tmp_disk_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_disk_table_size' +SET @@session.tmp_disk_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '1' +SELECT @@session.tmp_disk_table_size; +@@session.tmp_disk_table_size +1024 +SET @@session.tmp_disk_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '0' +SELECT @@session.tmp_disk_table_size; +@@session.tmp_disk_table_size +1024 +SET @@session.tmp_disk_table_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_disk_table_size' +SET @@session.tmp_disk_table_size = 12345678901; +SELECT @@session.tmp_disk_table_size IN (12345678901,4294967295); +@@session.tmp_disk_table_size IN (12345678901,4294967295) +1 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.tmp_disk_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='tmp_disk_table_size'; +@@global.tmp_disk_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.tmp_disk_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='tmp_disk_table_size'; +@@session.tmp_disk_table_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.tmp_disk_table_size = 1024; +SET @@tmp_disk_table_size = 4294967295; +SELECT @@tmp_disk_table_size = @@global.tmp_disk_table_size; +@@tmp_disk_table_size = @@global.tmp_disk_table_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@tmp_disk_table_size = 100; +Warnings: +Warning 1292 Truncated incorrect tmp_disk_table_size value: '100' +SELECT @@tmp_disk_table_size = @@local.tmp_disk_table_size; +@@tmp_disk_table_size = @@local.tmp_disk_table_size +1 +SELECT @@local.tmp_disk_table_size = @@session.tmp_disk_table_size; +@@local.tmp_disk_table_size = @@session.tmp_disk_table_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET tmp_disk_table_size = 1027; +SELECT @@tmp_disk_table_size; +@@tmp_disk_table_size +1027 +SELECT local.tmp_disk_table_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT global.tmp_disk_table_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT tmp_disk_table_size = @@session.tmp_disk_table_size; +ERROR 42S22: Unknown column 'tmp_disk_table_size' in 'field list' +SET @@global.tmp_disk_table_size = @start_global_value; +SET @@session.tmp_disk_table_size = @start_session_value; diff --git a/mysql-test/suite/sys_vars/r/tmp_disk_table_size_func.result b/mysql-test/suite/sys_vars/r/tmp_disk_table_size_func.result new file mode 100644 index 00000000000..d2a5ad46129 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/tmp_disk_table_size_func.result @@ -0,0 +1,25 @@ + +"Ensure that we get an error if we exceed tmp_disk_table_size" + +SET @start_tmp_memory_table_size=@@session.tmp_memory_table_size; +SET @start_tmp_disk_table_size=@@session.tmp_disk_table_size; +set @@session.tmp_memory_table_size=1000; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '1000' +set @@session.tmp_disk_table_size=3000000; +create table t1 (a int primary key, b varchar(2000)); +insert into t1 select seq,repeat(char(mod(seq,62)+64),seq) from seq_1_to_2000; +insert into t1 values (20000,"A"); +select count(*) as c from t1 group by b having c>1; +c +2 +show status like "created_tmp_disk%"; +Variable_name Value +Created_tmp_disk_tables 1 +set @@session.tmp_disk_table_size=1000000; +select count(*) as c from t1 group by b having c>1; +ERROR HY000: The table '#sql_xxx' is full +show status like "created_tmp_disk%"; +Variable_name Value +Created_tmp_disk_tables 2 +drop table t1; diff --git a/mysql-test/suite/sys_vars/r/tmp_memory_table_size_basic.result b/mysql-test/suite/sys_vars/r/tmp_memory_table_size_basic.result new file mode 100644 index 00000000000..dddba1a6dfe --- /dev/null +++ b/mysql-test/suite/sys_vars/r/tmp_memory_table_size_basic.result @@ -0,0 +1,165 @@ +SET @start_global_value = @@global.tmp_memory_table_size; +SET @start_session_value = @@session.tmp_memory_table_size; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.tmp_memory_table_size = 10000; +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +10000 +SET @@global.tmp_memory_table_size = DEFAULT; +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +16777216 +SET @@session.tmp_memory_table_size = 20000; +SELECT @@session.tmp_memory_table_size; +@@session.tmp_memory_table_size +20000 +SET @@session.tmp_memory_table_size = DEFAULT; +SELECT @@session.tmp_memory_table_size; +@@session.tmp_memory_table_size +16777216 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SELECT @@global.tmp_memory_table_size >= 16777216; +@@global.tmp_memory_table_size >= 16777216 +1 +SELECT @@session.tmp_memory_table_size >= 16777216; +@@session.tmp_memory_table_size >= 16777216 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.tmp_memory_table_size = 1024; +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +1024 +SET @@global.tmp_memory_table_size = 60020; +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +60020 +SET @@global.tmp_memory_table_size = 4294967295; +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +4294967295 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.tmp_memory_table_size = 1024; +SELECT @@session.tmp_memory_table_size; +@@session.tmp_memory_table_size +1024 +SET @@session.tmp_memory_table_size = 4294967295; +SELECT @@session.tmp_memory_table_size; +@@session.tmp_memory_table_size +4294967295 +SET @@session.tmp_memory_table_size = 65535; +SELECT @@session.tmp_memory_table_size; +@@session.tmp_memory_table_size +65535 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.tmp_memory_table_size = 0; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '0' +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +1024 +SET @@global.tmp_memory_table_size = -1024; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '-1024' +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +1024 +SET @@global.tmp_memory_table_size = 1000; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '1000' +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +1024 +SET @@global.tmp_memory_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_memory_table_size' +SET @@global.tmp_memory_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_memory_table_size' +SET @@global.tmp_memory_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '1' +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +1024 +SET @@global.tmp_memory_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '0' +SELECT @@global.tmp_memory_table_size; +@@global.tmp_memory_table_size +1024 +SET @@global.tmp_memory_table_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'tmp_memory_table_size' +SET @@global.tmp_memory_table_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_memory_table_size' +SET @@session.tmp_memory_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_memory_table_size' +SET @@session.tmp_memory_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_memory_table_size' +SET @@session.tmp_memory_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '1' +SELECT @@session.tmp_memory_table_size; +@@session.tmp_memory_table_size +1024 +SET @@session.tmp_memory_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '0' +SELECT @@session.tmp_memory_table_size; +@@session.tmp_memory_table_size +1024 +SET @@session.tmp_memory_table_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_memory_table_size' +SET @@session.tmp_memory_table_size = 12345678901; +SELECT @@session.tmp_memory_table_size IN (12345678901,4294967295); +@@session.tmp_memory_table_size IN (12345678901,4294967295) +1 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.tmp_memory_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='tmp_memory_table_size'; +@@global.tmp_memory_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.tmp_memory_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='tmp_memory_table_size'; +@@session.tmp_memory_table_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.tmp_memory_table_size = 1024; +SET @@tmp_memory_table_size = 4294967295; +SELECT @@tmp_memory_table_size = @@global.tmp_memory_table_size; +@@tmp_memory_table_size = @@global.tmp_memory_table_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@tmp_memory_table_size = 100; +Warnings: +Warning 1292 Truncated incorrect tmp_memory_table_size value: '100' +SELECT @@tmp_memory_table_size = @@local.tmp_memory_table_size; +@@tmp_memory_table_size = @@local.tmp_memory_table_size +1 +SELECT @@local.tmp_memory_table_size = @@session.tmp_memory_table_size; +@@local.tmp_memory_table_size = @@session.tmp_memory_table_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET tmp_memory_table_size = 1027; +SELECT @@tmp_memory_table_size; +@@tmp_memory_table_size +1027 +SELECT local.tmp_memory_table_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT global.tmp_memory_table_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT tmp_memory_table_size = @@session.tmp_memory_table_size; +ERROR 42S22: Unknown column 'tmp_memory_table_size' in 'field list' + +"Check that tmp_memory_table_size and tmp_table_size are the same" + +set @@session.tmp_memory_table_size=100000; +select @@session.tmp_memory_table_size,@@session.tmp_table_size; +@@session.tmp_memory_table_size @@session.tmp_table_size +100000 100000 +set @@session.tmp_memory_table_size=200000; +select @@session.tmp_memory_table_size,@@session.tmp_table_size; +@@session.tmp_memory_table_size @@session.tmp_table_size +200000 200000 +SET @@global.tmp_memory_table_size = @start_global_value; +SET @@session.tmp_memory_table_size = @start_session_value; diff --git a/mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test b/mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test new file mode 100644 index 00000000000..123f522a3a4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/tmp_disk_table_size_basic.test @@ -0,0 +1,207 @@ +###################### tmp_disk_table_size_basic.test ###################### +# # +# Variable Name: tmp_disk_table_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: system dependend # +# Range: 1024-system dependend # +# # +# # +# Creation Date: 2008-02-13 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable tmp_table_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# Modified: 2008-12-04 HHunger # +# removed the differences between 64 and 32 bit platforms # +# # +# Reference: # +# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +############################################################## +# START OF tmp_disk_table_size TESTS # +############################################################## + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.tmp_disk_table_size; +SET @start_session_value = @@session.tmp_disk_table_size; + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +############################################################## +# Display the DEFAULT value of tmp_disk_table_size # +############################################################## + +SET @@global.tmp_disk_table_size = 100; +SET @@global.tmp_disk_table_size = DEFAULT; + +SET @@session.tmp_disk_table_size = 200; +SET @@session.tmp_disk_table_size = DEFAULT; + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of tmp_disk_table_size # +######################################################################## +# The DEFAULT value is system dependend. +# Therefore we have only a plausibility check here +SELECT @@global.tmp_disk_table_size >= 16777216; +SELECT @@session.tmp_disk_table_size >= 16777216; + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +######################################################################## +# Change the value of tmp_disk_table_size to a valid value for GLOBAL Scope # +######################################################################## + +SET @@global.tmp_disk_table_size = 1024; +SELECT @@global.tmp_disk_table_size; +SET @@global.tmp_disk_table_size = 60020; +SELECT @@global.tmp_disk_table_size; +SET @@global.tmp_disk_table_size = 4294967295; +SELECT @@global.tmp_disk_table_size; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +######################################################################### +# Change the value of tmp_disk_table_size to a valid value for SESSION Scope # +######################################################################### + +SET @@session.tmp_disk_table_size = 1024; +SELECT @@session.tmp_disk_table_size; + +SET @@session.tmp_disk_table_size = 4294967295; +SELECT @@session.tmp_disk_table_size; +SET @@session.tmp_disk_table_size = 65535; +SELECT @@session.tmp_disk_table_size; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +########################################################## +# Change the value of tmp_disk_table_size to an invalid value # +########################################################## + +SET @@global.tmp_disk_table_size = 0; +SELECT @@global.tmp_disk_table_size; + +SET @@global.tmp_disk_table_size = -1024; +SELECT @@global.tmp_disk_table_size; + +SET @@global.tmp_disk_table_size = 1000; +SELECT @@global.tmp_disk_table_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_disk_table_size = ON; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_disk_table_size = OFF; + +SET @@global.tmp_disk_table_size = True; +SELECT @@global.tmp_disk_table_size; + +SET @@global.tmp_disk_table_size = False; +SELECT @@global.tmp_disk_table_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_disk_table_size = 65530.34; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_disk_table_size ="Test"; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_disk_table_size = ON; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_disk_table_size = OFF; + +SET @@session.tmp_disk_table_size = True; +SELECT @@session.tmp_disk_table_size; + +SET @@session.tmp_disk_table_size = False; +SELECT @@session.tmp_disk_table_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_disk_table_size = "Test"; + +--disable_warnings +SET @@session.tmp_disk_table_size = 12345678901; +--enable_warnings +# With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295 +SELECT @@session.tmp_disk_table_size IN (12345678901,4294967295); + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SELECT @@global.tmp_disk_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='tmp_disk_table_size'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.tmp_disk_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='tmp_disk_table_size'; + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +######################################################################## +# Check if global and session variables are independent of each other # +######################################################################## + +SET @@global.tmp_disk_table_size = 1024; +SET @@tmp_disk_table_size = 4294967295; +SELECT @@tmp_disk_table_size = @@global.tmp_disk_table_size; + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +################################################################## +# Check if accessing variable with SESSION,LOCAL and without # +# SCOPE points to same session variable # +################################################################## + +SET @@tmp_disk_table_size = 100; +SELECT @@tmp_disk_table_size = @@local.tmp_disk_table_size; +SELECT @@local.tmp_disk_table_size = @@session.tmp_disk_table_size; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +######################################################################### +# Check if tmp_disk_table_size can be accessed with and without @@ sign # +######################################################################### + +SET tmp_disk_table_size = 1027; +SELECT @@tmp_disk_table_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.tmp_disk_table_size; + +--Error ER_UNKNOWN_TABLE +SELECT global.tmp_disk_table_size; + +--Error ER_BAD_FIELD_ERROR +SELECT tmp_disk_table_size = @@session.tmp_disk_table_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.tmp_disk_table_size = @start_global_value; +SET @@session.tmp_disk_table_size = @start_session_value; + +################################################### +# END OF tmp_disk_table_size TESTS # +################################################### + diff --git a/mysql-test/suite/sys_vars/t/tmp_disk_table_size_func.test b/mysql-test/suite/sys_vars/t/tmp_disk_table_size_func.test new file mode 100644 index 00000000000..bf93b4646d9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/tmp_disk_table_size_func.test @@ -0,0 +1,26 @@ +###################### tmp_memory_table_size_func.test ######################## + +--source include/load_sysvars.inc +--source include/have_sequence.inc + +--echo +--echo "Ensure that we get an error if we exceed tmp_disk_table_size" +--echo + +SET @start_tmp_memory_table_size=@@session.tmp_memory_table_size; +SET @start_tmp_disk_table_size=@@session.tmp_disk_table_size; + +set @@session.tmp_memory_table_size=1000; +set @@session.tmp_disk_table_size=3000000; + +create table t1 (a int primary key, b varchar(2000)); +insert into t1 select seq,repeat(char(mod(seq,62)+64),seq) from seq_1_to_2000; +insert into t1 values (20000,"A"); +select count(*) as c from t1 group by b having c>1; +show status like "created_tmp_disk%"; +set @@session.tmp_disk_table_size=1000000; +--replace_regex /The table '.*' is full/The table '#sql_xxx' is full/ +--error ER_RECORD_FILE_FULL +select count(*) as c from t1 group by b having c>1; +show status like "created_tmp_disk%"; +drop table t1; diff --git a/mysql-test/suite/sys_vars/t/tmp_memory_table_size_basic.test b/mysql-test/suite/sys_vars/t/tmp_memory_table_size_basic.test new file mode 100644 index 00000000000..f5fcb17c8a5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/tmp_memory_table_size_basic.test @@ -0,0 +1,209 @@ +###################### tmp_memory_table_size_basic.test ###################### +# # +# Variable Name: tmp_memory_table_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# # +# Description: Test Cases of Dynamic System Variable tmp_table_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +############################################################################### + +--source include/load_sysvars.inc + +############################################################## +# START OF tmp_memory_table_size TESTS # +############################################################## + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.tmp_memory_table_size; +SET @start_session_value = @@session.tmp_memory_table_size; + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +############################################################## +# Display the DEFAULT value of tmp_memory_table_size # +############################################################## + +SET @@global.tmp_memory_table_size = 10000; +SELECT @@global.tmp_memory_table_size; +SET @@global.tmp_memory_table_size = DEFAULT; +SELECT @@global.tmp_memory_table_size; + +SET @@session.tmp_memory_table_size = 20000; +SELECT @@session.tmp_memory_table_size; +SET @@session.tmp_memory_table_size = DEFAULT; +SELECT @@session.tmp_memory_table_size; + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of tmp_memory_table_size # +######################################################################## +# The DEFAULT value is system dependend. +# Therefore we have only a plausibility check here +SELECT @@global.tmp_memory_table_size >= 16777216; +SELECT @@session.tmp_memory_table_size >= 16777216; + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +######################################################################## +# Change the value of tmp_memory_table_size to a valid value for GLOBAL Scope # +######################################################################## + +SET @@global.tmp_memory_table_size = 1024; +SELECT @@global.tmp_memory_table_size; +SET @@global.tmp_memory_table_size = 60020; +SELECT @@global.tmp_memory_table_size; +SET @@global.tmp_memory_table_size = 4294967295; +SELECT @@global.tmp_memory_table_size; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +######################################################################### +# Change the value of tmp_memory_table_size to a valid value for SESSION Scope # +######################################################################### + +SET @@session.tmp_memory_table_size = 1024; +SELECT @@session.tmp_memory_table_size; + +SET @@session.tmp_memory_table_size = 4294967295; +SELECT @@session.tmp_memory_table_size; +SET @@session.tmp_memory_table_size = 65535; +SELECT @@session.tmp_memory_table_size; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +########################################################## +# Change the value of tmp_memory_table_size to an invalid value # +########################################################## + +SET @@global.tmp_memory_table_size = 0; +SELECT @@global.tmp_memory_table_size; + +SET @@global.tmp_memory_table_size = -1024; +SELECT @@global.tmp_memory_table_size; + +SET @@global.tmp_memory_table_size = 1000; +SELECT @@global.tmp_memory_table_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_memory_table_size = ON; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_memory_table_size = OFF; + +SET @@global.tmp_memory_table_size = True; +SELECT @@global.tmp_memory_table_size; + +SET @@global.tmp_memory_table_size = False; +SELECT @@global.tmp_memory_table_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_memory_table_size = 65530.34; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_memory_table_size ="Test"; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_memory_table_size = ON; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_memory_table_size = OFF; + +SET @@session.tmp_memory_table_size = True; +SELECT @@session.tmp_memory_table_size; + +SET @@session.tmp_memory_table_size = False; +SELECT @@session.tmp_memory_table_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_memory_table_size = "Test"; + +--disable_warnings +SET @@session.tmp_memory_table_size = 12345678901; +--enable_warnings +# With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295 +SELECT @@session.tmp_memory_table_size IN (12345678901,4294967295); + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SELECT @@global.tmp_memory_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='tmp_memory_table_size'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.tmp_memory_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='tmp_memory_table_size'; + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +######################################################################## +# Check if global and session variables are independent of each other # +######################################################################## + +SET @@global.tmp_memory_table_size = 1024; +SET @@tmp_memory_table_size = 4294967295; +SELECT @@tmp_memory_table_size = @@global.tmp_memory_table_size; + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +################################################################## +# Check if accessing variable with SESSION,LOCAL and without # +# SCOPE points to same session variable # +################################################################## + +SET @@tmp_memory_table_size = 100; +SELECT @@tmp_memory_table_size = @@local.tmp_memory_table_size; +SELECT @@local.tmp_memory_table_size = @@session.tmp_memory_table_size; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +######################################################################### +# Check if tmp_memory_table_size can be accessed with and without @@ sign # +######################################################################### + +SET tmp_memory_table_size = 1027; +SELECT @@tmp_memory_table_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.tmp_memory_table_size; + +--Error ER_UNKNOWN_TABLE +SELECT global.tmp_memory_table_size; + +--Error ER_BAD_FIELD_ERROR +SELECT tmp_memory_table_size = @@session.tmp_memory_table_size; + +--echo +--echo "Check that tmp_memory_table_size and tmp_table_size are the same" +--echo + +set @@session.tmp_memory_table_size=100000; +select @@session.tmp_memory_table_size,@@session.tmp_table_size; +set @@session.tmp_memory_table_size=200000; +select @@session.tmp_memory_table_size,@@session.tmp_table_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.tmp_memory_table_size = @start_global_value; +SET @@session.tmp_memory_table_size = @start_session_value; + +################################################### +# END OF tmp_memory_table_size TESTS # +################################################### + diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.test b/mysql-test/suite/wsrep/t/pool_of_threads.test index dbf429e3f01..8e95d0ca495 100644 --- a/mysql-test/suite/wsrep/t/pool_of_threads.test +++ b/mysql-test/suite/wsrep/t/pool_of_threads.test @@ -1,4 +1,4 @@ ---source include/have_wsrep.inc +--source include/have_wsrep_enabled.inc --source include/have_binlog_format_row.inc --echo diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test index 0cc63104fa5..980bff01694 100644 --- a/mysql-test/t/cte_nonrecursive.test +++ b/mysql-test/t/cte_nonrecursive.test @@ -681,3 +681,46 @@ SELECT * FROM cte; DROP TABLE cte; DROP TABLE t; + +--echo # +--echo # MDEV-13107: SHOW TABLE STATUS, SHOW CREATE VIEW +--echo # for CTEs that use derived tables +--echo # + +create table t1(a int) engine=myisam; +insert into t1 values (3), (1), (2); +create table t2 (b int) engine=myisam; +insert into t2 values (2), (10); + +create view v1 as +with t as (select s.a from (select t1.a from t1) s), + r as(select t.a from t2, t where t2.b=t.a) + select a from r; + +create view v2 as +with t as (select s.a from (select t1.a from t1) s), + r as(select t.a from t2, t where t2.b=t.a) + select a from t1; + +--disable_result_log +show table status; +--enable_result_log + +show create view v1; +show create view v2; + +select * from v1; +select * from v2; + +prepare stmt1 from "select * from v1"; +execute stmt1; +execute stmt1; +prepare stmt2 from "select * from v2"; +execute stmt2; +execute stmt2; + +deallocate prepare stmt1; +deallocate prepare stmt2; + +drop view v1,v2; +drop table t1,t2; diff --git a/mysql-test/t/derived_cond_pushdown.test b/mysql-test/t/derived_cond_pushdown.test index beeaa7350f7..de8a479614e 100644 --- a/mysql-test/t/derived_cond_pushdown.test +++ b/mysql-test/t/derived_cond_pushdown.test @@ -1526,3 +1526,25 @@ eval explain format=json $q; DROP VIEW v1; DROP TABLE t1; + +--echo # +--echo # MDEV-13193: pushdown of equality extracted from multiple equality +--echo # + +CREATE TABLE t1 (i1 int, KEY(i1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (i2 int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (2),(4); + +CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2; + +let $q= +SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq + WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 ); + +eval $q; +eval explain format=json $q; + +DROP VIEW v2; +DROP TABLE t1,t2; diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test index dfcf00cabf9..614c3638f64 100644 --- a/mysql-test/t/win.test +++ b/mysql-test/t/win.test @@ -1879,6 +1879,43 @@ select max(id), rank() over (order by max(id)) from t1 where id < 3; drop table t1; --echo # +--echo # main.win failure post MDEV-12336 +--echo # +create table t(a decimal(35,10), b int); +insert into t values (1, 10), (2, 20), (3, 30); + +prepare stmt from "SELECT (CASE WHEN sum(t.a) over (partition by t.b)=1 THEN 1000 ELSE 300 END) AS a FROM t"; +execute stmt; +drop table t; + +--echo # +--echo # MDEV-12851 case with window functions query crashes server +--echo # + +create table t1(dt datetime); +insert into t1 values ('2017-05-17'), ('2017-05-18'); +select dt, + case when (max(dt) over (order by dt rows between 1 following and 1 following) is null) + then '9999-12-31 12:00:00' + else max(dt) over (order by dt rows between 1 following and 1 following) + end x, + case when (max(dt) over (order by dt rows between 1 following and 1 following) is not null) + then '9999-12-31 12:00:00' + else max(dt) over (order by dt rows between 1 following and 1 following) + end x +from t1; + +drop table t1; + +create table t1(i int); +insert into t1 values (null),(1),(2); +select max(i) over (order by i), + max(i) over (order by i) is null, + max(i) over (order by i) is not null +from t1; +drop table t1; + +--echo # --echo # Start of 10.3 tests --echo # diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 23f2d7984d3..0c2c1da354c 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -74,34 +74,6 @@ int (*_my_b_encr_read)(IO_CACHE *info,uchar *Buffer,size_t Count)= 0; int (*_my_b_encr_write)(IO_CACHE *info,const uchar *Buffer,size_t Count)= 0; -/* - Setup internal pointers inside IO_CACHE - - SYNOPSIS - setup_io_cache() - info IO_CACHE handler - - NOTES - This is called on automatically on init or reinit of IO_CACHE - It must be called externally if one moves or copies an IO_CACHE - object. -*/ - -void setup_io_cache(IO_CACHE* info) -{ - /* Ensure that my_b_tell() and my_b_bytes_in_cache works */ - if (info->type == WRITE_CACHE) - { - info->current_pos= &info->write_pos; - info->current_end= &info->write_end; - } - else - { - info->current_pos= &info->read_pos; - info->current_end= &info->read_end; - } -} - static void init_functions(IO_CACHE* info) @@ -148,8 +120,6 @@ init_functions(IO_CACHE* info) DBUG_ASSERT(0); break; } - - setup_io_cache(info); } @@ -360,12 +330,7 @@ int init_slave_io_cache(IO_CACHE *master, IO_CACHE *slave) memcpy(slave->buffer, master->buffer, master->buffer_length); slave->read_pos= slave->buffer + (master->read_pos - master->buffer); slave->read_end= slave->buffer + (master->read_end - master->buffer); - - DBUG_ASSERT(master->current_pos == &master->read_pos); - slave->current_pos= &slave->read_pos; - DBUG_ASSERT(master->current_end == &master->read_end); - slave->current_end= &slave->read_end; - + if (master->next_file_user) { IO_CACHE *p; @@ -924,8 +889,6 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, read_cache->share= cshare; read_cache->read_function= _my_b_cache_read_r; - read_cache->current_pos= NULL; - read_cache->current_end= NULL; if (write_cache) { diff --git a/sql/filesort.cc b/sql/filesort.cc index 8ca6cd04cda..31ff2e511a9 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1486,8 +1486,6 @@ int merge_many_buff(Sort_param *param, uchar *sort_buffer, if (flush_io_cache(to_file)) break; /* purecov: inspected */ temp=from_file; from_file=to_file; to_file=temp; - setup_io_cache(from_file); - setup_io_cache(to_file); *maxbuffer= (uint) (lastbuff-buffpek)-1; } cleanup: @@ -1495,7 +1493,6 @@ cleanup: if (to_file == t_file) { *t_file=t_file2; // Copy result file - setup_io_cache(t_file); } DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */ diff --git a/sql/item.cc b/sql/item.cc index 7279c79cef9..5f08f26b1de 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2193,6 +2193,9 @@ void Item::split_sum_func2(THD *thd, Ref_ptr_array ref_pointer_array, point to the temporary table. */ split_sum_func(thd, ref_pointer_array, fields, split_flags); + if (type() == FUNC_ITEM) { + return; + } } else { @@ -2252,9 +2255,6 @@ void Item::split_sum_func2(THD *thd, Ref_ptr_array ref_pointer_array, &name)))) return; // fatal_error is set } - else if (type() == FUNC_ITEM && - ((Item_func *) this)->with_window_func) - return; else { if (!(item_ref= (new (thd->mem_root) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 0afbd875ac2..73e45d4f108 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -2313,11 +2313,6 @@ public: Item_func_isnull(THD *thd, Item *a): Item_func_null_predicate(thd, a) {} longlong val_int(); enum Functype functype() const { return ISNULL_FUNC; } - void fix_length_and_dec() - { - Item_func_null_predicate::fix_length_and_dec(); - update_used_tables(); - } const char *func_name() const { return "isnull"; } void print(String *str, enum_query_type query_type); enum precedence precedence() const { return CMP_PRECEDENCE; } diff --git a/sql/item_func.cc b/sql/item_func.cc index c36f177223b..f56ede71b40 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -245,8 +245,9 @@ bool Item_func::check_argument_types_scalar(uint start, uint end) const is to allow all Item_field() objects to setup pointers to the table fields. Sets as a side effect the following class variables: - maybe_null Set if any argument may return NULL - with_sum_func Set if any of the arguments contains a sum function + maybe_null Set if any argument may return NULL + with_sum_func Set if any of the arguments contains a sum function + with_window_func Set if any of the arguments contain a window function with_field Set if any of the arguments contains or is a field used_tables_cache Set to union of the tables used by arguments @@ -3649,7 +3650,7 @@ longlong Item_master_gtid_wait::val_int() { DBUG_ASSERT(fixed == 1); longlong result= 0; - String *gtid_pos = args[0]->val_str(&value); + String *gtid_pos __attribute__((unused)) = args[0]->val_str(&value); if (args[0]->null_value) { diff --git a/sql/item_sum.cc b/sql/item_sum.cc index a712ca67eef..97be5f15a8d 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -38,8 +38,8 @@ ulonglong Item_sum::ram_limitation(THD *thd) { - return MY_MIN(thd->variables.tmp_table_size, - thd->variables.max_heap_table_size); + return MY_MIN(thd->variables.tmp_memory_table_size, + thd->variables.max_heap_table_size); } diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 1b245342f76..e34a80b7572 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4214,13 +4214,13 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) field->set_table_name(&table->alias); } - if (thd->variables.tmp_table_size == ~ (ulonglong) 0) // No limit + if (thd->variables.tmp_memory_table_size == ~ (ulonglong) 0) // No limit share->max_rows= ~(ha_rows) 0; else share->max_rows= (ha_rows) (((share->db_type() == heap_hton) ? - MY_MIN(thd->variables.tmp_table_size, - thd->variables.max_heap_table_size) : - thd->variables.tmp_table_size) / + MY_MIN(thd->variables.tmp_memory_table_size, + thd->variables.max_heap_table_size) : + thd->variables.tmp_memory_table_size) / share->reclength); set_if_bigger(share->max_rows,1); // For dummy start options diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e272a0e4a7f..995debc9f90 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4806,7 +4806,7 @@ bool open_tables_only_view_structure(THD *thd, TABLE_LIST *table_list, MYSQL_OPEN_GET_NEW_TABLE | (can_deadlock ? MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)), - DT_PREPARE | DT_CREATE)); + DT_INIT | DT_PREPARE | DT_CREATE)); /* Restore old value of sql_command back as it is being looked at in process_table() function. diff --git a/sql/sql_class.h b/sql/sql_class.h index 79097d818a4..eab078fe62d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -521,7 +521,8 @@ typedef struct system_variables uint dynamic_variables_size; /* how many bytes are in use */ ulonglong max_heap_table_size; - ulonglong tmp_table_size; + ulonglong tmp_memory_table_size; + ulonglong tmp_disk_table_size; ulonglong long_query_time; ulonglong max_statement_time; ulonglong optimizer_switch; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 4d7a3d81bd6..37d70bdc7ba 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1576,7 +1576,7 @@ static int mysql_test_select(Prepared_statement *stmt, } if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) goto error; thd->lex->used_tables= 0; // Updated by setup_fields diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8e977334593..656dd66506c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -16681,7 +16681,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields, if (blob_count || using_unique_constraint || (thd->variables.big_tables && !(select_options & SELECT_SMALL_RESULT)) || (select_options & TMP_TABLE_FORCE_MYISAM) - || thd->variables.tmp_table_size == 0) + || thd->variables.tmp_memory_table_size == 0) { share->db_plugin= ha_lock_engine(0, TMP_ENGINE_HTON); table->file= get_new_handler(share, &table->mem_root, @@ -16845,14 +16845,14 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields, param->recinfo= recinfo; // Pointer to after last field store_record(table,s->default_values); // Make empty default record - if (thd->variables.tmp_table_size == ~ (ulonglong) 0) // No limit + if (thd->variables.tmp_memory_table_size == ~ (ulonglong) 0) // No limit share->max_rows= ~(ha_rows) 0; else share->max_rows= (ha_rows) (((share->db_type() == heap_hton) ? - MY_MIN(thd->variables.tmp_table_size, + MY_MIN(thd->variables.tmp_memory_table_size, thd->variables.max_heap_table_size) : - thd->variables.tmp_table_size) / - share->reclength); + thd->variables.tmp_memory_table_size) / + share->reclength); set_if_bigger(share->max_rows,1); // For dummy start options /* Push the LIMIT clause to the temporary table creation, so that we @@ -17390,10 +17390,7 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, } } bzero((char*) &create_info,sizeof(create_info)); - - /* Use long data format, to ensure we never get a 'table is full' error */ - if (!(options & SELECT_SMALL_RESULT)) - create_info.data_file_length= ~(ulonglong) 0; + create_info.data_file_length= table->in_use->variables.tmp_disk_table_size; /* The logic for choosing the record format: @@ -17589,9 +17586,7 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, } MI_CREATE_INFO create_info; bzero((char*) &create_info,sizeof(create_info)); - - if (!(options & SELECT_SMALL_RESULT)) - create_info.data_file_length= ~(ulonglong) 0; + create_info.data_file_length= table->in_use->variables.tmp_disk_table_size; if ((error=mi_create(share->table_name.str, share->keys, &keydef, (uint) (*recinfo-start_recinfo), @@ -26303,7 +26298,8 @@ AGGR_OP::put_record(bool end_of_records) { // Lasy tmp table creation/initialization if (!join_tab->table->file->inited) - prepare_tmp_table(); + if (prepare_tmp_table()) + return NESTED_LOOP_ERROR; enum_nested_loop_state rc= (*write_func)(join_tab->join, join_tab, end_of_records); return rc; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b2ee8a2eef0..dcf8e62dce2 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1166,7 +1166,7 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list, bool open_error= open_tables(thd, &table_list, &counter, MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL) || - mysql_handle_derived(thd->lex, DT_PREPARE); + mysql_handle_derived(thd->lex, DT_INIT | DT_PREPARE); thd->pop_internal_handler(); if (open_error && (thd->killed || thd->is_error())) goto exit; @@ -1428,7 +1428,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild) if (open_normal_and_derived_tables(thd, table_list, MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL, - DT_PREPARE | DT_CREATE)) + DT_INIT | DT_PREPARE | DT_CREATE)) DBUG_VOID_RETURN; table= table_list->table; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 6558d930e72..e897574f65b 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3421,12 +3421,30 @@ static Sys_var_tx_read_only Sys_tx_read_only( static Sys_var_ulonglong Sys_tmp_table_size( "tmp_table_size", + "Alias for tmp_memory_table_size. " "If an internal in-memory temporary table exceeds this size, MySQL " - "will automatically convert it to an on-disk MyISAM or Aria table", - SESSION_VAR(tmp_table_size), CMD_LINE(REQUIRED_ARG), + "will automatically convert it to an on-disk MyISAM or Aria table.", + SESSION_VAR(tmp_memory_table_size), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1024, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024), BLOCK_SIZE(1)); +static Sys_var_ulonglong Sys_tmp_memory_table_size( + "tmp_memory_table_size", + "If an internal in-memory temporary table exceeds this size, MySQL " + "will automatically convert it to an on-disk MyISAM or Aria table. " + "Same as tmp_table_size.", + SESSION_VAR(tmp_memory_table_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, (ulonglong)~(intptr)0), DEFAULT(16*1024*1024), + BLOCK_SIZE(1)); + +static Sys_var_ulonglong Sys_tmp_disk_table_size( + "tmp_disk_table_size", + "Max size for data for an internal temporary on-disk MyISAM or Aria table.", + SESSION_VAR(tmp_disk_table_size), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, (ulonglong)~(intptr)0), + DEFAULT((ulonglong)~(intptr)0), + BLOCK_SIZE(1)); + static Sys_var_mybool Sys_timed_mutexes( "timed_mutexes", "Specify whether to time mutexes. Deprecated, has no effect.", diff --git a/sql/table.cc b/sql/table.cc index dcfb3edff33..4a1214cbb70 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -8249,8 +8249,12 @@ Item* TABLE_LIST::build_pushable_cond_for_table(THD *thd, Item *cond) Item *left_item_clone= left_item->build_clone(thd, thd->mem_root); Item *right_item_clone= item->build_clone(thd, thd->mem_root); if (left_item_clone && right_item_clone) + { + left_item_clone->set_item_equal(NULL); + right_item_clone->set_item_equal(NULL); eq= new (thd->mem_root) Item_func_eq(thd, right_item_clone, left_item_clone); + } if (eq) { i++; diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 0aa5396f35b..87993e0af2b 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -323,16 +323,6 @@ bool THD::open_temporary_table(TABLE_LIST *tl) TABLE *table= NULL; /* - Since temporary tables are not safe for parallel replication, lets - wait for the prior commits in case the table is found to be in use. - */ - if (rgi_slave && - rgi_slave->is_parallel_exec && - find_temporary_table(tl) && - wait_for_prior_commit()) - DBUG_RETURN(true); - - /* Code in open_table() assumes that TABLE_LIST::table can be non-zero only for pre-opened temporary tables. */ @@ -353,6 +343,22 @@ bool THD::open_temporary_table(TABLE_LIST *tl) } /* + Temporary tables are not safe for parallel replication. They were + designed to be visible to one thread only, so have no table locking. + Thus there is no protection against two conflicting transactions + committing in parallel and things like that. + + So for now, anything that uses temporary tables will be serialised + with anything before it, when using parallel replication. + */ + + if (rgi_slave && + rgi_slave->is_parallel_exec && + find_temporary_table(tl) && + wait_for_prior_commit()) + DBUG_RETURN(true); + + /* First check if there is a reusable open table available in the open table list. */ @@ -380,26 +386,6 @@ bool THD::open_temporary_table(TABLE_LIST *tl) DBUG_RETURN(false); } - /* - Temporary tables are not safe for parallel replication. They were - designed to be visible to one thread only, so have no table locking. - Thus there is no protection against two conflicting transactions - committing in parallel and things like that. - - So for now, anything that uses temporary tables will be serialised - with anything before it, when using parallel replication. - - TODO: We might be able to introduce a reference count or something - on temp tables, and have slave worker threads wait for it to reach - zero before being allowed to use the temp table. Might not be worth - it though, as statement-based replication using temporary tables is - in any case rather fragile. - */ - if (rgi_slave && - rgi_slave->is_parallel_exec && - wait_for_prior_commit()) - DBUG_RETURN(true); - #ifdef WITH_PARTITION_STORAGE_ENGINE if (tl->partition_names) { diff --git a/storage/connect/fmdlex.c b/storage/connect/fmdlex.c index 548a7ae5b7e..ef4f7bfc65a 100644 --- a/storage/connect/fmdlex.c +++ b/storage/connect/fmdlex.c @@ -529,7 +529,7 @@ YY_DECL pp->Num = 0; if (pp->InFmt) {*pp->InFmt = '\0'; pp->InFmt[pp->Outsize -1] = '\0'; } if (pp->OutFmt) {*pp->OutFmt = '\0'; pp->OutFmt[pp->Outsize -1] = '\0'; } - pp->Curp = pp->Format; + pp->Curp = (char*) pp->Format; yy_init = 1; /* This is a new input */ diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index bdddcf64ca8..97ff7bc59f2 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -124,7 +124,7 @@ bool MYSQLDEF::GetServerInfo(PGLOBAL g, const char *server_name) DBUG_RETURN(true); } // endif server - DBUG_PRINT("info", ("get_server_by_name returned server at %lx", + DBUG_PRINT("info", ("get_server_by_name returned server at %zx", (size_t) server)); // TODO: We need to examine which of these can really be NULL diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 89ebe5b8783..64a14d0e959 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -4673,29 +4673,12 @@ btr_index_rec_validate( rec_get_nth_field_offs(offsets, i, &len); /* Note that if fixed_size != 0, it equals the - length of a fixed-size column in the clustered index, - except the DATA_POINT, whose length would be MBR_LEN - when it's indexed in a R-TREE. We should adjust it here. + length of a fixed-size column in the clustered index. + We should adjust it here. A prefix index of the column is of fixed, but different length. When fixed_size == 0, prefix_len is the maximum length of the prefix index column. */ - if (dict_field_get_col(field)->mtype == DATA_POINT) { - ut_ad(fixed_size == DATA_POINT_LEN); - if (dict_index_is_spatial(index)) { - /* For DATA_POINT data, when it has R-tree - index, the fixed_len is the MBR of the point. - But if it's a primary key and on R-TREE - as the PK pointer, the length shall be - DATA_POINT_LEN as well. */ - ut_ad((field->fixed_len == DATA_MBR_LEN - && i == 0) - || (field->fixed_len == DATA_POINT_LEN - && i != 0)); - fixed_size = field->fixed_len; - } - } - if ((field->prefix_len == 0 && len != UNIV_SQL_NULL && fixed_size && len != fixed_size) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 3bef25e945c..7bdd03c8a9e 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -3679,6 +3679,11 @@ btr_cur_update_in_place( was_delete_marked = rec_get_deleted_flag( rec, page_is_comp(buf_block_get_frame(block))); + /* In delete-marked records, DB_TRX_ID must always refer to an + existing undo log record. */ + ut_ad(!was_delete_marked + || !dict_index_is_clust(index) + || row_get_rec_trx_id(rec, index, offsets)); #ifdef BTR_CUR_HASH_ADAPT if (block->index) { @@ -4321,6 +4326,10 @@ btr_cur_pessimistic_update( stored fields */ btr_cur_unmark_extern_fields( page_zip, rec, index, *offsets, mtr); + } else { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(row_get_rec_trx_id(rec, index, *offsets)); } bool adjust = big_rec_vec && (flags & BTR_KEEP_POS_FLAG); @@ -4448,6 +4457,10 @@ btr_cur_pessimistic_update( btr_cur_unmark_extern_fields(page_zip, rec, index, *offsets, mtr); + } else { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(row_get_rec_trx_id(rec, index, *offsets)); } if (!dict_table_is_locking_disabled(index->table)) { @@ -4573,6 +4586,10 @@ btr_cur_parse_del_mark_set_clust_rec( ut_a(offset <= UNIV_PAGE_SIZE); + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(trx_id || (flags & BTR_KEEP_SYS_FLAG)); + if (page) { rec = page + offset; @@ -4582,20 +4599,37 @@ btr_cur_parse_del_mark_set_clust_rec( and the adaptive hash index does not depend on them. */ btr_rec_set_deleted_flag(rec, page_zip, val); + /* pos is the offset of DB_TRX_ID in the clustered index. + Debug assertions may also access DB_ROLL_PTR at pos+1. + Therefore, we must compute offsets for the first pos+2 + clustered index fields. */ + ut_ad(pos <= MAX_REF_PARTS); - if (!(flags & BTR_KEEP_SYS_FLAG)) { - mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - rec_offs_init(offsets_); + ulint offsets[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; + rec_offs_init(offsets); + mem_heap_t* heap = NULL; + if (!(flags & BTR_KEEP_SYS_FLAG)) { row_upd_rec_sys_fields_in_recovery( rec, page_zip, - rec_get_offsets(rec, index, offsets_, - ULINT_UNDEFINED, &heap), + rec_get_offsets(rec, index, offsets, + pos + 2, &heap), pos, trx_id, roll_ptr); - if (UNIV_LIKELY_NULL(heap)) { - mem_heap_free(heap); - } + } else { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(memcmp(rec_get_nth_field( + rec, + rec_get_offsets(rec, index, + offsets, pos, + &heap), + pos, &offset), + field_ref_zero, DATA_TRX_ID_LEN)); + ut_ad(offset == DATA_TRX_ID_LEN); + } + + if (UNIV_LIKELY_NULL(heap)) { + mem_heap_free(heap); } } @@ -4633,8 +4667,10 @@ btr_cur_del_mark_set_clust_rec( ut_ad(mtr->is_named_space(index->space)); if (rec_get_deleted_flag(rec, rec_offs_comp(offsets))) { - /* While cascading delete operations, this becomes possible. */ - ut_ad(rec_get_trx_id(rec, index) == thr_get_trx(thr)->id); + /* We may already have delete-marked this record + when executing an ON DELETE CASCADE operation. */ + ut_ad(row_get_rec_trx_id(rec, index, offsets) + == thr_get_trx(thr)->id); return(DB_SUCCESS); } @@ -4663,10 +4699,6 @@ btr_cur_del_mark_set_clust_rec( btr_rec_set_deleted_flag(rec, page_zip, TRUE); trx = thr_get_trx(thr); - /* This function must not be invoked during rollback - (of a TRX_STATE_PREPARE transaction or otherwise). */ - ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE)); - ut_ad(!trx->in_rollback); DBUG_LOG("ib_cur", "delete-mark clust " << index->table->name diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 8d6d95a020e..61006c8d89d 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -5959,9 +5959,8 @@ database_corrupted: error injection */ DBUG_EXECUTE_IF( "buf_page_import_corrupt_failure", - if (bpage->id.space() - > srv_undo_tablespaces_open - && bpage->id.space() != SRV_TMP_SPACE_ID) { + if (!is_predefined_tablespace( + bpage->id.space())) { buf_mark_space_corrupt(bpage); ib::info() << "Simulated IMPORT " "corruption"; @@ -6027,8 +6026,7 @@ database_corrupted: if (uncompressed && !recv_no_ibuf_operations && (bpage->id.space() == 0 - || (bpage->id.space() > srv_undo_tablespaces_open - && bpage->id.space() != SRV_TMP_SPACE_ID)) + || !is_predefined_tablespace(bpage->id.space())) && !srv_is_tablespace_truncated(bpage->id.space()) && fil_page_get_type(frame) == FIL_PAGE_INDEX && page_is_leaf(frame)) { diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index 20603021072..b8b7643702e 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -813,23 +813,26 @@ buf_read_ibuf_merge_pages( #endif for (ulint i = 0; i < n_stored; i++) { - const page_id_t page_id(space_ids[i], page_nos[i]); - - buf_pool_t* buf_pool = buf_pool_get(page_id); - bool found; const page_size_t page_size(fil_space_get_page_size( space_ids[i], &found)); if (!found) { tablespace_deleted: - /* The tablespace was not found, remove the - entries for that page */ - ibuf_merge_or_delete_for_page(NULL, page_id, - NULL, FALSE); + /* The tablespace was not found: remove all + entries for it */ + ibuf_delete_for_discarded_space(space_ids[i]); + while (i + 1 < n_stored + && space_ids[i + 1] == space_ids[i]) { + i++; + } continue; } + const page_id_t page_id(space_ids[i], page_nos[i]); + + buf_pool_t* buf_pool = buf_pool_get(page_id); + while (buf_pool->n_pend_reads > buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) { os_thread_sleep(500000); diff --git a/storage/innobase/data/data0type.cc b/storage/innobase/data/data0type.cc index a40724b303d..d4b809c3f59 100644 --- a/storage/innobase/data/data0type.cc +++ b/storage/innobase/data/data0type.cc @@ -193,14 +193,6 @@ dtype_print(const dtype_t* type) fputs("DATA_BLOB", stderr); break; - case DATA_POINT: - fputs("DATA_POINT", stderr); - break; - - case DATA_VAR_POINT: - fputs("DATA_VAR_POINT", stderr); - break; - case DATA_GEOMETRY: fputs("DATA_GEOMETRY", stderr); break; diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index df36a320616..943a37ef4e0 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -2892,22 +2892,9 @@ dict_index_add_col( field = dict_index_get_nth_field(index, index->n_def - 1); field->col = col; - /* DATA_POINT is a special type, whose fixed_len should be: - 1) DATA_MBR_LEN, when it's indexed in R-TREE. In this case, - it must be the first col to be added. - 2) DATA_POINT_LEN(be equal to fixed size of column), when it's - indexed in B-TREE, - 3) DATA_POINT_LEN, if a POINT col is the PRIMARY KEY, and we are - adding the PK col to other B-TREE/R-TREE. */ - /* TODO: We suppose the dimension is 2 now. */ - if (dict_index_is_spatial(index) && DATA_POINT_MTYPE(col->mtype) - && index->n_def == 1) { - field->fixed_len = DATA_MBR_LEN; - } else { - field->fixed_len = static_cast<unsigned int>( - dict_col_get_fixed_size( - col, dict_table_is_comp(table))); - } + field->fixed_len = static_cast<unsigned int>( + dict_col_get_fixed_size( + col, dict_table_is_comp(table))); if (prefix_len && field->fixed_len > prefix_len) { field->fixed_len = (unsigned int) prefix_len; diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc index 7ca81898f70..94fae3d973b 100644 --- a/storage/innobase/fsp/fsp0space.cc +++ b/storage/innobase/fsp/fsp0space.cc @@ -39,11 +39,8 @@ bool Tablespace::intersection( const Tablespace* other_space) { - files_t::const_iterator end = other_space->m_files.end(); - - for (files_t::const_iterator it = other_space->m_files.begin(); - it != end; - ++it) { + for (files_t::const_iterator it(other_space->begin()), + end(other_space->end()); it != end; ++it) { if (find(it->m_filename)) { @@ -58,14 +55,13 @@ Tablespace::intersection( void Tablespace::shutdown() { - files_t::iterator end = m_files.end(); - - for (files_t::iterator it = m_files.begin(); it != end; ++it) { + for (iterator it = begin(); it != end(); ++it) { it->shutdown(); } m_files.clear(); - + ut_free(m_path); + m_path = NULL; m_space_id = ULINT_UNDEFINED; } @@ -94,10 +90,7 @@ Tablespace::open_or_create(bool is_temp) ut_ad(!m_files.empty()); - files_t::iterator begin = m_files.begin(); - files_t::iterator end = m_files.end(); - - for (files_t::iterator it = begin; it != end; ++it) { + for (iterator it = begin(); it != end(); ++it) { if (it->m_exists) { err = it->open_or_create( @@ -123,7 +116,7 @@ Tablespace::open_or_create(bool is_temp) the proper way. */ it->close(); - if (it == begin) { + if (it == begin()) { /* First data file. */ /* Create the tablespace entry for the multi-file @@ -153,11 +146,9 @@ Tablespace::open_or_create(bool is_temp) /** Find a filename in the list of Datafiles for a tablespace @return true if the filename exists in the data files */ bool -Tablespace::find(const char* filename) +Tablespace::find(const char* filename) const { - files_t::const_iterator end = m_files.end(); - - for (files_t::const_iterator it = m_files.begin(); it != end; ++it) { + for (const_iterator it = begin(); it != end(); ++it) { if (innobase_strcasecmp(filename, it->m_filename) == 0) { return(true); @@ -171,9 +162,7 @@ Tablespace::find(const char* filename) void Tablespace::delete_files() { - files_t::iterator end = m_files.end(); - - for (files_t::iterator it = m_files.begin(); it != end; ++it) { + for (iterator it = begin(); it != end(); ++it) { it->close(); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cb056abc8c8..4d7a33e77c8 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -212,7 +212,7 @@ static ulong innobase_commit_concurrency = 0; static ulong innobase_read_io_threads; static ulong innobase_write_io_threads; -static long long innobase_buffer_pool_size, innobase_log_file_size; +static long long innobase_buffer_pool_size; /** Percentage of the buffer pool to reserve for 'old' blocks. Connected to buf_LRU_old_ratio. */ @@ -4242,8 +4242,6 @@ innobase_change_buffering_inited_ok: srv_file_flush_method_str = innobase_file_flush_method; - srv_log_file_size = (ib_uint64_t) innobase_log_file_size; - if (UNIV_PAGE_SIZE_DEF != srv_page_size) { ib::info() << "innodb_page_size=" << srv_page_size; @@ -5975,14 +5973,6 @@ innobase_match_index_columns( spatial index on it and we intend to use DATA_GEOMETRY for legacy GIS data types which are of var-length. */ switch (col_type) { - case DATA_POINT: - case DATA_VAR_POINT: - if (DATA_POINT_MTYPE(mtype) - || mtype == DATA_GEOMETRY - || mtype == DATA_BLOB) { - break; - } - /* Fall through */ case DATA_GEOMETRY: if (mtype == DATA_BLOB) { break; @@ -7973,12 +7963,6 @@ build_template_field( prebuilt->templ_contains_blob = TRUE; } - if (templ->type == DATA_POINT) { - /* We set this only when it's DATA_POINT, but not - DATA_VAR_POINT */ - prebuilt->templ_contains_fixed_point = TRUE; - } - return(templ); } @@ -8064,7 +8048,6 @@ ha_innobase::build_template( /* Prepare to build m_prebuilt->mysql_template[]. */ m_prebuilt->templ_contains_blob = FALSE; - m_prebuilt->templ_contains_fixed_point = FALSE; m_prebuilt->mysql_prefix_len = 0; m_prebuilt->n_template = 0; m_prebuilt->idx_cond_n_cols = 0; @@ -8501,15 +8484,15 @@ ha_innobase::write_row( || sql_command == SQLCOM_OPTIMIZE || sql_command == SQLCOM_CREATE_INDEX #ifdef WITH_WSREP - || (wsrep_on(m_user_thd) && wsrep_load_data_splitting && - sql_command == SQLCOM_LOAD && - !thd_test_options( - m_user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + || (sql_command == SQLCOM_LOAD + && wsrep_load_data_splitting && wsrep_on(m_user_thd) + && !thd_test_options( + m_user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) #endif /* WITH_WSREP */ || sql_command == SQLCOM_DROP_INDEX) && m_num_write_row >= 10000) { #ifdef WITH_WSREP - if (wsrep_on(m_user_thd) && sql_command == SQLCOM_LOAD) { + if (sql_command == SQLCOM_LOAD && wsrep_on(m_user_thd)) { WSREP_DEBUG("forced trx split for LOAD: %s", wsrep_thd_query(m_user_thd)); } @@ -8955,8 +8938,6 @@ calc_row_difference( switch (col_type) { case DATA_BLOB: - case DATA_POINT: - case DATA_VAR_POINT: case DATA_GEOMETRY: o_ptr = row_mysql_read_blob_ref(&o_len, o_ptr, o_len); n_ptr = row_mysql_read_blob_ref(&n_len, n_ptr, n_len); @@ -11719,10 +11700,6 @@ create_table_info_t::create_table_def() } } - if (col_type == DATA_POINT) { - col_len = DATA_POINT_LEN; - } - is_virtual = (innobase_is_v_fld(field)) ? DATA_VIRTUAL : 0; is_stored = innobase_is_s_fld(field); @@ -13036,8 +13013,6 @@ create_table_info_t::set_tablespace_type( int create_table_info_t::initialize() { - trx_t* parent_trx __attribute__((unused)); - DBUG_ENTER("create_table_info_t::initialize"); ut_ad(m_thd != NULL); @@ -13059,7 +13034,7 @@ create_table_info_t::initialize() /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(m_thd); + check_trx_exists(m_thd); DBUG_RETURN(0); } @@ -21199,10 +21174,12 @@ static MYSQL_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size, "The size of the buffer which InnoDB uses to write log to the log files on disk.", NULL, NULL, 16*1024*1024L, 256*1024L, LONG_MAX, 1024); -static MYSQL_SYSVAR_LONGLONG(log_file_size, innobase_log_file_size, +static MYSQL_SYSVAR_ULONGLONG(log_file_size, srv_log_file_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Size of each log file in a log group.", - NULL, NULL, 48 << 20, 1 << 20, 512ULL << 30, 1 << 20); + NULL, NULL, 48 << 20, 1 << 20, 512ULL << 30, UNIV_PAGE_SIZE_MAX); +/* OS_FILE_LOG_BLOCK_SIZE would be more appropriate than UNIV_PAGE_SIZE_MAX, +but fil_space_t is being used for the redo log, and it uses data pages. */ static MYSQL_SYSVAR_ULONG(log_files_in_group, srv_n_log_files, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 24bfb31b1fb..0f8e1e8178d 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1760,7 +1760,6 @@ innobase_col_to_mysql( memcpy(dest, data, len); break; - case DATA_VAR_POINT: case DATA_GEOMETRY: case DATA_BLOB: /* Skip MySQL BLOBs when reporting an erroneous row @@ -1785,7 +1784,6 @@ innobase_col_to_mysql( case DATA_FLOAT: case DATA_DOUBLE: case DATA_DECIMAL: - case DATA_POINT: /* Above are the valid column types for MySQL data. */ ut_ad(flen == len); /* fall through */ @@ -3011,29 +3009,6 @@ innobase_check_foreigns( return(false); } -/** Get the default POINT value in MySQL format -@param[in] heap memory heap where allocated -@param[in] length length of MySQL format -@return mysql format data */ -static -const byte* -innobase_build_default_mysql_point( - mem_heap_t* heap, - ulint length) -{ - byte* buf = static_cast<byte*>(mem_heap_alloc( - heap, DATA_POINT_LEN + length)); - - byte* wkb = buf + length; - - ulint len = get_wkb_of_default_point(SPDIMS, wkb, DATA_POINT_LEN); - ut_ad(len == DATA_POINT_LEN); - - row_mysql_store_blob_ref(buf, length, wkb, len); - - return(buf); -} - /** Convert a default value for ADD COLUMN. @param heap Memory heap where allocated @@ -3060,16 +3035,6 @@ innobase_build_col_map_add( const byte* mysql_data = field->ptr; - if (dfield_get_type(dfield)->mtype == DATA_POINT) { - /** If the DATA_POINT field is NOT NULL, we need to - give it a default value, since DATA_POINT is a fixed length - type, we couldn't store a value of length 0, like other - geom types. Server doesn't provide the default value, and - we would use POINT(0 0) here instead. */ - - mysql_data = innobase_build_default_mysql_point(heap, size); - } - row_mysql_store_col_in_innobase_format( dfield, buf, true, mysql_data, size, comp); } @@ -4703,12 +4668,6 @@ prepare_inplace_alter_table_dict( } - if (col_type == DATA_POINT) { - /* DATA_POINT should be of fixed length, - instead of the pack_length(blob length). */ - col_len = DATA_POINT_LEN; - } - if (dict_col_name_is_reserved(field->field_name.str)) { dict_mem_table_free(ctx->new_table); my_error(ER_WRONG_COLUMN_NAME, MYF(0), diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index 3fa8320b5aa..35dcf2f3397 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -77,28 +77,18 @@ binary strings */ charset-collation for tables created with it can also be latin1_swedish_ci */ -/* DATA_POINT&DATA_VAR_POINT are for standard geometry datatype 'point' and -DATA_GEOMETRY include all other standard geometry datatypes as described in -OGC standard(line_string, polygon, multi_point, multi_polygon, +/* DATA_GEOMETRY includes all standard geometry datatypes as described in +OGC standard(point, line_string, polygon, multi_point, multi_polygon, multi_line_string, geometry_collection, geometry). Currently, geometry data is stored in the standard Well-Known Binary(WKB) format (http://www.opengeospatial.org/standards/sfa). -We use BLOB as underlying datatype for DATA_GEOMETRY and DATA_VAR_POINT -while CHAR for DATA_POINT */ +We use BLOB as the underlying datatype. */ #define DATA_GEOMETRY 14 /* geometry datatype of variable length */ -/* The following two are disabled temporarily, we won't create them in -get_innobase_type_from_mysql_type(). -TODO: We will enable DATA_POINT/them when we come to the fixed-length POINT -again. */ -#define DATA_POINT 15 /* geometry datatype of fixed length POINT */ -#define DATA_VAR_POINT 16 /* geometry datatype of variable length - POINT, used when we want to store POINT - as BLOB internally */ #define DATA_MTYPE_MAX 63 /* dtype_store_for_order_and_null_size() requires the values are <= 63 */ #define DATA_MTYPE_CURRENT_MIN DATA_VARCHAR /* minimum value of mtype */ -#define DATA_MTYPE_CURRENT_MAX DATA_VAR_POINT /* maximum value of mtype */ +#define DATA_MTYPE_CURRENT_MAX DATA_GEOMETRY /* maximum value of mtype */ /*-------------------------------------------*/ /* The 'PRECISE TYPE' of a column */ /* @@ -211,15 +201,6 @@ store the charset-collation number; one byte is left unused, though */ /* Maximum multi-byte character length in bytes, plus 1 */ #define DATA_MBMAX 5 -/* For DATA_POINT of dimension 2, the length of value in btree is always 25, -which is the summary of: -SRID_SIZE(4) + WKB_HEADER_SIZE(1+4) + POINT_DATA_SIZE(8*2). -So the length of physical record or POINT KEYs on btree are 25. -GIS_TODO: When we support multi-dimensions DATA_POINT, we should get the -length from corresponding column or index definition, instead of this MACRO -*/ -#define DATA_POINT_LEN 25 - /* Pack mbminlen, mbmaxlen to mbminmaxlen. */ #define DATA_MBMINMAXLEN(mbminlen, mbmaxlen) \ unsigned((mbmaxlen) * DATA_MBMAX + (mbminlen)) @@ -229,18 +210,12 @@ length from corresponding column or index definition, instead of this MACRO /* Get mbmaxlen from mbminmaxlen. */ #define DATA_MBMAXLEN(mbminmaxlen) unsigned((mbminmaxlen) / DATA_MBMAX) -/* For checking if a geom_type is POINT */ -#define DATA_POINT_MTYPE(mtype) ((mtype) == DATA_POINT \ - || (mtype) == DATA_VAR_POINT) - /* For checking if mtype is GEOMETRY datatype */ -#define DATA_GEOMETRY_MTYPE(mtype) (DATA_POINT_MTYPE(mtype) \ - || (mtype) == DATA_GEOMETRY) +#define DATA_GEOMETRY_MTYPE(mtype) ((mtype) == DATA_GEOMETRY) /* For checking if mtype is BLOB or GEOMETRY, since we use BLOB as -the underling datatype of GEOMETRY(not DATA_POINT) data. */ +the underlying datatype of GEOMETRY data. */ #define DATA_LARGE_MTYPE(mtype) ((mtype) == DATA_BLOB \ - || (mtype) == DATA_VAR_POINT \ || (mtype) == DATA_GEOMETRY) /* For checking if data type is big length data type. */ diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index b5a467455b9..3d2f46ed877 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -504,7 +504,6 @@ dtype_get_fixed_size_low( case DATA_INT: case DATA_FLOAT: case DATA_DOUBLE: - case DATA_POINT: return(len); case DATA_MYSQL: if (prtype & DATA_BINARY_TYPE) { @@ -533,7 +532,6 @@ dtype_get_fixed_size_low( case DATA_BINARY: case DATA_DECIMAL: case DATA_VARMYSQL: - case DATA_VAR_POINT: case DATA_GEOMETRY: case DATA_BLOB: return(0); @@ -580,7 +578,6 @@ dtype_get_min_size_low( case DATA_INT: case DATA_FLOAT: case DATA_DOUBLE: - case DATA_POINT: return(len); case DATA_MYSQL: if (prtype & DATA_BINARY_TYPE) { @@ -603,7 +600,6 @@ dtype_get_min_size_low( case DATA_BINARY: case DATA_DECIMAL: case DATA_VARMYSQL: - case DATA_VAR_POINT: case DATA_GEOMETRY: case DATA_BLOB: return(0); @@ -637,9 +633,7 @@ dtype_get_max_size_low( case DATA_BINARY: case DATA_DECIMAL: case DATA_VARMYSQL: - case DATA_POINT: return(len); - case DATA_VAR_POINT: case DATA_GEOMETRY: case DATA_BLOB: break; diff --git a/storage/innobase/include/fsp0space.h b/storage/innobase/include/fsp0space.h index 3928f8362b9..2c28ecc5c7b 100644 --- a/storage/innobase/include/fsp0space.h +++ b/storage/innobase/include/fsp0space.h @@ -44,6 +44,10 @@ public: /** Data file information - each Datafile can be accessed globally */ files_t m_files; + /** Data file iterator */ + typedef files_t::iterator iterator; + /** Data file iterator */ + typedef files_t::const_iterator const_iterator; Tablespace() : @@ -62,16 +66,21 @@ public: shutdown(); ut_ad(m_files.empty()); ut_ad(m_space_id == ULINT_UNDEFINED); - if (m_path != NULL) { - ut_free(m_path); - m_path = NULL; - } } // Disable copying Tablespace(const Tablespace&); Tablespace& operator=(const Tablespace&); + /** Data file iterator */ + const_iterator begin() const { return m_files.begin(); } + /** Data file iterator */ + const_iterator end() const { return m_files.end(); } + /** Data file iterator */ + iterator begin() { return m_files.begin(); } + /** Data file iterator */ + iterator end() { return m_files.end(); } + void set_name(const char* name) { m_name = name; } const char* name() const { return m_name; } @@ -160,8 +169,7 @@ public: { ulint sum = 0; - for (files_t::const_iterator it = m_files.begin(); - it != m_files.end(); ++it) { + for (const_iterator it = begin(); it != end(); ++it) { sum += it->m_size; } @@ -204,7 +212,7 @@ private: /** @param[in] filename Name to lookup in the data files. @return true if the filename exists in the data files */ - bool find(const char* filename); + bool find(const char* filename) const; /** Note that the data file was found. @param[in] file data file object */ diff --git a/storage/innobase/include/fsp0sysspace.h b/storage/innobase/include/fsp0sysspace.h index 4c88b268f34..b8890adad74 100644 --- a/storage/innobase/include/fsp0sysspace.h +++ b/storage/innobase/include/fsp0sysspace.h @@ -287,16 +287,6 @@ is_system_tablespace(ulint id) return(id == TRX_SYS_SPACE || id == SRV_TMP_SPACE_ID); } -/** Check if shared-system or undo tablespace. -@return true if shared-system or undo tablespace */ -UNIV_INLINE -bool -is_system_or_undo_tablespace( - ulint id) -{ - return(id <= srv_undo_tablespaces_open); -} - /** Check if predefined shared tablespace. @return true if predefined shared tablespace */ UNIV_INLINE @@ -306,7 +296,8 @@ is_predefined_tablespace( { ut_ad(srv_sys_space.space_id() == TRX_SYS_SPACE); ut_ad(TRX_SYS_SPACE == 0); - return(id <= srv_undo_tablespaces_open - || id == SRV_TMP_SPACE_ID); + return(id == TRX_SYS_SPACE + || id == SRV_TMP_SPACE_ID + || srv_is_undo_tablespace(id)); } #endif /* fsp0sysspace_h */ diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 05e53e23f28..1062a785fdb 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -156,17 +156,17 @@ void log_sys_init(); /** Initialize the redo log. -@param[in] n_files number of files -@param[in] file_size file size in bytes */ +@param[in] n_files number of files */ void -log_init(ulint n_files, lsn_t file_size); +log_init(ulint n_files); /** Calculate the recommended highest values for lsn - last_checkpoint_lsn and lsn - buf_get_oldest_modification(). +@param[in] file_size requested innodb_log_file_size @retval true on success @retval false if the smallest log group is too small to accommodate the number of OS threads in the database server */ bool -log_set_capacity() +log_set_capacity(ulonglong file_size) MY_ATTRIBUTE((warn_unused_result)); /******************************************************//** @@ -407,16 +407,9 @@ Closes all log groups. */ void log_group_close_all(void); /*=====================*/ -/********************************************************//** -Shutdown the log system but do not release all the memory. */ -void -log_shutdown(void); -/*==============*/ -/********************************************************//** -Free the log system data structures. */ +/** Shut down the redo log subsystem. */ void -log_mem_free(void); -/*==============*/ +log_shutdown(); /** Whether to generate and require checksums on the redo log pages */ extern my_bool innodb_log_checksums; diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index 784699279d4..bacfb86cc07 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -81,27 +81,12 @@ recv_reset_logs( OS_FILE_LOG_BLOCK_SIZE, after which we add LOG_BLOCK_HDR_SIZE */ -/********************************************************//** -Creates the recovery system. */ -void -recv_sys_create(void); -/*=================*/ -/**********************************************************//** -Release recovery system mutexes. */ -void -recv_sys_close(void); -/*================*/ -/********************************************************//** -Frees the recovery system memory. */ +/** Clean up after recv_sys_init() */ void -recv_sys_mem_free(void); -/*===================*/ -/********************************************************//** -Inits the recovery system for a recovery operation. */ +recv_sys_close(); +/** Initialize the redo log recovery subsystem. */ void -recv_sys_init( -/*==========*/ - ulint available_memory); /*!< in: available memory in bytes */ +recv_sys_init(); /********************************************************//** Frees the recovery system. */ void diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index b3a70edf8be..b366267d6d2 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -979,7 +979,7 @@ pfs_os_file_close_func( this function! This is the performance schema instrumented wrapper function for os_file_read() which requests a synchronous read operation. -@param[in, out] type IO request context +@param[in] type IO request context @param[in] file Open file handle @param[out] buf buffer where to read @param[in] offset file offset where to read @@ -990,20 +990,20 @@ os_file_read() which requests a synchronous read operation. UNIV_INLINE dberr_t pfs_os_file_read_func( - IORequest& type, - pfs_os_file_t file, - void* buf, - os_offset_t offset, - ulint n, - const char* src_file, - uint src_line); + const IORequest& type, + pfs_os_file_t file, + void* buf, + os_offset_t offset, + ulint n, + const char* src_file, + uint src_line); /** NOTE! Please use the corresponding macro os_file_read_no_error_handling(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read_no_error_handling_func() which requests a synchronous read operation. -@param[in, out] type IO request context +@param[in] type IO request context @param[in] file Open file handle @param[out] buf buffer where to read @param[in] offset file offset where to read @@ -1015,20 +1015,20 @@ read operation. UNIV_INLINE dberr_t pfs_os_file_read_no_error_handling_func( - IORequest& type, - pfs_os_file_t file, - void* buf, - os_offset_t offset, - ulint n, - ulint* o, - const char* src_file, - uint src_line); + const IORequest& type, + pfs_os_file_t file, + void* buf, + os_offset_t offset, + ulint n, + ulint* o, + const char* src_file, + uint src_line); /** NOTE! Please use the corresponding macro os_aio(), not directly this function! Performance schema wrapper function of os_aio() which requests an asynchronous I/O operation. -@param[in] type IO request context +@param[in,out] type IO request context @param[in] mode IO mode @param[in] name Name of the file or path as NUL terminated string @@ -1066,7 +1066,7 @@ pfs_os_aio_func( this function! This is the performance schema instrumented wrapper function for os_file_write() which requests a synchronous write operation. -@param[in, out] type IO request context +@param[in] type IO request context @param[in] name Name of the file or path as NUL terminated string @param[in] file Open file handle @@ -1079,14 +1079,14 @@ os_file_write() which requests a synchronous write operation. UNIV_INLINE dberr_t pfs_os_file_write_func( - IORequest& type, - const char* name, - pfs_os_file_t file, - const void* buf, - os_offset_t offset, - ulint n, - const char* src_file, - uint src_line); + const IORequest& type, + const char* name, + pfs_os_file_t file, + const void* buf, + os_offset_t offset, + ulint n, + const char* src_file, + uint src_line); /** NOTE! Please use the corresponding macro os_file_flush(), not directly this function! @@ -1293,11 +1293,11 @@ Requests a synchronous read operation. @return DB_SUCCESS if request was successful */ dberr_t os_file_read_func( - IORequest& type, - os_file_t file, - void* buf, - os_offset_t offset, - ulint n) + const IORequest& type, + os_file_t file, + void* buf, + os_offset_t offset, + ulint n) MY_ATTRIBUTE((warn_unused_result)); /** Rewind file to its start, read at most size - 1 bytes from it to str, and @@ -1325,18 +1325,18 @@ any error handling. In case of error it returns FALSE. @return DB_SUCCESS or error code */ dberr_t os_file_read_no_error_handling_func( - IORequest& type, - os_file_t file, - void* buf, - os_offset_t offset, - ulint n, - ulint* o) + const IORequest& type, + os_file_t file, + void* buf, + os_offset_t offset, + ulint n, + ulint* o) MY_ATTRIBUTE((warn_unused_result)); /** NOTE! Use the corresponding macro os_file_write(), not directly this function! Requests a synchronous write operation. -@param[in,out] type IO request context +@param[in] type IO request context @param[in] file Open file handle @param[out] buf buffer where to read @param[in] offset file offset where to read @@ -1344,12 +1344,12 @@ Requests a synchronous write operation. @return DB_SUCCESS if request was successful */ dberr_t os_file_write_func( - IORequest& type, - const char* name, - os_file_t file, - const void* buf, - os_offset_t offset, - ulint n) + const IORequest& type, + const char* name, + os_file_t file, + const void* buf, + os_offset_t offset, + ulint n) MY_ATTRIBUTE((warn_unused_result)); /** Check the existence and type of the given file. @@ -1432,7 +1432,7 @@ os_aio_free(); /** NOTE! Use the corresponding macro os_aio(), not directly this function! Requests an asynchronous i/o operation. -@param[in] type IO request context +@param[in,out] type IO request context @param[in] mode IO mode @param[in] name Name of the file or path as NUL terminated string diff --git a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.ic index 07c2b6212ed..6cb67af94ca 100644 --- a/storage/innobase/include/os0file.ic +++ b/storage/innobase/include/os0file.ic @@ -207,7 +207,7 @@ pfs_os_file_close_func( function! Performance schema wrapper function of os_aio() which requests an asynchronous i/o operation. -@param[in] type IO request context +@param[in,type] type IO request context @param[in] mode IO mode @param[in] name Name of the file or path as NUL terminated string @@ -264,7 +264,7 @@ pfs_os_aio_func( this function! This is the performance schema instrumented wrapper function for os_file_read() which requests a synchronous read operation. -@param[in, out] type IO request context +@param[in] type IO request context @param[in] file Open file handle @param[out] buf buffer where to read @param[in] offset file offset where to read @@ -275,13 +275,13 @@ os_file_read() which requests a synchronous read operation. UNIV_INLINE dberr_t pfs_os_file_read_func( - IORequest& type, - pfs_os_file_t file, - void* buf, - os_offset_t offset, - ulint n, - const char* src_file, - uint src_line) + const IORequest& type, + pfs_os_file_t file, + void* buf, + os_offset_t offset, + ulint n, + const char* src_file, + uint src_line) { PSI_file_locker_state state; struct PSI_file_locker* locker = NULL; @@ -305,7 +305,7 @@ not directly this function! This is the performance schema instrumented wrapper function for os_file_read_no_error_handling_func() which requests a synchronous read operation. -@param[in, out] type IO request context +@param[in] type IO request context @param[in] file Open file handle @param[out] buf buffer where to read @param[in] offset file offset where to read @@ -317,14 +317,14 @@ read operation. UNIV_INLINE dberr_t pfs_os_file_read_no_error_handling_func( - IORequest& type, - pfs_os_file_t file, - void* buf, - os_offset_t offset, - ulint n, - ulint* o, - const char* src_file, - uint src_line) + const IORequest& type, + pfs_os_file_t file, + void* buf, + os_offset_t offset, + ulint n, + ulint* o, + const char* src_file, + uint src_line) { PSI_file_locker_state state; struct PSI_file_locker* locker = NULL; @@ -343,7 +343,7 @@ pfs_os_file_read_no_error_handling_func( /** NOTE! Please use the corresponding macro os_file_read_no_error_handling_int_fd() to request a synchronous read operation. -@param[in,out] type read request +@param[in] type read request @param[in] file file handle @param[out] buf buffer where to read @param[in] offset file offset where to read @@ -354,13 +354,13 @@ a synchronous read operation. UNIV_INLINE bool pfs_os_file_read_no_error_handling_int_fd_func( - IORequest& type, - int file, - void* buf, - os_offset_t offset, - ulint n, - const char* src_file, - uint src_line) + const IORequest& type, + int file, + void* buf, + os_offset_t offset, + ulint n, + const char* src_file, + uint src_line) { PSI_file_locker_state state; @@ -387,7 +387,7 @@ pfs_os_file_read_no_error_handling_int_fd_func( this function! This is the performance schema instrumented wrapper function for os_file_write() which requests a synchronous write operation. -@param[in, out] type IO request context +@param[in] type IO request context @param[in] name Name of the file or path as NUL terminated string @param[in] file Open file handle @@ -401,14 +401,14 @@ os_file_write() which requests a synchronous write operation. UNIV_INLINE dberr_t pfs_os_file_write_func( - IORequest& type, - const char* name, - pfs_os_file_t file, - const void* buf, - os_offset_t offset, - ulint n, - const char* src_file, - uint src_line) + const IORequest& type, + const char* name, + pfs_os_file_t file, + const void* buf, + os_offset_t offset, + ulint n, + const char* src_file, + uint src_line) { PSI_file_locker_state state; struct PSI_file_locker* locker = NULL; @@ -429,7 +429,7 @@ pfs_os_file_write_func( not directly this function! This is the performance schema instrumented wrapper function for os_file_write_int_fd() which requests a synchronous write operation. -@param[in,out] type write request +@param[in] type write request @param[in] name file name @param[in] file file handle @param[in] buf buffer to write @@ -441,14 +441,14 @@ os_file_write_int_fd() which requests a synchronous write operation. UNIV_INLINE bool pfs_os_file_write_int_fd_func( - IORequest& type, - const char* name, - int file, - const void* buf, - os_offset_t offset, - ulint n, - const char* src_file, - uint src_line) + const IORequest& type, + const char* name, + int file, + const void* buf, + os_offset_t offset, + ulint n, + const char* src_file, + uint src_line) { PSI_file_locker_state state; struct PSI_file_locker* locker; diff --git a/storage/innobase/include/os0thread.h b/storage/innobase/include/os0thread.h index 071e7422894..d4430f5ebce 100644 --- a/storage/innobase/include/os0thread.h +++ b/storage/innobase/include/os0thread.h @@ -151,10 +151,4 @@ os_thread_sleep( /*============*/ ulint tm); /*!< in: time in microseconds */ -/*****************************************************************//** -Check if there are threads active. -@return true if the thread count > 0. */ -bool -os_thread_active(); - #endif diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index 916222d5fdb..96d3bdfab8f 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -1080,14 +1080,14 @@ private: # endif /* !DBUG_OFF */ # ifdef UNIV_DEBUG -/************************************************************//** -Reads the DB_TRX_ID of a clustered index record. +/** Read the DB_TRX_ID of a clustered index record. +@param[in] rec clustered index record +@param[in] index clustered index @return the value of DB_TRX_ID */ trx_id_t rec_get_trx_id( -/*===========*/ - const rec_t* rec, /*!< in: record */ - const dict_index_t* index) /*!< in: clustered index */ + const rec_t* rec, + const dict_index_t* index) MY_ATTRIBUTE((nonnull, warn_unused_result)); # endif /* UNIV_DEBUG */ diff --git a/storage/innobase/include/row0ftsort.h b/storage/innobase/include/row0ftsort.h index 207fd783cac..b1f3b8ab328 100644 --- a/storage/innobase/include/row0ftsort.h +++ b/storage/innobase/include/row0ftsort.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2016, MariaDB Corporation. +Copyright (c) 2015, 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -103,7 +103,6 @@ struct fts_psort_t { /** Row fts token for plugin parser */ struct row_fts_token_t { fts_string_t* text; /*!< token */ - ulint position; /*!< token position in the document */ UT_LIST_NODE_T(row_fts_token_t) token_list; /*!< next token link */ }; diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 6164366628e..8dfff46e78b 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -681,12 +681,6 @@ struct row_prebuilt_t { not to be confused with InnoDB externally stored columns (VARCHAR can be off-page too) */ - unsigned templ_contains_fixed_point:1;/*!< TRUE if the - template contains a column with - DATA_POINT. Since InnoDB regards - DATA_POINT as non-BLOB type, the - templ_contains_blob can't tell us - if there is DATA_POINT */ mysql_row_templ_t* mysql_template;/*!< template used to transform rows fast between MySQL and Innobase formats; memory for this template diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 8f0df34af74..4ee8962a0c7 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -317,6 +317,22 @@ segment). It is quite possible that some of the tablespaces doesn't host any of the rollback-segment based on configuration used. */ extern ulint srv_undo_tablespaces_active; +/** Undo tablespaces starts with space_id. */ +extern ulint srv_undo_space_id_start; + +/** Check whether given space id is undo tablespace id +@param[in] space_id space id to check +@return true if it is undo tablespace else false. */ +inline +bool +srv_is_undo_tablespace(ulint space_id) +{ + return srv_undo_space_id_start > 0 + && space_id >= srv_undo_space_id_start + && space_id < (srv_undo_space_id_start + + srv_undo_tablespaces_open); +} + /** The number of undo segments to use */ extern ulong srv_undo_logs; @@ -344,17 +360,9 @@ extern char* srv_log_group_home_dir; /** Maximum number of srv_n_log_files, or innodb_log_files_in_group */ #define SRV_N_LOG_FILES_MAX 100 extern ulong srv_n_log_files; -/** At startup, this is the current redo log file size. -During startup, if this is different from srv_log_file_size_requested -(innodb_log_file_size), the redo log will be rebuilt and this size -will be initialized to srv_log_file_size_requested. -When upgrading from a previous redo log format, this will be set to 0, -and writing to the redo log is not allowed. - -During startup, this is in bytes, and later converted to pages. */ -extern ib_uint64_t srv_log_file_size; -/** The value of the startup parameter innodb_log_file_size */ -extern ib_uint64_t srv_log_file_size_requested; +/** The InnoDB redo log file size, or 0 when changing the redo log format +at startup (while disallowing writes to the redo log). */ +extern ulonglong srv_log_file_size; extern ulint srv_log_buffer_size; extern ulong srv_flush_log_at_trx_commit; extern uint srv_flush_log_at_timeout; @@ -530,7 +538,10 @@ extern my_bool srv_purge_view_update_only_debug; /** Value of MySQL global used to disable master thread. */ extern my_bool srv_master_thread_disabled_debug; +/** InnoDB system tablespace to set during recovery */ extern uint srv_sys_space_size_debug; +/** whether redo log files have been created at startup */ +extern bool srv_log_files_created; #endif /* UNIV_DEBUG */ #define SRV_SEMAPHORE_WAIT_EXTENSION 7200 diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h index 47b42725541..93ea0be2662 100644 --- a/storage/innobase/include/srv0start.h +++ b/storage/innobase/include/srv0start.h @@ -105,22 +105,6 @@ extern bool srv_startup_is_before_trx_rollback_phase; /** TRUE if a raw partition is in use */ extern ibool srv_start_raw_disk_in_use; -/** Undo tablespaces starts with space_id. */ -extern ulint srv_undo_space_id_start; - -/** Check whether given space id is undo tablespace id -@param[in] space_id space id to check -@return true if it is undo tablespace else false. */ -inline -bool -srv_is_undo_tablespace(ulint space_id) -{ - return srv_undo_space_id_start > 0 - && space_id >= srv_undo_space_id_start - && space_id < (srv_undo_space_id_start - + srv_undo_tablespaces_open); -} - /** Shutdown state */ enum srv_shutdown_t { SRV_SHUTDOWN_NONE = 0, /*!< Database running normally */ diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h index 8a68f3d0cc6..bcbcf70bfc7 100644 --- a/storage/innobase/include/sync0types.h +++ b/storage/innobase/include/sync0types.h @@ -1078,6 +1078,7 @@ struct latch_t { /** Subclass this to iterate over a thread's acquired latch levels. */ struct sync_check_functor_t { + virtual ~sync_check_functor_t() { } virtual bool operator()(const latch_level_t) const = 0; }; diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index bf8cf2481eb..e2b4e4d30fd 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -236,16 +236,12 @@ trx_sys_update_mysql_binlog_offset( /*===============================*/ const char* file_name,/*!< in: MySQL log file name */ int64_t offset, /*!< in: position in that log file */ - ulint field, /*!< in: offset of the MySQL log info field in - the trx sys header */ trx_sysf_t* sys_header, /*!< in: trx sys header */ mtr_t* mtr); /*!< in: mtr */ -/*****************************************************************//** -Prints to stderr the MySQL binlog offset info in the trx system header if -the magic number shows it valid. */ +/** Display the MySQL binlog offset info if it is present in the trx +system header. */ void -trx_sys_print_mysql_binlog_offset(void); -/*===================================*/ +trx_sys_print_mysql_binlog_offset(); #ifdef WITH_WSREP /** Update WSREP checkpoint XID in sys header. */ void @@ -255,11 +251,11 @@ trx_sys_update_wsrep_checkpoint( trx_sysf_t* sys_header, /*!< in: sys_header */ mtr_t* mtr); /*!< in: mtr */ -void -/** Read WSREP checkpoint XID from sys header. */ -trx_sys_read_wsrep_checkpoint( -/*==========================*/ - XID* xid); /*!< out: WSREP XID */ +/** Read WSREP checkpoint XID from sys header. +@param[out] xid WSREP XID +@return whether the checkpoint was present */ +bool +trx_sys_read_wsrep_checkpoint(XID* xid); #endif /* WITH_WSREP */ /** Initializes the tablespace tag system. */ @@ -420,9 +416,7 @@ impose the 7 bit restriction. e.g., mach_write_to_3() */ TRX_SYS_MYSQL_LOG_MAGIC_N if we have valid data in the MySQL binlog info */ -#define TRX_SYS_MYSQL_LOG_OFFSET_HIGH 4 /*!< high 4 bytes of the offset - within that file */ -#define TRX_SYS_MYSQL_LOG_OFFSET_LOW 8 /*!< low 4 bytes of the offset +#define TRX_SYS_MYSQL_LOG_OFFSET 4 /*!< the 64-bit offset within that file */ #define TRX_SYS_MYSQL_LOG_NAME 12 /*!< MySQL log file name */ diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 4f924e064a8..182df269015 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -669,18 +669,17 @@ log_group_set_fields( /** Calculate the recommended highest values for lsn - last_checkpoint_lsn and lsn - buf_get_oldest_modification(). +@param[in] file_size requested innodb_log_file_size @retval true on success @retval false if the smallest log group is too small to accommodate the number of OS threads in the database server */ bool -log_set_capacity() +log_set_capacity(ulonglong file_size) { lsn_t margin; ulint free; - lsn_t smallest_capacity = ((srv_log_file_size_requested - << srv_page_size_shift) - - LOG_FILE_HDR_SIZE) + lsn_t smallest_capacity = (file_size - LOG_FILE_HDR_SIZE) * srv_n_log_files; /* Add extra safety */ smallest_capacity -= smallest_capacity / 10; @@ -798,10 +797,9 @@ log_sys_init() } /** Initialize the redo log. -@param[in] n_files number of files -@param[in] file_size file size in bytes */ +@param[in] n_files number of files */ void -log_init(ulint n_files, lsn_t file_size) +log_init(ulint n_files) { ulint i; log_group_t* group = &log_sys->log; @@ -810,7 +808,7 @@ log_init(ulint n_files, lsn_t file_size) group->format = srv_encrypt_log ? LOG_HEADER_FORMAT_CURRENT | LOG_HEADER_FORMAT_ENCRYPTED : LOG_HEADER_FORMAT_CURRENT; - group->file_size = file_size; + group->file_size = srv_log_file_size; group->state = LOG_GROUP_OK; group->lsn = LOG_START_LSN; group->lsn_offset = LOG_FILE_HDR_SIZE; @@ -2261,11 +2259,9 @@ log_group_close_all(void) log_group_close(&log_sys->log); } -/********************************************************//** -Shutdown the log system but do not release all the memory. */ +/** Shut down the redo log subsystem. */ void -log_shutdown(void) -/*==============*/ +log_shutdown() { log_group_close_all(); @@ -2289,20 +2285,8 @@ log_shutdown(void) } recv_sys_close(); -} - -/********************************************************//** -Free the log system data structures. */ -void -log_mem_free(void) -/*==============*/ -{ - if (log_sys != NULL) { - recv_sys_mem_free(); - ut_free(log_sys); - - log_sys = NULL; - } + ut_free(log_sys); + log_sys = NULL; } /******************************************************//** diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index e48e185274a..021d897e172 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -415,31 +415,9 @@ fil_name_parse( return(end_ptr); } -/********************************************************//** -Creates the recovery system. */ -void -recv_sys_create(void) -/*=================*/ -{ - if (recv_sys != NULL) { - - return; - } - - recv_sys = static_cast<recv_sys_t*>(ut_zalloc_nokey(sizeof(*recv_sys))); - - mutex_create(LATCH_ID_RECV_SYS, &recv_sys->mutex); - mutex_create(LATCH_ID_RECV_WRITER, &recv_sys->writer_mutex); - - recv_sys->heap = NULL; - recv_sys->addr_hash = NULL; -} - -/********************************************************//** -Release recovery system mutexes. */ +/** Clean up after recv_sys_init() */ void -recv_sys_close(void) -/*================*/ +recv_sys_close() { if (recv_sys != NULL) { recv_sys->dblwr.pages.clear(); @@ -578,56 +556,41 @@ DECLARE_THREAD(recv_writer_thread)( OS_THREAD_DUMMY_RETURN; } -/************************************************************ -Inits the recovery system for a recovery operation. */ +/** Initialize the redo log recovery subsystem. */ void -recv_sys_init( -/*==========*/ - ulint available_memory) /*!< in: available memory in bytes */ +recv_sys_init() { - if (recv_sys->heap != NULL) { + ut_ad(recv_sys == NULL); - return; - } + recv_sys = static_cast<recv_sys_t*>(ut_zalloc_nokey(sizeof(*recv_sys))); - mutex_enter(&(recv_sys->mutex)); + mutex_create(LATCH_ID_RECV_SYS, &recv_sys->mutex); + mutex_create(LATCH_ID_RECV_WRITER, &recv_sys->writer_mutex); - recv_sys->heap = mem_heap_create_typed(256, - MEM_HEAP_FOR_RECV_SYS); + recv_sys->heap = mem_heap_create_typed(256, MEM_HEAP_FOR_RECV_SYS); if (!srv_read_only_mode) { recv_sys->flush_start = os_event_create(0); recv_sys->flush_end = os_event_create(0); } + ulint size = buf_pool_get_curr_size(); /* Set appropriate value of recv_n_pool_free_frames. */ - if (buf_pool_get_curr_size() >= (10 * 1024 * 1024)) { + if (size >= 10 << 20) { /* Buffer pool of size greater than 10 MB. */ recv_n_pool_free_frames = 512; } recv_sys->buf = static_cast<byte*>( ut_malloc_nokey(RECV_PARSING_BUF_SIZE)); - recv_sys->len = 0; - recv_sys->recovered_offset = 0; - - recv_sys->addr_hash = hash_create(available_memory / 512); - recv_sys->n_addrs = 0; - - recv_sys->apply_log_recs = FALSE; - recv_sys->apply_batch_on = FALSE; - recv_sys->found_corrupt_log = false; - recv_sys->found_corrupt_fs = false; - recv_sys->mlog_checkpoint_lsn = 0; + recv_sys->addr_hash = hash_create(size / 512); recv_sys->progress_time = ut_time(); recv_max_page_lsn = 0; /* Call the constructor for recv_sys_t::dblwr member */ new (&recv_sys->dblwr) recv_dblwr_t(); - - mutex_exit(&(recv_sys->mutex)); } /** Empty a fully processed hash table. */ @@ -2806,7 +2769,24 @@ recv_scan_log_recs( scanned_lsn += data_len; + if (data_len == LOG_BLOCK_HDR_SIZE + SIZE_OF_MLOG_CHECKPOINT + && scanned_lsn == checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT + && log_block[LOG_BLOCK_HDR_SIZE] == MLOG_CHECKPOINT + && checkpoint_lsn == mach_read_from_8(LOG_BLOCK_HDR_SIZE + + 1 + log_block)) { + /* The redo log is logically empty. */ + ut_ad(recv_sys->mlog_checkpoint_lsn == 0 + || recv_sys->mlog_checkpoint_lsn + == checkpoint_lsn); + recv_sys->mlog_checkpoint_lsn = checkpoint_lsn; + DBUG_PRINT("ib_log", ("found empty log; LSN=" LSN_PF, + scanned_lsn)); + finished = true; + break; + } + if (scanned_lsn > recv_sys->scanned_lsn) { + ut_ad(!srv_log_files_created); if (!recv_needed_recovery) { recv_needed_recovery = true; @@ -3244,7 +3224,11 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) there is something wrong we will print a message to the user about recovery: */ - if (checkpoint_lsn != flush_lsn) { + if (flush_lsn == checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT + && recv_sys->mlog_checkpoint_lsn == checkpoint_lsn) { + /* The redo log is logically empty. */ + } else if (checkpoint_lsn != flush_lsn) { + ut_ad(!srv_log_files_created); if (checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT < flush_lsn) { ib::warn() << " Are you sure you are using the" diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index d8c7d59fe27..54b9ff5d8d8 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -829,7 +829,7 @@ mtr_t::Command::prepare_write() fil_space_t* space = m_impl->m_user_space; - if (space != NULL && space->id <= srv_undo_tablespaces_open) { + if (space != NULL && is_predefined_tablespace(space->id)) { /* Omit MLOG_FILE_NAME for predefined tablespaces. */ space = NULL; } diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 5afb4527916..afe1b5b2079 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -107,9 +107,6 @@ static ulint os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; #else /** Umask for creating files */ static ulint os_innodb_umask = 0; -#ifndef ECANCELED -#define ECANCELED 125 -#endif static HANDLE completion_port; static HANDLE read_completion_port; static DWORD fls_sync_io = FLS_OUT_OF_INDEXES; @@ -303,7 +300,7 @@ public: /** Requests for a slot in the aio array. If no slot is available, waits until not_full-event becomes signaled. - @param[in,out] type IO context + @param[in] type IO context @param[in,out] m1 message to be passed along with the AIO operation @param[in,out] m2 message to be passed along with the AIO @@ -316,14 +313,14 @@ public: @param[in] len length of the block to read or write @return pointer to slot */ Slot* reserve_slot( - IORequest& type, - fil_node_t* m1, - void* m2, - pfs_os_file_t file, - const char* name, - void* buf, - os_offset_t offset, - ulint len) + const IORequest& type, + fil_node_t* m1, + void* m2, + pfs_os_file_t file, + const char* name, + void* buf, + os_offset_t offset, + ulint len) MY_ATTRIBUTE((warn_unused_result)); /** @return number of reserved slots */ @@ -510,14 +507,14 @@ public: MY_ATTRIBUTE((warn_unused_result)); /** Select the IO slot array - @param[in] type Type of IO, READ or WRITE + @param[in,out] type Type of IO, READ or WRITE @param[in] read_only true if running in read-only mode @param[in] mode IO mode @return slot array or NULL if invalid mode specified */ static AIO* select_slot_array( - IORequest& type, - bool read_only, - ulint mode) + IORequest& type, + bool read_only, + ulint mode) MY_ATTRIBUTE((warn_unused_result)); /** Calculates segment number for a slot. @@ -4931,14 +4928,15 @@ os_file_io( static MY_ATTRIBUTE((warn_unused_result)) ssize_t os_file_pwrite( - IORequest& type, - os_file_t file, - const byte* buf, - ulint n, - os_offset_t offset, - dberr_t* err) + const IORequest& type, + os_file_t file, + const byte* buf, + ulint n, + os_offset_t offset, + dberr_t* err) { ut_ad(type.validate()); + ut_ad(type.is_write()); ++os_n_file_writes; @@ -4951,26 +4949,25 @@ os_file_pwrite( return(n_bytes); } -/** Requests a synchronous write operation. +/** NOTE! Use the corresponding macro os_file_write(), not directly +Requests a synchronous write operation. @param[in] type IO flags @param[in] file handle to an open file @param[out] buf buffer from which to write @param[in] offset file offset from the start where to read @param[in] n number of bytes to read, starting from offset @return DB_SUCCESS if request was successful, false if fail */ -static MY_ATTRIBUTE((warn_unused_result)) dberr_t -os_file_write_page( - IORequest& type, - const char* name, - os_file_t file, - const void* buf, - os_offset_t offset, - ulint n) +os_file_write_func( + const IORequest& type, + const char* name, + os_file_t file, + const void* buf, + os_offset_t offset, + ulint n) { dberr_t err; - ut_ad(type.is_write()); ut_ad(type.validate()); ut_ad(n > 0); @@ -5017,13 +5014,15 @@ os_file_write_page( static MY_ATTRIBUTE((warn_unused_result)) ssize_t os_file_pread( - IORequest& type, - os_file_t file, - void* buf, - ulint n, - os_offset_t offset, - dberr_t* err) + const IORequest& type, + os_file_t file, + void* buf, + ulint n, + os_offset_t offset, + dberr_t* err) { + ut_ad(type.is_read()); + ++os_n_file_reads; const bool monitor = MONITOR_IS_ON(MONITOR_OS_PENDING_READS); @@ -5047,13 +5046,13 @@ os_file_pread( static MY_ATTRIBUTE((warn_unused_result)) dberr_t os_file_read_page( - IORequest& type, - os_file_t file, - void* buf, - os_offset_t offset, - ulint n, - ulint* o, - bool exit_on_err) + const IORequest& type, + os_file_t file, + void* buf, + os_offset_t offset, + ulint n, + ulint* o, + bool exit_on_err) { dberr_t err; @@ -5421,14 +5420,12 @@ Requests a synchronous positioned read operation. @return DB_SUCCESS or error code */ dberr_t os_file_read_func( - IORequest& type, - os_file_t file, - void* buf, - os_offset_t offset, - ulint n) + const IORequest& type, + os_file_t file, + void* buf, + os_offset_t offset, + ulint n) { - ut_ad(type.is_read()); - return(os_file_read_page(type, file, buf, offset, n, NULL, true)); } @@ -5445,43 +5442,16 @@ Requests a synchronous positioned read operation. @return DB_SUCCESS or error code */ dberr_t os_file_read_no_error_handling_func( - IORequest& type, - os_file_t file, - void* buf, - os_offset_t offset, - ulint n, - ulint* o) + const IORequest& type, + os_file_t file, + void* buf, + os_offset_t offset, + ulint n, + ulint* o) { - ut_ad(type.is_read()); - return(os_file_read_page(type, file, buf, offset, n, o, false)); } -/** NOTE! Use the corresponding macro os_file_write(), not directly -Requests a synchronous write operation. -@param[in] type IO flags -@param[in] file handle to an open file -@param[out] buf buffer from which to write -@param[in] offset file offset from the start where to read -@param[in] n number of bytes to read, starting from offset -@return DB_SUCCESS if request was successful, false if fail */ -dberr_t -os_file_write_func( - IORequest& type, - const char* name, - os_file_t file, - const void* buf, - os_offset_t offset, - ulint n) -{ - ut_ad(type.validate()); - ut_ad(type.is_write()); - - const byte* ptr = reinterpret_cast<const byte*>(buf); - - return(os_file_write_page(type, name, file, ptr, offset, n)); -} - /** Check the existence and type of the given file. @param[in] path path name of file @param[out] exists true if the file exists @@ -6146,7 +6116,7 @@ AIO::get_segment_no_from_slot( /** Requests for a slot in the aio array. If no slot is available, waits until not_full-event becomes signaled. -@param[in,out] type IO context +@param[in] type IO context @param[in,out] m1 message to be passed along with the AIO operation @param[in,out] m2 message to be passed along with the AIO @@ -6160,14 +6130,14 @@ not_full-event becomes signaled. @return pointer to slot */ Slot* AIO::reserve_slot( - IORequest& type, - fil_node_t* m1, - void* m2, - pfs_os_file_t file, - const char* name, - void* buf, - os_offset_t offset, - ulint len) + const IORequest& type, + fil_node_t* m1, + void* m2, + pfs_os_file_t file, + const char* name, + void* buf, + os_offset_t offset, + ulint len) { #ifdef WIN_ASYNC_IO ut_a((len & 0xFFFFFFFFUL) == len); @@ -6378,7 +6348,7 @@ os_aio_simulated_wake_handler_threads() } /** Select the IO slot array -@param[in] type Type of IO, READ or WRITE +@param[in,out] type Type of IO, READ or WRITE @param[in] read_only true if running in read-only mode @param[in] mode IO mode @return slot array or NULL if invalid mode specified */ @@ -6595,7 +6565,7 @@ os_aio_windows_handler( /** NOTE! Use the corresponding macro os_aio(), not directly this function! Requests an asynchronous i/o operation. -@param[in] type IO request context +@param[in,out] type IO request context @param[in] mode IO mode @param[in] name Name of the file or path as NUL terminated string diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc index 0462c62f4b2..fde743a9074 100644 --- a/storage/innobase/os/os0thread.cc +++ b/storage/innobase/os/os0thread.cc @@ -237,21 +237,3 @@ os_thread_sleep( select(0, NULL, NULL, NULL, &t); #endif /* _WIN32 */ } - -/*****************************************************************//** -Check if there are threads active. -@return true if the thread count > 0. */ -bool -os_thread_active() -/*==============*/ -{ - /* All the threads have exited or are just exiting; - NOTE that the threads may not have completed their - exit yet. Should we use pthread_join() to make sure - they have exited? If we did, we would have to - remove the pthread_detach() from - os_thread_exit(). Now we just sleep 0.1 - seconds and hope that is enough! */ - - return(my_atomic_loadlint(&os_thread_count) > 0); -} diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 59022dbe301..f556c887520 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -3711,6 +3711,10 @@ page_zip_write_rec( ut_a(slot); /* Copy the delete mark. */ if (rec_get_deleted_flag(rec, TRUE)) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(!dict_index_is_clust(index) + || row_get_rec_trx_id(rec, index, offsets)); *slot |= PAGE_ZIP_DIR_SLOT_DEL >> 8; } else { *slot &= ~(PAGE_ZIP_DIR_SLOT_DEL >> 8); diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc index b14d9c77ad1..ffe93ac8612 100644 --- a/storage/innobase/rem/rem0cmp.cc +++ b/storage/innobase/rem/rem0cmp.cc @@ -378,8 +378,6 @@ cmp_whole_field( case DATA_MYSQL: return(innobase_mysql_cmp(prtype, a, a_length, b, b_length)); - case DATA_POINT: - case DATA_VAR_POINT: case DATA_GEOMETRY: return(cmp_geometry_field(mtype, prtype, a, a_length, b, b_length)); @@ -437,11 +435,6 @@ cmp_data( case DATA_SYS: pad = ULINT_UNDEFINED; break; - case DATA_POINT: - case DATA_VAR_POINT: - /* Since DATA_POINT has a fixed length of DATA_POINT_LEN, - currently, pad is not needed. Meanwhile, DATA_VAR_POINT acts - the same as DATA_GEOMETRY */ case DATA_GEOMETRY: ut_ad(prtype & DATA_BINARY_TYPE); pad = ULINT_UNDEFINED; diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index c78df489179..4ad4730f37d 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -308,7 +308,6 @@ rec_init_offsets_comp_ordinary( if (!field->fixed_len || (temp && !dict_col_get_fixed_size(col, temp))) { - ut_ad(col->mtype != DATA_POINT); /* Variable-length field: read the length */ len = *lens--; /* If the maximum length of the field is up @@ -445,9 +444,6 @@ rec_init_offsets( if (UNIV_UNLIKELY(!field->fixed_len)) { const dict_col_t* col = dict_field_get_col(field); - /* DATA_POINT should always be a fixed - length column. */ - ut_ad(col->mtype != DATA_POINT); /* Variable-length field: read the length */ len = *lens--; /* If the maximum length of the field @@ -858,8 +854,6 @@ rec_get_converted_size_comp_prefix_low( } ut_ad(len <= col->len || DATA_LARGE_MTYPE(col->mtype) - || (DATA_POINT_MTYPE(col->mtype) - && len == DATA_MBR_LEN) || (col->len == 0 && col->mtype == DATA_VARCHAR)); fixed_len = field->fixed_len; @@ -1337,8 +1331,6 @@ rec_convert_dtuple_to_rec_comp( *lens-- = (byte) (len >> 8) | 0xc0; *lens-- = (byte) len; } else { - /* DATA_POINT would have a fixed_len */ - ut_ad(dtype_get_mtype(type) != DATA_POINT); ut_ad(len <= dtype_get_len(type) || DATA_LARGE_MTYPE(dtype_get_mtype(type)) || !strcmp(index->name, @@ -2106,8 +2098,6 @@ rec_print_mbr_rec( /***************************************************************//** Prints a physical record. */ -/***************************************************************//** -Prints a physical record. */ void rec_print_new( /*==========*/ @@ -2254,14 +2244,14 @@ operator<<(std::ostream& o, const rec_offsets_print& r) } #ifdef UNIV_DEBUG -/************************************************************//** -Reads the DB_TRX_ID of a clustered index record. +/** Read the DB_TRX_ID of a clustered index record. +@param[in] rec clustered index record +@param[in] index clustered index @return the value of DB_TRX_ID */ trx_id_t rec_get_trx_id( -/*===========*/ - const rec_t* rec, /*!< in: record */ - const dict_index_t* index) /*!< in: clustered index */ + const rec_t* rec, + const dict_index_t* index) { const page_t* page = page_align(rec); @@ -2270,10 +2260,11 @@ rec_get_trx_id( const byte* trx_id; ulint len; mem_heap_t* heap = NULL; - ulint offsets_[REC_OFFS_NORMAL_SIZE]; - ulint* offsets = offsets_; + ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; rec_offs_init(offsets_); + ulint* offsets = offsets_; + ut_ad(trx_id_col <= MAX_REF_PARTS); ut_ad(fil_page_index_page_check(page)); ut_ad(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID) == index->id); @@ -2287,7 +2278,7 @@ rec_get_trx_id( ut_ad(len == DATA_TRX_ID_LEN); - if (heap) { + if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 321b55e9894..da5d96ccc18 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -527,7 +527,6 @@ row_merge_fts_doc_tokenize( doc id and position to sort buffer */ while (t_ctx->processed_len < doc->text.f_len) { ulint idx = 0; - ib_uint32_t position; ulint cur_len; doc_id_t write_doc_id; row_fts_token_t* fts_token = NULL; @@ -679,20 +678,18 @@ row_merge_fts_doc_tokenize( ++field; - /* The third field is the position */ - if (parser != NULL) { - mach_write_to_4( - reinterpret_cast<byte*>(&position), - (fts_token->position + t_ctx->init_pos)); - } else { - mach_write_to_4( - reinterpret_cast<byte*>(&position), - (t_ctx->processed_len + inc - str.f_len + t_ctx->init_pos)); + /* The third field is the position. + MySQL 5.7 changed the fulltext parser plugin interface + by adding MYSQL_FTPARSER_BOOLEAN_INFO::position. + Below we assume that the field is always 0. */ + unsigned pos = t_ctx->init_pos; + byte position[4]; + if (parser == NULL) { + pos += t_ctx->processed_len + inc - str.f_len; } - - dfield_set_data(field, &position, sizeof(position)); - len = dfield_get_len(field); - ut_ad(len == sizeof(ib_uint32_t)); + len = 4; + mach_write_to_4(position, pos); + dfield_set_data(field, &position, len); field->type.mtype = DATA_INT; field->type.prtype = DATA_NOT_NULL; diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 87c2b61a3cb..d8d83a6bccc 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -346,6 +346,9 @@ row_ins_clust_index_entry_by_modify( ut_ad(rec_get_deleted_flag(rec, dict_table_is_comp(cursor->index->table))); + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(rec_get_trx_id(rec, cursor->index)); /* Build an update vector containing all the fields to be modified; NOTE that this vector may NOT contain system columns trx_id or @@ -1266,6 +1269,9 @@ row_ins_foreign_check_on_constraint( } if (rec_get_deleted_flag(clust_rec, dict_table_is_comp(table))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(rec_get_trx_id(clust_rec, clust_index)); /* This can happen if there is a circular reference of rows such that cascading delete comes to delete a row already in the process of being delete marked */ @@ -1274,7 +1280,6 @@ row_ins_foreign_check_on_constraint( goto nonstandard_exit_func; } - if (table->fts) { doc_id = fts_get_doc_id_from_rec(table, clust_rec, clust_index, tmp_heap); @@ -1758,6 +1763,12 @@ row_ins_check_foreign_constraint( if (rec_get_deleted_flag(rec, rec_offs_comp(offsets))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(!dict_index_is_clust(check_index) + || row_get_rec_trx_id(rec, check_index, + offsets)); + err = row_ins_set_shared_rec_lock( lock_type, block, rec, check_index, offsets, thr); diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index ea332adfdc3..73cb3fcea6f 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -840,9 +840,7 @@ row_merge_buf_add( } ut_ad(len <= col->len - || DATA_LARGE_MTYPE(col->mtype) - || (col->mtype == DATA_POINT - && len == DATA_MBR_LEN)); + || DATA_LARGE_MTYPE(col->mtype)); fixed_len = ifield->fixed_len; if (fixed_len && !dict_table_is_comp(index->table) @@ -2130,10 +2128,10 @@ end_of_index: rec = page_cur_get_rec(cur); - offsets = rec_get_offsets(rec, clust_index, NULL, - ULINT_UNDEFINED, &row_heap); - if (online) { + offsets = rec_get_offsets(rec, clust_index, NULL, + ULINT_UNDEFINED, &row_heap); + /* Perform a REPEATABLE READ. When rebuilding the table online, @@ -2176,6 +2174,10 @@ end_of_index: if (rec_get_deleted_flag( rec, dict_table_is_comp(old_table))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(row_get_rec_trx_id(rec, clust_index, + offsets)); /* This record was deleted in the latest committed version, or it was deleted and then reinserted-by-update before purge @@ -2186,6 +2188,9 @@ end_of_index: ut_ad(!rec_offs_any_null_extern(rec, offsets)); } else if (rec_get_deleted_flag( rec, dict_table_is_comp(old_table))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(rec_get_trx_id(rec, clust_index)); /* Skip delete-marked records. Skipping delete-marked records will make the @@ -2195,6 +2200,9 @@ end_of_index: would make it tricky to detect duplicate keys. */ continue; + } else { + offsets = rec_get_offsets(rec, clust_index, NULL, + ULINT_UNDEFINED, &row_heap); } /* When !online, we are holding a lock on old_table, preventing diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 061fc25a55e..947b7d67df8 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -628,8 +628,6 @@ row_mysql_store_col_in_innobase_format( ptr = row_mysql_read_blob_ref(&col_len, mysql_data, col_len); } else if (DATA_GEOMETRY_MTYPE(type)) { - /* We use blob to store geometry data except DATA_POINT - internally, but in MySQL Layer the datatype is always blob. */ ptr = row_mysql_read_geometry(&col_len, mysql_data, col_len); } diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 86a9e1259ac..cecd127e71e 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -160,6 +160,9 @@ row_purge_remove_clust_if_poss_low( } ut_ad(rec_get_deleted_flag(rec, rec_offs_comp(offsets))); + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(row_get_rec_trx_id(rec, index, offsets)); if (mode == BTR_MODIFY_LEAF) { success = btr_cur_optimistic_delete( diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index fd0205ad153..03afd328eb5 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -183,6 +183,9 @@ row_sel_sec_rec_is_for_clust_rec( if (rec_get_deleted_flag(clust_rec, dict_table_is_comp(clust_index->table))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(rec_get_trx_id(clust_rec, clust_index)); /* The clustered index record is delete-marked; it is not visible in the read view. Besides, @@ -2042,6 +2045,11 @@ skip_lock: if (rec_get_deleted_flag(clust_rec, dict_table_is_comp(plan->table))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing update_undo log record. */ + ut_ad(rec_get_trx_id(clust_rec, + dict_table_get_first_index( + plan->table))); /* The record is delete marked: we can skip it */ @@ -2611,10 +2619,9 @@ row_sel_convert_mysql_key_to_innobase( data_field_len = data_offset + data_len; } else { /* The key field is a column prefix of a BLOB - or TEXT, except DATA_POINT of GEOMETRY. */ + or TEXT. */ - ut_a(field->prefix_len > 0 - || DATA_POINT_MTYPE(type)); + ut_a(field->prefix_len > 0); /* MySQL stores the actual data length to the first 2 bytes after the optional SQL NULL @@ -2624,18 +2631,12 @@ row_sel_convert_mysql_key_to_innobase( seems to reserve field->prefix_len bytes for storing this field in the key value buffer, even though the actual value only takes data - len bytes from the start. - For POINT of GEOMETRY, which has no prefix - because it's now a fixed length type in - InnoDB, we have to get DATA_POINT_LEN bytes, - which is original prefix length of POINT. */ + len bytes from the start. */ data_len = key_ptr[data_offset] + 256 * key_ptr[data_offset + 1]; data_field_len = data_offset + 2 - + (type == DATA_POINT - ? DATA_POINT_LEN - : field->prefix_len); + + field->prefix_len; data_offset += 2; @@ -2897,8 +2898,6 @@ row_sel_field_store_in_mysql_format_func( len); break; - case DATA_POINT: - case DATA_VAR_POINT: case DATA_GEOMETRY: /* We store all geometry data as BLOB data at server layer. */ row_mysql_store_geometry(dest, templ->mysql_col_len, data, len); @@ -3019,7 +3018,6 @@ row_sel_store_mysql_field_func( /* Copy an externally stored field to a temporary heap */ ut_ad(field_no == templ->clust_rec_field_no); - ut_ad(templ->type != DATA_POINT); if (DATA_LARGE_MTYPE(templ->type)) { if (prebuilt->blob_heap == NULL) { @@ -3099,10 +3097,7 @@ row_sel_store_mysql_field_func( will be invalid as soon as the mini-transaction is committed and the page latch on the clustered index page is - released. - For DATA_POINT, it's stored like CHAR in InnoDB, - but it should be a BLOB field in MySQL layer. So we - still treated it as BLOB here. */ + released. */ if (prebuilt->blob_heap == NULL) { prebuilt->blob_heap = mem_heap_create( @@ -3934,6 +3929,9 @@ row_sel_try_search_shortcut_for_mysql( } if (rec_get_deleted_flag(rec, dict_table_is_comp(index->table))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(row_get_rec_trx_id(rec, index, *offsets)); return(SEL_EXHAUSTED); } @@ -5129,6 +5127,10 @@ locks_ok: page_rec_is_comp() cannot be used! */ if (rec_get_deleted_flag(rec, comp)) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing undo log record. */ + ut_ad(index != clust_index + || row_get_rec_trx_id(rec, index, offsets)); /* The record is delete-marked: we can skip it */ @@ -5364,7 +5366,6 @@ requires_clust_rec: && prebuilt->select_lock_type == LOCK_NONE && !prebuilt->m_no_prefetch && !prebuilt->templ_contains_blob - && !prebuilt->templ_contains_fixed_point && !prebuilt->clust_index_was_generated && !prebuilt->used_in_HANDLER && prebuilt->template_type != ROW_MYSQL_DUMMY_TEMPLATE diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index 934b5ad5a7a..ef0c3ed9cc3 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -230,6 +230,14 @@ row_undo_ins_remove_sec_low( case ROW_NOT_FOUND: goto func_exit; case ROW_FOUND: + if (dict_index_is_spatial(index) + && rec_get_deleted_flag( + btr_pcur_get_rec(&pcur), + dict_table_is_comp(index->table))) { + ib::error() << "Record found in index " << index->name + << " is deleted marked on insert rollback."; + ut_ad(0); + } break; case ROW_BUFFERED: @@ -240,15 +248,6 @@ row_undo_ins_remove_sec_low( ut_error; } - if (search_result == ROW_FOUND && dict_index_is_spatial(index)) { - rec_t* rec = btr_pcur_get_rec(&pcur); - if (rec_get_deleted_flag(rec, - dict_table_is_comp(index->table))) { - ib::error() << "Record found in index " << index->name - << " is deleted marked on insert rollback."; - } - } - btr_cur = btr_pcur_get_btr_cur(&pcur); if (modify_leaf) { diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index 8fa5c2ccbff..a0c69fb97f9 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -215,6 +215,9 @@ row_undo_mod_remove_clust_low( than the rolling-back one. */ ut_ad(rec_get_deleted_flag(btr_cur_get_rec(btr_cur), dict_table_is_comp(node->table))); + /* In delete-marked records, DB_TRX_ID must + always refer to an existing update_undo log record. */ + ut_ad(rec_get_trx_id(btr_cur_get_rec(btr_cur), btr_cur->index)); if (mode == BTR_MODIFY_LEAF) { err = btr_cur_optimistic_delete(btr_cur, 0, mtr) @@ -350,8 +353,9 @@ row_undo_mod_clust( * it can be reallocated at any time after this mtr-commits * which is just below */ - ut_ad(srv_immediate_scrub_data_uncompressed || - rec_get_trx_id(btr_pcur_get_rec(pcur), index) == node->new_trx_id); + ut_ad(srv_immediate_scrub_data_uncompressed + || row_get_rec_trx_id(btr_pcur_get_rec(pcur), index, offsets) + == node->new_trx_id); btr_pcur_commit_specify_mtr(pcur, &mtr); @@ -515,6 +519,7 @@ row_undo_mod_del_mark_or_remove_sec_low( ib::error() << "Record found in index " << index->name << " is deleted marked" " on rollback update."; + ut_ad(0); } } diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 69c828e54c8..34995faa2be 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -2663,7 +2663,8 @@ row_upd_clust_rec_by_insert( marked, then we are here after a DB_LOCK_WAIT. Skip delete marking clustered index and disowning its blobs. */ - ut_ad(rec_get_trx_id(rec, index) == trx->id); + ut_ad(row_get_rec_trx_id(rec, index, offsets) + == trx->id); ut_ad(!trx_undo_roll_ptr_is_insert( row_get_rec_roll_ptr(rec, index, offsets))); diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index d7b7711e402..53009ca7621 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -201,17 +201,9 @@ static os_event_t srv_master_thread_disabled_event; char* srv_log_group_home_dir; ulong srv_n_log_files; -/** At startup, this is the current redo log file size. -During startup, if this is different from srv_log_file_size_requested -(innodb_log_file_size), the redo log will be rebuilt and this size -will be initialized to srv_log_file_size_requested. -When upgrading from a previous redo log format, this will be set to 0, -and writing to the redo log is not allowed. - -During startup, this is in bytes, and later converted to pages. */ -ib_uint64_t srv_log_file_size; -/** The value of the startup parameter innodb_log_file_size */ -ib_uint64_t srv_log_file_size_requested; +/** The InnoDB redo log file size, or 0 when changing the redo log format +at startup (while disallowing writes to the redo log). */ +ulonglong srv_log_file_size; /** copy of innodb_log_buffer_size, but in database pages */ ulint srv_log_buffer_size; /** innodb_flush_log_at_trx_commit */ @@ -1161,8 +1153,6 @@ srv_normalize_init_values(void) srv_tmp_space.normalize(); - srv_log_file_size /= UNIV_PAGE_SIZE; - srv_log_buffer_size /= UNIV_PAGE_SIZE; srv_lock_table_size = 5 * (srv_buf_pool_size / UNIV_PAGE_SIZE); diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 7fbf069257d..072a5c67bc7 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -138,6 +138,8 @@ bool srv_is_being_started; bool srv_sys_tablespaces_open; /** TRUE if the server was successfully started */ bool srv_was_started; +/** The original value of srv_log_file_size (innodb_log_file_size) */ +static ulonglong srv_log_file_size_requested; /** TRUE if innobase_start_or_create_for_mysql() has been called */ static bool srv_start_has_been_called; @@ -147,6 +149,8 @@ UNIV_INTERN bool srv_undo_sources; #ifdef UNIV_DEBUG /** InnoDB system tablespace to set during recovery */ UNIV_INTERN uint srv_sys_space_size_debug; +/** whether redo log files have been created at startup */ +UNIV_INTERN bool srv_log_files_created; #endif /* UNIV_DEBUG */ /** Bit flags for tracking background thread creation. They are used to @@ -372,17 +376,13 @@ create_log_file( } ib::info() << "Setting log file " << name << " size to " - << (srv_log_file_size >> (20 - UNIV_PAGE_SIZE_SHIFT)) - << " MB"; + << srv_log_file_size << " bytes"; - ret = os_file_set_size(name, *file, - (os_offset_t) srv_log_file_size - << UNIV_PAGE_SIZE_SHIFT, + ret = os_file_set_size(name, *file, srv_log_file_size, srv_read_only_mode); if (!ret) { - ib::error() << "Cannot set log file " << name << " to size " - << (srv_log_file_size >> (20 - UNIV_PAGE_SIZE_SHIFT)) - << " MB"; + ib::error() << "Cannot set log file " << name << " size to " + << srv_log_file_size << " bytes"; return(DB_ERROR); } @@ -465,17 +465,17 @@ create_log_files( ut_a(fil_validate()); ut_a(log_space != NULL); + const ulint size = ulint(srv_log_file_size >> srv_page_size_shift); + logfile0 = fil_node_create( - logfilename, (ulint) srv_log_file_size, - log_space, false, false); + logfilename, size, log_space, false, false); ut_a(logfile0); for (unsigned i = 1; i < srv_n_log_files; i++) { sprintf(logfilename + dirnamelen, "ib_logfile%u", i); - if (!fil_node_create(logfilename, - (ulint) srv_log_file_size, + if (!fil_node_create(logfilename, size, log_space, false, false)) { ib::error() @@ -486,8 +486,8 @@ create_log_files( } } - log_init(srv_n_log_files, srv_log_file_size * UNIV_PAGE_SIZE); - if (!log_set_capacity()) { + log_init(srv_n_log_files); + if (!log_set_capacity(srv_log_file_size_requested)) { return(DB_ERROR); } @@ -526,6 +526,9 @@ create_log_files_rename( we need to explicitly flush the log buffers. */ fil_flush(SRV_LOG_SPACE_FIRST_ID); + ut_ad(!srv_log_files_created); + ut_d(srv_log_files_created = true); + DBUG_EXECUTE_IF("innodb_log_abort_9", return(DB_ERROR);); DBUG_PRINT("ib_log", ("After innodb_log_abort_9")); @@ -959,8 +962,6 @@ srv_undo_tablespaces_init(bool create_new_db) if (0 == srv_undo_tablespaces_open++) { srv_undo_space_id_start = undo_tablespace_ids[i]; } - - ++srv_undo_tablespaces_open; } /* Open any extra unused undo tablespaces. These must be contiguous. @@ -1231,6 +1232,7 @@ static void srv_shutdown_all_bg_threads() { + ut_ad(!srv_undo_sources); srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS; /* All threads end up waiting for certain events. Put those events @@ -1282,13 +1284,7 @@ srv_shutdown_all_bg_threads() os_event_set(buf_flush_event); - /* f. dict_stats_thread is signaled from - logs_empty_and_mark_files_at_shutdown() and - should have already quit or is quitting right - now. */ - if (srv_use_mtflush) { - /* g. Exit the multi threaded flush threads */ buf_mtflu_io_thread_exit(); } } @@ -1297,13 +1293,11 @@ srv_shutdown_all_bg_threads() os_aio_wake_all_threads_at_shutdown(); } - const bool active = os_thread_active(); - - os_thread_sleep(100000); - - if (!active) { + if (!os_thread_count) { return; } + + os_thread_sleep(100000); } ib::warn() << os_thread_count << " threads created by InnoDB" @@ -1414,7 +1408,7 @@ srv_prepare_to_delete_redo_log_files( info << srv_n_log_files << "*" << srv_log_file_size_requested - << " pages; LSN=" << flushed_lsn; + << " bytes; LSN=" << flushed_lsn; } /* Flush the old log files. */ @@ -1642,10 +1636,10 @@ innobase_start_or_create_for_mysql() /* Do not allocate too large of a buffer pool on Windows 32-bit systems, which can have trouble allocating larger single contiguous memory blocks. */ + srv_buf_pool_size = static_cast<ulint>(ut_uint64_align_up(srv_buf_pool_size, srv_buf_pool_chunk_unit)); srv_buf_pool_instances = ut_min( static_cast<ulong>(MAX_BUFFER_POOLS), - static_cast<ulong>(srv_buf_pool_size - / (128 * 1024 * 1024))); + static_cast<ulong>(srv_buf_pool_size / srv_buf_pool_chunk_unit)); #else /* defined(_WIN32) && !defined(_WIN64) */ /* Default to 8 instances when size > 1GB. */ srv_buf_pool_instances = 8; @@ -1835,8 +1829,7 @@ innobase_start_or_create_for_mysql() fsp_init(); log_sys_init(); - recv_sys_create(); - recv_sys_init(buf_pool_get_curr_size()); + recv_sys_init(); lock_sys_create(srv_lock_table_size); /* Create i/o-handler threads: */ @@ -1868,8 +1861,7 @@ innobase_start_or_create_for_mysql() srv_start_state_set(SRV_START_STATE_IO); } - if (srv_n_log_files * srv_log_file_size * UNIV_PAGE_SIZE - >= 512ULL * 1024ULL * 1024ULL * 1024ULL) { + if (srv_n_log_files * srv_log_file_size >= 512ULL << 30) { /* log_block_convert_lsn_to_no() limits the returned block number to 1G and given that OS_FILE_LOG_BLOCK_SIZE is 512 bytes, then we have a limit of 512 GB. If that limit is to @@ -1880,18 +1872,8 @@ innobase_start_or_create_for_mysql() return(srv_init_abort(DB_ERROR)); } - if (srv_n_log_files * srv_log_file_size >= ULINT_MAX) { - /* fil_io() takes ulint as an argument and we are passing - (next_offset / UNIV_PAGE_SIZE) to it in log_group_write_buf(). - So (next_offset / UNIV_PAGE_SIZE) must be less than ULINT_MAX. - So next_offset must be < ULINT_MAX * UNIV_PAGE_SIZE. This - means that we are limited to ULINT_MAX * UNIV_PAGE_SIZE which - is 64 TB on 32 bit systems. */ - ib::error() << "Combined size of log files must be < " - << ULINT_MAX / 1073741824 * UNIV_PAGE_SIZE << " GB"; - - return(srv_init_abort(DB_ERROR)); - } + compile_time_assert(ulonglong(ULINT_MAX) * UNIV_PAGE_SIZE_MIN + >= 512ULL << 30); os_normalize_path(srv_data_home); @@ -2030,27 +2012,22 @@ innobase_start_or_create_for_mysql() ut_a(size != (os_offset_t) -1); - if (size & ((1 << UNIV_PAGE_SIZE_SHIFT) - 1)) { + if (size & (OS_FILE_LOG_BLOCK_SIZE - 1)) { ib::error() << "Log file " << logfilename << " size " << size << " is not a" - " multiple of innodb_page_size"; + " multiple of 512 bytes"; return(srv_init_abort(DB_ERROR)); } - size >>= UNIV_PAGE_SIZE_SHIFT; - if (i == 0) { srv_log_file_size = size; } else if (size != srv_log_file_size) { ib::error() << "Log file " << logfilename - << " is of different size " - << (size << UNIV_PAGE_SIZE_SHIFT) + << " is of different size " << size << " bytes than other log files " - << (srv_log_file_size - << UNIV_PAGE_SIZE_SHIFT) - << " bytes!"; + << srv_log_file_size << " bytes!"; return(srv_init_abort(DB_ERROR)); } } @@ -2071,23 +2048,23 @@ innobase_start_or_create_for_mysql() ut_a(fil_validate()); ut_a(log_space); - /* srv_log_file_size is measured in pages; if page size is 16KB, - then we have a limit of 64TB on 32 bit systems */ - ut_a(srv_log_file_size <= ULINT_MAX); + ut_a(srv_log_file_size <= 512ULL << 30); + + const ulint size = 1 + ulint((srv_log_file_size - 1) + >> srv_page_size_shift); - for (unsigned j = 0; j < i; j++) { + for (unsigned j = 0; j < srv_n_log_files_found; j++) { sprintf(logfilename + dirnamelen, "ib_logfile%u", j); - if (!fil_node_create(logfilename, - (ulint) srv_log_file_size, + if (!fil_node_create(logfilename, size, log_space, false, false)) { return(srv_init_abort(DB_ERROR)); } } - log_init(i, srv_log_file_size * UNIV_PAGE_SIZE); + log_init(srv_n_log_files_found); - if (!log_set_capacity()) { + if (!log_set_capacity(srv_log_file_size_requested)) { return(srv_init_abort(DB_ERROR)); } } @@ -2793,11 +2770,7 @@ innodb_shutdown() ut_ad(!srv_running); ut_ad(!srv_undo_sources); - /* 1. Flush the buffer pool to disk, write the current lsn to - the tablespace header(s), and copy all log data to archive. - The step 1 is the real InnoDB shutdown. The remaining steps 2 - ... - just free data structures after the shutdown. */ - + /* Shut down the persistent files. */ logs_empty_and_mark_files_at_shutdown(); if (ulint n_threads = srv_conc_get_active_threads()) { @@ -2806,7 +2779,7 @@ innodb_shutdown() " inside InnoDB at shutdown"; } - /* 2. Make all threads created by InnoDB to exit */ + /* Exit any remaining threads. */ srv_shutdown_all_bg_threads(); if (srv_monitor_file) { @@ -2911,7 +2884,8 @@ innodb_shutdown() /* 4. Free all allocated memory */ pars_lexer_close(); - log_mem_free(); + recv_sys_close(); + ut_ad(buf_pool_ptr || !srv_was_started); if (buf_pool_ptr) { buf_pool_free(srv_buf_pool_instances); diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc index e43e87eb14e..d6f3ef6c986 100644 --- a/storage/innobase/sync/sync0debug.cc +++ b/storage/innobase/sync/sync0debug.cc @@ -1267,11 +1267,6 @@ LatchDebug::shutdown() mutex_free(&rw_lock_debug_mutex); - if (instance() == NULL) { - - return; - } - ut_a(s_initialized); s_initialized = false; diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index 6d3ade289bb..02aee500e02 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -906,6 +906,10 @@ trx_undo_page_report_modify( ut_ad(!rec_get_deleted_flag(rec, dict_table_is_comp(table))); type_cmpl = TRX_UNDO_DEL_MARK_REC; } else if (rec_get_deleted_flag(rec, dict_table_is_comp(table))) { + /* In delete-marked records, DB_TRX_ID must + always refer to an existing update_undo log record. */ + ut_ad(row_get_rec_trx_id(rec, index, offsets)); + type_cmpl = TRX_UNDO_UPD_DEL_REC; /* We are about to update a delete marked record. We don't typically need the prefix in this case unless @@ -1875,6 +1879,10 @@ trx_undo_report_row_operation( ut_ad(!srv_read_only_mode); trx = thr_get_trx(thr); + /* This function must not be invoked during rollback + (of a TRX_STATE_PREPARE transaction or otherwise). */ + ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE)); + ut_ad(!trx->in_rollback); mtr.start(); trx_undo_t** pundo; @@ -1888,6 +1896,7 @@ trx_undo_report_row_operation( pundo = &trx->rsegs.m_noredo.undo; } else { ut_ad(!trx->read_only); + ut_ad(trx->id); /* Keep INFORMATION_SCHEMA.TABLES.UPDATE_TIME up-to-date for persistent tables. Temporary tables are not listed there. */ diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 8d7c72319ed..c35faede4b9 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -176,95 +176,67 @@ trx_sys_update_mysql_binlog_offset( /*===============================*/ const char* file_name,/*!< in: MySQL log file name */ int64_t offset, /*!< in: position in that log file */ - ulint field, /*!< in: offset of the MySQL log info field in - the trx sys header */ trx_sysf_t* sys_header, /*!< in: trx sys header */ mtr_t* mtr) /*!< in: mtr */ { DBUG_PRINT("InnoDB",("trx_mysql_binlog_offset: %lld", (longlong) offset)); - if (ut_strlen(file_name) >= TRX_SYS_MYSQL_LOG_NAME_LEN) { + const size_t len = strlen(file_name) + 1; + + if (len > TRX_SYS_MYSQL_LOG_NAME_LEN) { /* We cannot fit the name to the 512 bytes we have reserved */ return; } - if (mach_read_from_4(sys_header + field - + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD) + if (mach_read_from_4(TRX_SYS_MYSQL_LOG_MAGIC_N_FLD + + TRX_SYS_MYSQL_LOG_INFO + sys_header) != TRX_SYS_MYSQL_LOG_MAGIC_N) { - mlog_write_ulint(sys_header + field - + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD, + mlog_write_ulint(TRX_SYS_MYSQL_LOG_MAGIC_N_FLD + + TRX_SYS_MYSQL_LOG_INFO + sys_header, TRX_SYS_MYSQL_LOG_MAGIC_N, MLOG_4BYTES, mtr); } - if (0 != strcmp((char*) (sys_header + field + TRX_SYS_MYSQL_LOG_NAME), - file_name)) { - - mlog_write_string(sys_header + field - + TRX_SYS_MYSQL_LOG_NAME, - (byte*) file_name, 1 + ut_strlen(file_name), - mtr); + if (memcmp(file_name, TRX_SYS_MYSQL_LOG_NAME + TRX_SYS_MYSQL_LOG_INFO + + sys_header, len)) { + mlog_write_string(TRX_SYS_MYSQL_LOG_NAME + + TRX_SYS_MYSQL_LOG_INFO + + sys_header, + reinterpret_cast<const byte*>(file_name), + len, mtr); } - if (mach_read_from_4(sys_header + field - + TRX_SYS_MYSQL_LOG_OFFSET_HIGH) > 0 - || (offset >> 32) > 0) { - - mlog_write_ulint(sys_header + field - + TRX_SYS_MYSQL_LOG_OFFSET_HIGH, - (ulint)(offset >> 32), - MLOG_4BYTES, mtr); - } - - mlog_write_ulint(sys_header + field - + TRX_SYS_MYSQL_LOG_OFFSET_LOW, - (ulint)(offset & 0xFFFFFFFFUL), - MLOG_4BYTES, mtr); + mlog_write_ull(TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_OFFSET + + sys_header, offset, mtr); } -/*****************************************************************//** -Stores the MySQL binlog offset info in the trx system header if -the magic number shows it valid, and print the info to stderr */ +/** Display the MySQL binlog offset info if it is present in the trx +system header. */ void -trx_sys_print_mysql_binlog_offset(void) -/*===================================*/ +trx_sys_print_mysql_binlog_offset() { - trx_sysf_t* sys_header; mtr_t mtr; - ulint trx_sys_mysql_bin_log_pos_high; - ulint trx_sys_mysql_bin_log_pos_low; - - mtr_start(&mtr); - sys_header = trx_sysf_get(&mtr); - - if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD) - != TRX_SYS_MYSQL_LOG_MAGIC_N) { - - mtr_commit(&mtr); + mtr.start(); - return; + const trx_sysf_t* sys_header = trx_sysf_get(&mtr); + + if (mach_read_from_4(TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD + sys_header) + == TRX_SYS_MYSQL_LOG_MAGIC_N) { + ib::info() << "Last binlog file '" + << TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME + + sys_header + << "', position " + << mach_read_from_8(TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_OFFSET + + sys_header); } - trx_sys_mysql_bin_log_pos_high = mach_read_from_4( - sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_HIGH); - trx_sys_mysql_bin_log_pos_low = mach_read_from_4( - sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_LOW); - - fprintf(stderr, - "InnoDB: Last MySQL binlog file position " ULINTPF " " ULINTPF - ", file name %s\n", - trx_sys_mysql_bin_log_pos_high, trx_sys_mysql_bin_log_pos_low, - sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_NAME); - - mtr_commit(&mtr); + mtr.commit(); } #ifdef WITH_WSREP @@ -349,10 +321,11 @@ trx_sys_update_wsrep_checkpoint( } -void -trx_sys_read_wsrep_checkpoint( -/*==========================*/ - XID* xid) +/** Read WSREP checkpoint XID from sys header. +@param[out] xid WSREP XID +@return whether the checkpoint was present */ +bool +trx_sys_read_wsrep_checkpoint(XID* xid) { trx_sysf_t* sys_header; mtr_t mtr; @@ -372,7 +345,7 @@ trx_sys_read_wsrep_checkpoint( memcpy(xid->data + 24, &seqno, sizeof(long long)); xid->formatID = -1; mtr_commit(&mtr); - return; + return false; } xid->formatID = (int)mach_read_from_4( @@ -389,6 +362,7 @@ trx_sys_read_wsrep_checkpoint( XIDDATASIZE); mtr_commit(&mtr); + return true; } #endif /* WITH_WSREP */ diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 7fdbd808a60..d397a2d2880 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -548,6 +548,10 @@ static void trx_validate_state_before_free(trx_t* trx) { + ut_ad(!trx->declared_to_be_inside_innodb); + ut_ad(!trx->n_mysql_tables_in_use); + ut_ad(!trx->mysql_n_tables_locked); + if (trx->declared_to_be_inside_innodb) { ib::error() << "Freeing a trx (" << trx << ", " @@ -558,7 +562,7 @@ trx_validate_state_before_free(trx_t* trx) putc('\n', stderr); /* This is an error but not a fatal error. We must keep - the counters like srv_conc_n_threads accurate. */ + the counters like srv_conc.n_active accurate. */ srv_conc_force_exit_innodb(trx); } @@ -1492,7 +1496,6 @@ trx_write_serialisation_history( trx_sys_update_mysql_binlog_offset( trx->mysql_log_file_name, trx->mysql_log_offset, - TRX_SYS_MYSQL_LOG_INFO, sys_header, mtr); diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index 959e31c3598..e4cf20bf685 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -375,18 +375,18 @@ int maria_create(const char *name, enum data_file_type datafile_type, if (rows_per_page > 0) { set_if_smaller(rows_per_page, MAX_ROWS_PER_PAGE); - ci->max_rows= data_file_length / maria_block_size * rows_per_page; + ci->max_rows= (data_file_length / maria_block_size+1) * rows_per_page; } else ci->max_rows= data_file_length / (min_pack_length + extra_header_size + - DIR_ENTRY_SIZE); + DIR_ENTRY_SIZE)+1; } else ci->max_rows=(ha_rows) (ci->data_file_length/(min_pack_length + ((options & HA_OPTION_PACK_RECORD) ? - 3 : 0))); + 3 : 0)))+1; } max_rows= (ulonglong) ci->max_rows; if (datafile_type == BLOCK_RECORD) @@ -1204,7 +1204,7 @@ int maria_create(const char *name, enum data_file_type datafile_type, if (mysql_file_chsize(file,(ulong) share.base.keystart,0,MYF(0))) goto err; - if (sync_dir && mysql_file_sync(file, MYF(0))) + if (!internal_table && sync_dir && mysql_file_sync(file, MYF(0))) goto err; if (! (flags & HA_DONT_TOUCH_DATA)) @@ -1214,7 +1214,7 @@ int maria_create(const char *name, enum data_file_type datafile_type, share.base.min_pack_length*ci->reloc_rows,0,MYF(0))) goto err; #endif - if (sync_dir && mysql_file_sync(dfile, MYF(0))) + if (!internal_table && sync_dir && mysql_file_sync(dfile, MYF(0))) goto err; if (mysql_file_close(dfile,MYF(0))) goto err; diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index c4a7df4443c..5c5e41be1f8 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -565,7 +565,10 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) set_if_smaller(max_data_file_length, INT_MAX32); set_if_smaller(max_key_file_length, INT_MAX32); #endif - share->base.max_data_file_length=(my_off_t) max_data_file_length; + /* For internal temporary tables, max_data_file_length is already set */ + if (!internal_table || !share->base.max_data_file_length) + share->base.max_data_file_length=(my_off_t) max_data_file_length; + DBUG_ASSERT(share->base.max_data_file_length); share->base.max_key_file_length=(my_off_t) max_key_file_length; if (share->options & HA_OPTION_COMPRESS_RECORD) @@ -909,9 +912,12 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) share->block_size * keys : 0)); my_free(disk_cache); _ma_setup_functions(share); + max_data_file_length= share->base.max_data_file_length; if ((*share->once_init)(share, info.dfile.file)) goto err; - if (share->now_transactional) + if (internal_table) + set_if_smaller(share->base.max_data_file_length, + max_data_file_length); { /* Setup initial state that is visible for all */ MARIA_STATE_HISTORY_CLOSED *history; diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index edd5650e07b..6e106976b70 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -896,8 +896,6 @@ cleanup: { DBUG_ASSERT(t_file2.type == WRITE_CACHE); *t_file=t_file2; /* Copy result file */ - t_file->current_pos= &t_file->write_pos; - t_file->current_end= &t_file->write_end; } DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */ diff --git a/storage/maria/ma_state.c b/storage/maria/ma_state.c index 88ce88b8f98..15cc48ad468 100644 --- a/storage/maria/ma_state.c +++ b/storage/maria/ma_state.c @@ -750,9 +750,18 @@ void maria_versioning(MARIA_HA *info, my_bool versioning) void _ma_set_share_data_file_length(MARIA_SHARE *share, ulonglong new_length) { - mysql_mutex_lock(&share->intern_lock); + if (!share->internal_table) + mysql_mutex_lock(&share->intern_lock); if (share->state.state.data_file_length < new_length) + { share->state.state.data_file_length= new_length; + if (new_length >= share->base.max_data_file_length) + { + /* Give an error on next insert */ + share->state.changed|= STATE_DATA_FILE_FULL; + } + } + if (!share->internal_table) mysql_mutex_unlock(&share->intern_lock); } diff --git a/storage/maria/ma_test2.c b/storage/maria/ma_test2.c index 6dfa04a5217..24c48c67210 100644 --- a/storage/maria/ma_test2.c +++ b/storage/maria/ma_test2.c @@ -1006,8 +1006,8 @@ w_requests: %10lu\n\ writes: %10lu\n\ r_requests: %10lu\n\ reads: %10lu\n", - maria_pagecache->blocks_used, - maria_pagecache->global_blocks_changed, + (ulong) maria_pagecache->blocks_used, + (ulong) maria_pagecache->global_blocks_changed, (ulong) maria_pagecache->global_cache_w_requests, (ulong) maria_pagecache->global_cache_write, (ulong) maria_pagecache->global_cache_r_requests, diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c index fdcb5abd090..06aa2da7ae2 100644 --- a/storage/maria/ma_write.c +++ b/storage/maria/ma_write.c @@ -107,9 +107,10 @@ int maria_write(MARIA_HA *info, uchar *record) if (_ma_readinfo(info,F_WRLCK,1)) DBUG_RETURN(my_errno); - if (share->base.reloc == (ha_rows) 1 && - share->base.records == (ha_rows) 1 && - share->state.state.records == (ha_rows) 1) + if ((share->state.changed & STATE_DATA_FILE_FULL) || + (share->base.reloc == (ha_rows) 1 && + share->base.records == (ha_rows) 1 && + share->state.state.records == (ha_rows) 1)) { /* System file */ my_errno=HA_ERR_RECORD_FILE_FULL; goto err2; diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index 0e33f1c938d..6f8964fd479 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -734,6 +734,7 @@ struct st_maria_handler #define STATE_MOVED 512U /* set if base->uuid != maria_uuid */ #define STATE_IN_REPAIR 1024U /* We are running repair on table */ #define STATE_CRASHED_PRINTED 2048U +#define STATE_DATA_FILE_FULL 4096U #define STATE_CRASHED_FLAGS (STATE_CRASHED | STATE_CRASHED_ON_REPAIR | STATE_CRASHED_PRINTED) diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index 0d177072ec7..533f2cd2aa6 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -844,8 +844,6 @@ cleanup: { DBUG_ASSERT(t_file2.type == WRITE_CACHE); *t_file=t_file2; /* Copy result file */ - t_file->current_pos= &t_file->write_pos; - t_file->current_end= &t_file->write_end; } DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */ diff --git a/storage/spider/mysql-test/spider/bg/suite.pm b/storage/spider/mysql-test/spider/bg/suite.pm index 1bb6d7592c8..f106147deb6 100644 --- a/storage/spider/mysql-test/spider/bg/suite.pm +++ b/storage/spider/mysql-test/spider/bg/suite.pm @@ -6,5 +6,7 @@ return "No Spider engine" unless $ENV{HA_SPIDER_SO}; return "Not run for embedded server" if $::opt_embedded_server; return "Test needs --big-test" unless $::opt_big_test; +sub is_default { 1 } + bless { }; diff --git a/storage/spider/mysql-test/spider/handler/r/basic_sql.result b/storage/spider/mysql-test/spider/handler/r/basic_sql.result index da24c08e9fd..94a09fc317b 100644 --- a/storage/spider/mysql-test/spider/handler/r/basic_sql.result +++ b/storage/spider/mysql-test/spider/handler/r/basic_sql.result @@ -9,22 +9,27 @@ child3_2 child3_3 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 +connection master_1; SELECT 1; 1 1 create table select test +connection master_1; DROP TABLE IF EXISTS tb_l; CREATE TABLE tb_l ( a INT, @@ -43,6 +48,7 @@ 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 +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -52,6 +58,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 c 2001-12-31 23:59:59 create table ignore select test +connection master_1; DROP TABLE IF EXISTS ta_l; DROP TABLE IF EXISTS tb_l; CREATE TABLE tb_l ( @@ -70,6 +77,13 @@ 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 +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +Warning 1062 Duplicate entry '3' for key 'PRIMARY' +Warning 1062 Duplicate entry '4' for key 'PRIMARY' +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -79,11 +93,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 c 2001-12-31 23:59:59 create table ignore select test +connection master_1; DROP TABLE IF EXISTS ta_l; 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 +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 f 2008-07-01 10:21:39 @@ -92,24 +108,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 4 i 2003-10-30 05:01:03 5 h 2001-10-31 23:59:59 -create table with partition and select test -CREATE TABLE ta_l2 ( -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 -SELECT a, b, c FROM tb_l -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - create no index table +connection master_1; DROP TABLE IF EXISTS ta_l_no_idx; CREATE TABLE ta_l_no_idx MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1 SELECT a, b, c FROM tb_l +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l_no_idx ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 f 2008-07-01 10:21:39 @@ -119,6 +124,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select table +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 f 2008-07-01 10:21:39 @@ -128,6 +134,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select table shared mode +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; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -138,6 +145,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select table for update +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a FOR UPDATE; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -148,6 +156,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select table join +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; a b date_format(b.c, '%Y-%m-%d %H:%i:%s') @@ -158,6 +167,7 @@ a b date_format(b.c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select table straight_join +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; a b date_format(b.c, '%Y-%m-%d %H:%i:%s') @@ -168,6 +178,7 @@ a b date_format(b.c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select sql_small_result +connection master_1; SELECT SQL_SMALL_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -178,6 +189,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select sql_big_result +connection master_1; SELECT SQL_BIG_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -188,6 +200,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select sql_buffer_result +connection master_1; SELECT SQL_BUFFER_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -198,6 +211,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select sql_cache +connection master_1; SELECT SQL_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -208,6 +222,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select sql_no_cache +connection master_1; SELECT SQL_NO_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -218,6 +233,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select sql_calc_found_rows +connection master_1; SELECT SQL_CALC_FOUND_ROWS a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a LIMIT 4; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -225,11 +241,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 g 2000-02-01 00:00:00 3 j 2007-05-04 20:03:11 4 i 2003-10-30 05:01:03 +connection master_1; SELECT found_rows(); found_rows() 5 select high_priority +connection master_1; SELECT HIGH_PRIORITY a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -240,6 +258,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select distinct +connection master_1; SELECT DISTINCT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -250,11 +269,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select count +connection master_1; SELECT count(*) FROM ta_l ORDER BY a; count(*) 5 select table join not use index +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; a b date_format(a.c, '%Y-%m-%d %H:%i:%s') @@ -265,39 +286,35 @@ a b date_format(a.c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 select using pushdown +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; a b date_format(a.c, '%Y-%m-%d %H:%i:%s') 2 g 2000-02-01 00:00:00 select using index and pushdown +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; a b date_format(a.c, '%Y-%m-%d %H:%i:%s') 2 g 2000-02-01 00:00:00 -select partition using pushdown -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; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - -select partition using index pushdown -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; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - insert +connection master_1; TRUNCATE TABLE ta_l; +connection master_1; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 e 2008-01-01 23:59:59 insert select +connection master_1; TRUNCATE TABLE ta_l; +connection master_1; INSERT INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 f 2008-07-01 10:21:39 @@ -307,59 +324,82 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 insert select a +connection master_1; TRUNCATE TABLE ta_l; +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'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 insert low_priority +connection master_1; TRUNCATE TABLE ta_l; +connection master_1; INSERT LOW_PRIORITY INTO ta_l (a, b, c) values (2, 'e', '2008-01-01 23:59:59'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 e 2008-01-01 23:59:59 insert high_priority +connection master_1; TRUNCATE TABLE ta_l; +connection master_1; INSERT HIGH_PRIORITY INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 e 2008-01-01 23:59:59 insert ignore +connection master_1; INSERT IGNORE INTO ta_l (a, b, c) VALUES (2, 'd', '2009-02-02 01:01:01'); +Warnings: +Warning 1062 Duplicate entry '2' for key 'PRIMARY' +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 e 2008-01-01 23:59:59 insert update (insert) +connection master_1; TRUNCATE TABLE ta_l; +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'; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 e 2008-01-01 23:59:59 insert update (update) +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'; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 f 2005-08-08 11:11:11 replace +connection master_1; TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); +connection master_1; REPLACE INTO ta_l (a, b, c) VALUES (2, 'f', '2008-02-02 02:02:02'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 f 2008-02-02 02:02:02 replace select +connection master_1; REPLACE INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 f 2008-07-01 10:21:39 @@ -369,8 +409,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 replace select a +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'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 @@ -380,8 +422,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 h 2001-10-31 23:59:59 replace low_priority +connection master_1; REPLACE LOW_PRIORITY INTO ta_l (a, b, c) VALUES (3, 'g', '2009-03-03 03:03:03'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 @@ -394,91 +438,89 @@ update 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'); +connection master_1; UPDATE ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 2 f 2008-02-02 02:02:02 update select +connection master_1; UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a IN (SELECT a FROM tb_l); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 g 2009-03-03 03:03:03 update select a +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); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 h 2010-04-04 04:04:04 2 g 2009-03-03 03:03:03 update join +connection master_1; UPDATE ta_l a, tb_l b SET a.b = b.b, a.c = b.c WHERE a.a = b.a; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 f 2008-07-01 10:21:39 2 g 2000-02-01 00:00:00 update join a +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; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 g 2009-03-03 03:03:03 update low_priority +connection master_1; UPDATE LOW_PRIORITY ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 f 2008-02-02 02:02:02 update ignore +connection master_1; UPDATE IGNORE ta_l SET a = 1, b = 'g', c = '2009-03-03 03:03:03' WHERE a = 2; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 f 2008-02-02 02:02:02 update pushdown +connection master_1; update ta_l set b = 'j', c = '2009-03-03 03:03:03' where b = 'f'; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 j 2009-03-03 03:03:03 update index pushdown +connection master_1; UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'j'; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 g 2009-03-03 03:03:03 -update partition pushdown -UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 e 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -update partition index pushdown -UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -487,7 +529,9 @@ 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'); +connection master_1; DELETE FROM ta_l WHERE a = 2; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 @@ -501,7 +545,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 10 j 2008-01-01 23:59:59 delete all +connection master_1; DELETE FROM ta_l; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -513,7 +559,9 @@ 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'); +connection master_1; DELETE FROM ta_l WHERE a IN (SELECT a FROM tb_l); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 6 e 2008-01-01 23:59:59 @@ -530,7 +578,9 @@ 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'); +connection master_1; DELETE FROM ta_l WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 e 2008-01-01 23:59:59 @@ -551,7 +601,9 @@ 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'); +connection master_1; DELETE a FROM ta_l a, (SELECT a FROM tb_l ORDER BY a) b WHERE a.a = b.a; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 6 e 2008-01-01 23:59:59 @@ -568,7 +620,9 @@ 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'); +connection master_1; DELETE LOW_PRIORITY FROM ta_l WHERE a = 2; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 @@ -589,7 +643,9 @@ 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'); +connection master_1; DELETE IGNORE FROM ta_l WHERE a = 2; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 @@ -610,7 +666,9 @@ 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'); +connection master_1; DELETE QUICK FROM ta_l WHERE a = 2; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 e 2008-01-01 23:59:59 @@ -631,7 +689,9 @@ 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'); +connection master_1; DELETE FROM ta_l WHERE b = 'e'; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 10 j 2008-01-01 23:59:59 @@ -644,41 +704,26 @@ 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'); +connection master_1; DELETE FROM ta_l WHERE a > 0 AND b = 'e'; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 10 j 2008-01-01 23:59:59 -delete partition pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -delete partition index pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - truncate +connection master_1; TRUNCATE TABLE ta_l; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/handler/r/basic_sql_part.result b/storage/spider/mysql-test/spider/handler/r/basic_sql_part.result new file mode 100644 index 00000000000..0f4029404a7 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/r/basic_sql_part.result @@ -0,0 +1,141 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +connection master_1; +SELECT 1; +1 +1 +connection master_1; +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'f', '2008-07-01 10:21:39'), +(2, 'g', '2000-02-01 00:00:00'), +(3, 'j', '2007-05-04 20:03:11'), +(4, 'i', '2003-10-30 05:01:03'), +(5, 'h', '2001-10-31 23:59:59'); + +create table with partition and select test +connection master_1; +CREATE TABLE ta_l2 ( +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 +SELECT a, b, c FROM tb_l +connection master_1; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +select partition using pushdown +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; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +select partition using index pushdown +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; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +update partition pushdown +connection master_1; +UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; +connection master_1; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 e 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +update partition index pushdown +connection master_1; +UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; +connection master_1; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +connection master_1; +DELETE FROM ta_l2 WHERE b = 'g'; +connection master_1; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition index pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +connection master_1; +DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; +connection master_1; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/handler/r/direct_aggregate.result b/storage/spider/mysql-test/spider/handler/r/direct_aggregate.result index 0e845fabda1..9a8660ba79e 100644 --- a/storage/spider/mysql-test/spider/handler/r/direct_aggregate.result +++ b/storage/spider/mysql-test/spider/handler/r/direct_aggregate.result @@ -9,22 +9,27 @@ child3_2 child3_3 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 +connection master_1; SELECT 1; 1 1 create table select test +connection master_1; DROP TABLE IF EXISTS ta_l; CREATE TABLE ta_l ( a INT, @@ -40,6 +45,7 @@ INSERT INTO ta_l (a, b, c) VALUES (5, 'c', '2001-12-31 23:59:59'); direct_aggregating test +connection master_1; SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 0 @@ -48,76 +54,38 @@ COUNT(*) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 1 +Spider_direct_aggregate 0 SELECT MAX(a) FROM ta_l; MAX(a) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 2 +Spider_direct_aggregate 0 SELECT MIN(a) FROM ta_l; MIN(a) 1 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 3 +Spider_direct_aggregate 0 SELECT MAX(a) FROM ta_l WHERE a < 5; MAX(a) 4 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 4 +Spider_direct_aggregate 0 SELECT MIN(a) FROM ta_l WHERE a > 1; MIN(a) 2 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 5 - -handler with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 5 -SELECT COUNT(*) FROM ta_l2; -COUNT(*) -5 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 7 -SELECT MAX(a) FROM ta_l2; -MAX(a) -5 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 9 -SELECT MIN(a) FROM ta_l2; -MIN(a) -1 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 11 -SELECT MAX(a) FROM ta_l2 WHERE a < 5; -MAX(a) -4 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 13 -SELECT MIN(a) FROM ta_l2 WHERE a > 1; -MIN(a) -2 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 15 +Spider_direct_aggregate 0 deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/handler/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/handler/r/direct_aggregate_part.result new file mode 100644 index 00000000000..760b39e16d5 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/r/direct_aggregate_part.result @@ -0,0 +1,90 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +connection master_1; +SELECT 1; +1 +1 + +with partition test +connection master_1; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT COUNT(*) FROM ta_l2; +COUNT(*) +5 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT MAX(a) FROM ta_l2; +MAX(a) +5 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT MIN(a) FROM ta_l2; +MIN(a) +1 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT MAX(a) FROM ta_l2 WHERE a < 5; +MAX(a) +4 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT MIN(a) FROM ta_l2 WHERE a > 1; +MIN(a) +2 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/handler/r/direct_update.result b/storage/spider/mysql-test/spider/handler/r/direct_update.result index ea3a23eb8b8..74dae7aec2e 100644 --- a/storage/spider/mysql-test/spider/handler/r/direct_update.result +++ b/storage/spider/mysql-test/spider/handler/r/direct_update.result @@ -9,22 +9,27 @@ child3_2 child3_3 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 +connection master_1; SELECT 1; 1 1 create table select test +connection master_1; DROP TABLE IF EXISTS ta_l; CREATE TABLE ta_l ( a INT, @@ -40,9 +45,9 @@ INSERT INTO ta_l (a, b, c) VALUES (5, 'c', '2001-12-31 23:59:59'); direct_updating test +connection master_1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value -Spider_direct_update 0 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -54,7 +59,6 @@ update all rows with function UPDATE ta_l SET c = ADDDATE(c, 1); SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value -Spider_direct_update 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -66,7 +70,6 @@ update by primary key UPDATE ta_l SET b = 'x' WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value -Spider_direct_update 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -78,7 +81,6 @@ update by a column without index UPDATE ta_l SET c = '2011-10-17' WHERE b = 'x'; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value -Spider_direct_update 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -90,7 +92,6 @@ 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; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value -Spider_direct_update 4 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -102,7 +103,6 @@ delete by primary key with order and limit DELETE FROM ta_l WHERE a < 4 ORDER BY c LIMIT 1; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value -Spider_direct_delete 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -113,7 +113,6 @@ delete by a column without index DELETE FROM ta_l WHERE b = 'c'; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value -Spider_direct_delete 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -123,111 +122,17 @@ delete by primary key DELETE FROM ta_l WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value -Spider_direct_delete 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 4 d 2003-12-01 05:01:03 -handler with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -Spider_direct_update 4 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -update all rows with function -UPDATE ta_l2 SET c = ADDDATE(c, 1); -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -Spider_direct_update 6 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 e 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key -UPDATE ta_l2 SET b = 'x' WHERE a = 3; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -Spider_direct_update 7 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by a column without index -UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -Spider_direct_update 9 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -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; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -Spider_direct_update 10 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by primary key with order and limit -DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -Spider_direct_delete 4 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by a column without index -DELETE FROM ta_l2 WHERE b = 'c'; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -Spider_direct_delete 6 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -delete by primary key -DELETE FROM ta_l2 WHERE a = 3; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -Spider_direct_delete 7 -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -4 d 2003-12-01 05:01:03 - deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/handler/r/direct_update_part.result b/storage/spider/mysql-test/spider/handler/r/direct_update_part.result new file mode 100644 index 00000000000..6db7c01f563 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/r/direct_update_part.result @@ -0,0 +1,137 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +connection master_1; +SELECT 1; +1 +1 + +with partition test +connection master_1; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +update all rows with function +UPDATE ta_l2 SET c = ADDDATE(c, 1); +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 e 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key +UPDATE ta_l2 SET b = 'x' WHERE a = 3; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by a column without index +UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +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; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by primary key with order and limit +DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by a column without index +DELETE FROM ta_l2 WHERE b = 'c'; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +delete by primary key +DELETE FROM ta_l2 WHERE a = 3; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +4 d 2003-12-01 05:01:03 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/handler/r/function.result b/storage/spider/mysql-test/spider/handler/r/function.result index 764c774514b..c088a8a9541 100644 --- a/storage/spider/mysql-test/spider/handler/r/function.result +++ b/storage/spider/mysql-test/spider/handler/r/function.result @@ -9,22 +9,27 @@ child3_2 child3_3 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 +connection master_1; SELECT 1; 1 1 in() +connection master_1; CREATE TABLE t1 ( a VARCHAR(255), PRIMARY KEY(a) @@ -41,12 +46,14 @@ 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; +connection master_1; select a from t1 where a in ('15', '120'); a 120 15 date_sub() +connection master_1; DROP TABLE IF EXISTS ta_l; CREATE TABLE ta_l ( a INT, @@ -124,6 +131,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 4 d 2003-02-03 06:00:03 5 c 2001-03-07 00:58:59 UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 SECOND); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2007-10-07 11:20:40 @@ -133,8 +141,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 c 2001-03-07 00:59:00 deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/handler/r/ha.result b/storage/spider/mysql-test/spider/handler/r/ha.result index e05ecb32e1b..f8833c229ef 100644 --- a/storage/spider/mysql-test/spider/handler/r/ha.result +++ b/storage/spider/mysql-test/spider/handler/r/ha.result @@ -18,34 +18,43 @@ child3_2 child3_3 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; +connection child2_3; DROP DATABASE IF EXISTS auto_test_remote3; CREATE DATABASE auto_test_remote3; USE auto_test_remote3; +connection child3_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child3_2; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child3_3; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; test select 1 +connection master_1; SELECT 1; 1 1 create table test +connection master_1; DROP TABLE IF EXISTS ta_l; CREATE TABLE ta_l ( a INT, @@ -61,6 +70,7 @@ INSERT INTO ta_l (a, b, c) VALUES (5, 'c', '2001-12-31 23:59:59'); select test +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -70,6 +80,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 c 2001-12-31 23:59:59 fail-over test +connection master_1; SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value Spider_mon_table_cache_version 0 @@ -101,6 +112,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 6 e 2011-05-05 20:04:05 recovery test +connection master_1; ALTER TABLE ta_l CONNECTION='host "localhost", user "root", password "", msi "5", mkd "2", @@ -113,6 +125,7 @@ auto_test_local ta_l 1 2 SELECT spider_copy_tables('ta_l', '0', '1'); spider_copy_tables('ta_l', '0', '1') 1 +connection master_1; ALTER TABLE ta_l CONNECTION='host "localhost", user "root", password "", msi "5", mkd "2", @@ -134,117 +147,14 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 6 e 2011-05-05 20:04:05 8 g 2011-05-05 21:33:30 DROP TABLE ta_l; +connection master_1; SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS 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 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 1 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'auto_test_remote3.ta_r4' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 3 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 2 -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; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -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; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 2 -SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); -spider_copy_tables('ta_l2#P#pt2', '0', '1') -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"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - active standby test create table test +connection master_1; DROP TABLE IF EXISTS ta_l; CREATE TABLE ta_l ( a INT, @@ -260,6 +170,7 @@ INSERT INTO ta_l (a, b, c) VALUES (5, 'c', '2001-12-31 23:59:59'); select test +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -269,9 +180,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 5 c 2001-12-31 23:59:59 fail-over test +connection master_1; SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value -Spider_mon_table_cache_version 2 +Spider_mon_table_cache_version 1 Spider_mon_table_cache_version_req 2 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); @@ -284,7 +196,6 @@ auto_test_local ta_l 1 1 SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; db_name table_name link_id auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 auto_test_local ta_l 0 SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value @@ -297,6 +208,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 6 e 2011-05-05 20:04:05 recovery test +connection master_1; ALTER TABLE ta_l CONNECTION='host "localhost", user "root", password "", msi "5", mkd "2", alc "1", @@ -312,102 +224,25 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 8 g 2011-05-05 21:33:30 DROP TABLE ta_l; +connection master_1; SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS 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 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'auto_test_remote.ta_r2' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 3 -auto_test_local ta_l2#P#pt2 1 1 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -auto_test_local ta_l 0 -auto_test_local ta_l2#P#pt2 0 -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 3 -Spider_mon_table_cache_version_req 3 -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; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -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; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +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; +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; for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/handler/r/ha_part.result b/storage/spider/mysql-test/spider/handler/r/ha_part.result new file mode 100644 index 00000000000..315f37298bc --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/r/ha_part.result @@ -0,0 +1,286 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_3; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; +connection child3_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child3_2; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child3_3; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; + +test select 1 +connection master_1; +SELECT 1; +1 +1 + +create table with partition test +connection master_1; +DROP TABLE IF EXISTS 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 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +connection master_1; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +connection master_1; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 0 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'auto_test_remote3.ta_r4' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 3 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +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; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +connection master_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"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 2 +SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); +spider_copy_tables('ta_l2#P#pt2', '0', '1') +1 +connection master_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"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +create table with partition test +connection master_1; +DROP TABLE IF EXISTS 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 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +connection master_1; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +connection master_1; +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'auto_test_remote.ta_r2' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 3 +auto_test_local ta_l2#P#pt2 1 1 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +auto_test_local ta_l2#P#pt2 0 +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +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; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +connection master_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"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +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; +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; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result b/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result index 6de174e1a2d..9a8a59153f0 100644 --- a/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result @@ -10,26 +10,34 @@ child3_3 for slave1_1 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection slave1_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 +connection master_1; SELECT 1; 1 1 3.1 auto_increment +connection master_1; +connection slave1_1; +connection master_1; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, @@ -198,6 +206,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t2; MAX(id) 46 +connection slave1_1; SELECT id FROM t1 ORDER BY id; id 2 @@ -206,188 +215,16 @@ id 1554 2331 10000 -auto_increment with partition -DROP TABLE IF EXISTS t1, t2; -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 -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 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_1"') -1 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_2"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', -'srv "s_2_1"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', -'srv "s_2_2"') -1 -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 -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 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2 -SELECT MAX(id) FROM t1; -MAX(id) -2 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3 -SELECT MAX(id) FROM t2; -MAX(id) -3 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -7 -SELECT MAX(id) FROM t1; -MAX(id) -7 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6 -SELECT MAX(id) FROM t2; -MAX(id) -7 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -10 -SELECT id FROM t1 ORDER BY id; -id -2 -3 -6 -7 -10 -11 -14 -15 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -18 -SELECT id FROM t2 ORDER BY id; -id -2 -3 -6 -7 -10 -11 -14 -15 -18 -19 -22 -23 -TRUNCATE TABLE t1; -TRUNCATE TABLE t2; -INSERT INTO t1 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2 -SELECT id FROM t1 ORDER BY id; -id -2 -3 -6 -7 -INSERT INTO t2 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -10 -SELECT id FROM t2 ORDER BY id; -id -2 -3 -6 -7 -10 -11 -14 -15 -SET INSERT_ID=5000; -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -18 -SELECT MAX(id) FROM t1; -MAX(id) -18 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -19 -SELECT MAX(id) FROM t2; -MAX(id) -19 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -22 -SELECT MAX(id) FROM t1; -MAX(id) -22 -INSERT INTO t2 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -26 -SELECT MAX(id) FROM t2; -MAX(id) -26 -SELECT id FROM t1 ORDER BY id; -id -2 -18 -777 -1554 -2331 -10000 +connection master_1; deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +connection slave1_1; DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for slave1_1 for master_1 diff --git a/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result new file mode 100644 index 00000000000..f8747cff5ea --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result @@ -0,0 +1,238 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection slave1_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +connection master_1; +SELECT 1; +1 +1 +auto_increment with partition +connection master_1; +connection slave1_1; +connection master_1; +DROP TABLE IF EXISTS t1, t2; +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 +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 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') +1 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"') +1 +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 +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 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3 +SELECT MAX(id) FROM t1; +MAX(id) +3 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +7 +SELECT MAX(id) FROM t2; +MAX(id) +7 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2 +SELECT MAX(id) FROM t1; +MAX(id) +7 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6 +SELECT MAX(id) FROM t2; +MAX(id) +7 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +10 +SELECT id FROM t1 ORDER BY id; +id +2 +3 +6 +7 +10 +11 +14 +15 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +18 +SELECT id FROM t2 ORDER BY id; +id +2 +3 +6 +7 +10 +11 +14 +15 +18 +19 +22 +23 +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +INSERT INTO t1 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2 +SELECT id FROM t1 ORDER BY id; +id +2 +3 +6 +7 +INSERT INTO t2 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +10 +SELECT id FROM t2 ORDER BY id; +id +2 +3 +6 +7 +10 +11 +14 +15 +SET INSERT_ID=5000; +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +18 +SELECT MAX(id) FROM t1; +MAX(id) +18 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +19 +SELECT MAX(id) FROM t2; +MAX(id) +19 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +22 +SELECT MAX(id) FROM t1; +MAX(id) +22 +INSERT INTO t2 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +26 +SELECT MAX(id) FROM t2; +MAX(id) +26 +connection slave1_1; +SELECT id FROM t1 ORDER BY id; +id +2 +18 +777 +1554 +2331 +10000 +connection master_1; + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection slave1_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result index 9fd24bcc43f..9b14817eee4 100644 --- a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result @@ -10,25 +10,31 @@ child3_3 for slave1_1 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection slave1_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 +connection master_1; SELECT 1; 1 1 create table and insert +connection master_1; DROP TABLE IF EXISTS tb_l; CREATE TABLE tb_l ( a INT, @@ -50,6 +56,7 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l; 2.13 select table with "order by desc" and "<" +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a < 5 ORDER BY a DESC LIMIT 3; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -58,6 +65,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 2 b 2000-01-01 00:00:00 select table with "order by desc" and "<=" +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a <= 5 ORDER BY a DESC LIMIT 3; a b date_format(c, '%Y-%m-%d %H:%i:%s') @@ -67,7 +75,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 2.14 update table with range scan and split_read +connection master_1; UPDATE ta_l SET c = '2000-02-02 00:00:00' WHERE a > 1; +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -80,6 +90,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') select table with range scan TRUNCATE TABLE ta_l; DROP TABLE IF EXISTS ta_l; +connection master_1; CREATE TABLE ta_l ( a int(11) NOT NULL DEFAULT '0', b char(1) DEFAULT NULL, @@ -87,50 +98,62 @@ c datetime DEFAULT NULL, PRIMARY KEY (a, b, c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1 INSERT INTO ta_l SELECT a, b, c FROM tb_l; +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c 5 c 2001-12-31 23:59:59 +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c 2 b 2000-01-01 00:00:00 +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'; a b c 2 b 2000-01-01 00:00:00 +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c 4 d 2003-11-30 05:01:03 +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'; a b c @@ -138,6 +161,7 @@ a b c 2.16 auto_increment insert with trigger +connection master_1; CREATE TABLE ta_l_auto_inc ( a INT AUTO_INCREMENT, b CHAR(1) DEFAULT 'c', @@ -151,14 +175,17 @@ c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE2 MASTER_1_CHARSET2 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;; +connection master_1; INSERT INTO ta_l_auto_inc (a, b, c) VALUES (NULL, 's', '2008-12-31 20:59:59'); +connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM tc_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 s 2008-12-31 20:59:59 2.17 engine-condition-pushdown with "or" and joining +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); a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -166,37 +193,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 3 e 2007-06-04 20:03:11 4 d 2003-11-30 05:01:03 5 c 2001-12-31 23:59:59 -partition with sort -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 -ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 2.23 -partition update with moving partition -DROP TABLE IF EXISTS 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 -INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); -UPDATE ta_l2 SET a = 4 WHERE a = 3; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -4 B 2010-09-26 00:00:00 index merge +connection master_1; CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, b INT DEFAULT 10, @@ -210,27 +210,7 @@ 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; -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; -a b c -3 4 5 -4 5 6 -5 6 7 -index merge with partition -DROP TABLE IF EXISTS 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 -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); -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; +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; a b c @@ -240,6 +220,7 @@ a b c 2.24 index scan update without PK +connection master_1; DROP TABLE IF EXISTS ta_l_int; CREATE TABLE ta_l_int ( a INT NOT NULL, @@ -250,32 +231,51 @@ KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 SELECT a, b, c FROM ta_l_int ORDER BY a; a b c +1 2 3 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); +connection master_1; UPDATE ta_l_int SET c = 4 WHERE b = 2; +connection master_1; SELECT a, b, c FROM ta_l_int ORDER BY a; a b c 1 2 4 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 17 2 4 +18 2 4 2.25 direct order limit +connection master_1; SHOW STATUS LIKE 'Spider_direct_order_limit'; Variable_name Value Spider_direct_order_limit 2 @@ -283,13 +283,14 @@ SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3; a b c 1 2 4 2 3 4 -4 5 6 +3 4 5 SHOW STATUS LIKE 'Spider_direct_order_limit'; Variable_name Value Spider_direct_order_limit 3 2.26 lock tables +connection master_1; DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1 ( @@ -304,6 +305,9 @@ LOCK TABLES t1 READ, t2 READ; UNLOCK TABLES; auto_increment +connection master_1; +connection slave1_1; +connection master_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, @@ -395,6 +399,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t1; MAX(id) 42 +connection slave1_1; SELECT id FROM t1 ORDER BY id; id 2 @@ -408,114 +413,10 @@ id 1554 2331 10000 - -auto_increment with partition -DROP TABLE IF EXISTS 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 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_1"') -1 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_2"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', -'srv "s_2_1"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', -'srv "s_2_2"') -1 -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 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2 -SELECT MAX(id) FROM t1; -MAX(id) -2 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3 -SELECT MAX(id) FROM t1; -MAX(id) -3 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6 -SELECT MAX(id) FROM t1; -MAX(id) -6 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -7 -SELECT MAX(id) FROM t1; -MAX(id) -7 -INSERT INTO t1 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -10 -SELECT id FROM t1 ORDER BY id; -id -2 -3 -6 -7 -10 -11 -14 -15 -SET INSERT_ID=5000; -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -18 -SELECT MAX(id) FROM t1; -MAX(id) -18 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -22 -SELECT MAX(id) FROM t1; -MAX(id) -22 -INSERT INTO t1 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -26 -SELECT MAX(id) FROM t1; -MAX(id) -26 -SELECT id FROM t1 ORDER BY id; -id -2 -3 -6 -7 -10 -18 -777 -1000 -1554 -2331 -10000 +connection master_1; read only +connection master_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -530,6 +431,10 @@ id 18 22 26 +30 +34 +38 +42 INSERT INTO t1 (id) VALUES (1); ERROR HY000: Table 'auto_test_local.t1' is read only UPDATE t1 SET id = 4 WHERE id = 2; @@ -543,6 +448,7 @@ ERROR HY000: Table 'auto_test_local.t1' is read only 2.27 error mode +connection master_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -566,6 +472,7 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist 3.0 is null +connection master_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( a VARCHAR(255), @@ -588,6 +495,7 @@ 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; +connection master_1; select a from t1 where a is null order by a limit 30; a NULL @@ -654,6 +562,7 @@ NULL NULL direct_order_limit +connection master_1; TRUNCATE TABLE t1; insert into t1 values ('1', '1', '1'); insert into t1 select a + 1, b + 1, c + 1 from t1; @@ -665,6 +574,7 @@ 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; +connection master_1; select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5; a b c 10 74 74 @@ -681,9 +591,13 @@ a c 10 170 deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +connection slave1_1; DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for slave1_1 for master_1 diff --git a/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result new file mode 100644 index 00000000000..c99c02071b6 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result @@ -0,0 +1,241 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection slave1_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +connection master_1; +SELECT 1; +1 +1 +connection master_1; +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +2.17 +partition with sort +connection master_1; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 +ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +2.23 +partition update with moving partition +connection master_1; +DROP TABLE IF EXISTS ta_l2; +connection master_1; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); +UPDATE ta_l2 SET a = 4 WHERE a = 3; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +4 B 2010-09-26 00:00:00 +index merge with partition +connection master_1; +DROP TABLE IF EXISTS ta_l_int; +connection master_1; +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 +INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +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; +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; +a b c +3 4 5 +4 5 6 +5 6 7 + +2.26 +auto_increment with partition +connection master_1; +connection slave1_1; +connection master_1; +DROP TABLE IF EXISTS 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 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') +1 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"') +1 +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 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3 +SELECT MAX(id) FROM t1; +MAX(id) +3 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2 +SELECT MAX(id) FROM t1; +MAX(id) +3 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +7 +SELECT MAX(id) FROM t1; +MAX(id) +7 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6 +SELECT MAX(id) FROM t1; +MAX(id) +7 +INSERT INTO t1 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +10 +SELECT id FROM t1 ORDER BY id; +id +2 +3 +6 +7 +10 +11 +14 +15 +SET INSERT_ID=5000; +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +18 +SELECT MAX(id) FROM t1; +MAX(id) +18 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +22 +SELECT MAX(id) FROM t1; +MAX(id) +22 +INSERT INTO t1 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +26 +SELECT MAX(id) FROM t1; +MAX(id) +26 +connection slave1_1; +SELECT id FROM t1 ORDER BY id; +id +2 +3 +6 +7 +10 +18 +777 +1000 +1554 +2331 +10000 +connection master_1; + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection slave1_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/handler/r/vp_fixes.result b/storage/spider/mysql-test/spider/handler/r/vp_fixes.result index 15dd29aa4d3..cc0e4105d61 100644 --- a/storage/spider/mysql-test/spider/handler/r/vp_fixes.result +++ b/storage/spider/mysql-test/spider/handler/r/vp_fixes.result @@ -9,22 +9,27 @@ child3_2 child3_3 drop and create databases +connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 +connection master_1; SELECT 1; 1 1 create table and insert +connection master_1; DROP TABLE IF EXISTS tb_l; CREATE TABLE tb_l ( a INT, @@ -46,26 +51,34 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l; 0.9 create different primary key table +connection master_1; 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 +connection master_1; INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); create un-correspond primary key table +connection master_1; DROP TABLE IF EXISTS ta_l_int; +connection master_1; 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 +connection master_1; INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3); deinit +connection master_1; DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; +connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/handler/suite.opt b/storage/spider/mysql-test/spider/handler/suite.opt new file mode 100644 index 00000000000..48457b17309 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/suite.opt @@ -0,0 +1 @@ +--loose-innodb diff --git a/storage/spider/mysql-test/spider/handler/suite.pm b/storage/spider/mysql-test/spider/handler/suite.pm new file mode 100644 index 00000000000..f106147deb6 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/suite.pm @@ -0,0 +1,12 @@ +package My::Suite::Spider; + +@ISA = qw(My::Suite); + +return "No Spider engine" unless $ENV{HA_SPIDER_SO}; +return "Not run for embedded server" if $::opt_embedded_server; +return "Test needs --big-test" unless $::opt_big_test; + +sub is_default { 1 } + +bless { }; + diff --git a/storage/tokudb/PerconaFT/ft/loader/dbufio.cc b/storage/tokudb/PerconaFT/ft/loader/dbufio.cc index 64722bd68f1..ad084a4fbdc 100644 --- a/storage/tokudb/PerconaFT/ft/loader/dbufio.cc +++ b/storage/tokudb/PerconaFT/ft/loader/dbufio.cc @@ -566,7 +566,7 @@ dbufio_print(DBUFIO_FILESET bfs) { fprintf(stderr, "%s:%d bfs=%p", __FILE__, __LINE__, bfs); if (bfs->panic) fprintf(stderr, " panic=%d", bfs->panic_errno); - fprintf(stderr, " N=%d %d %" PRIuMAX, bfs->N, bfs->n_not_done, bfs->bufsize); + fprintf(stderr, " N=%d %d %" PRIuMAX, bfs->N, bfs->n_not_done, (uintmax_t) bfs->bufsize); for (int i = 0; i < bfs->N; i++) { struct dbufio_file *dbf = &bfs->files[i]; if (dbf->error_code[0] || dbf->error_code[1]) diff --git a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc index 56876b474d4..9606db64632 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc @@ -761,7 +761,7 @@ int toku_serialize_ftnode_to_memory(FTNODE node, // Zero the rest of the buffer memset(data + total_node_size, 0, total_buffer_size - total_node_size); - assert(curr_ptr - data == total_node_size); + assert((uint32_t) (curr_ptr - data) == total_node_size); *bytes_to_write = data; *n_bytes_to_write = total_buffer_size; *n_uncompressed_bytes = total_uncompressed_size; @@ -2699,7 +2699,7 @@ decompress_from_raw_block_into_rbuf(uint8_t *raw_block, size_t raw_block_size, s // decompress all the compressed sub blocks into the uncompressed buffer r = decompress_all_sub_blocks(n_sub_blocks, sub_block, compressed_data, uncompressed_data, num_cores, ft_pool); if (r != 0) { - fprintf(stderr, "%s:%d block %" PRId64 " failed %d at %p size %lu\n", __FUNCTION__, __LINE__, blocknum.b, r, raw_block, raw_block_size); + fprintf(stderr, "%s:%d block %" PRId64 " failed %d at %p size %zu\n", __FUNCTION__, __LINE__, blocknum.b, r, raw_block, raw_block_size); dump_bad_block(raw_block, raw_block_size); goto exit; } diff --git a/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc b/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc index 88eca36a261..8fe52b10597 100644 --- a/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc +++ b/storage/tokudb/PerconaFT/ft/txn/txn_manager.cc @@ -970,11 +970,11 @@ int toku_txn_manager_recover_root_txn ( txn_manager->last_xid_seen_for_recover = curr_txn->txnid.parent_id64; // if we found the maximum number of prepared transactions we are // allowed to find, then break - if (num_txns_returned >= count) { + if ((long) num_txns_returned >= count) { break; } } - invariant(num_txns_returned <= count); + invariant((long) num_txns_returned <= count); *retp = num_txns_returned; ret_val = 0; exit: diff --git a/support-files/build-tags b/support-files/build-tags index 8e8ed251cd7..660a7d7f9fc 100755 --- a/support-files/build-tags +++ b/support-files/build-tags @@ -8,7 +8,7 @@ then echo sql mysys strings client storage dbug libmysql sql-common \ extra mysys_ssl strings regex pcre vio include \ tools unittest plugin libmysqld | \ - xargs -n1 git ls-files | grep -v '\.jar$' | grep -v '\xz$' | + xargs -n1 git ls-files | grep -v '\.jar$' | grep -v '\.xz$' | \ xargs etags -o TAGS --append else find . -type f ! -name "*.jar" | diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index a7db7c58713..36860892508 100644 --- a/unittest/sql/mf_iocache-t.cc +++ b/unittest/sql/mf_iocache-t.cc @@ -93,7 +93,7 @@ IO_CACHE info; #define CACHE_SIZE 16384 #define INFO_TAIL ", pos_in_file = %llu, pos_in_mem = %lu", \ - info.pos_in_file, (ulong) (*info.current_pos - info.request_pos) + info.pos_in_file, (ulong) ((info.type == READ_CACHE ? info.read_pos : info.write_pos) - info.request_pos) #define FILL 0x5A |