diff options
565 files changed, 23025 insertions, 12433 deletions
diff --git a/.bzrignore b/.bzrignore index c5cb262d2bd..6e09cdd7b5d 100644 --- a/.bzrignore +++ b/.bzrignore @@ -902,6 +902,7 @@ libmysql_r/.libs/libmysqlclient_r.so.15.0.0 libmysql_r/acconfig.h libmysql_r/client_settings.h libmysql_r/conf_to_src +libmysql_r/link_sources libmysql_r/my_static.h libmysql_r/mysys_priv.h libmysql_r/vio_priv.h @@ -1844,6 +1845,7 @@ scripts/make_binary_distribution scripts/make_sharedlib_distribution scripts/make_win_binary_distribution scripts/make_win_src_distribution +scripts/make_win_src_distribution_old scripts/msql2mysql scripts/mysql_config scripts/mysql_convert_table_format @@ -2085,6 +2087,7 @@ sql/gen_lex_hash sql/gmon.out sql/handlerton.cc sql/lex_hash.h +sql/link_sources sql/max/* sql/message.h sql/message.mc @@ -3006,6 +3009,6 @@ vio/viotest.cpp win/configure.data win/vs71cache.txt win/vs8cache.txt +ylwrap zlib/*.ds? zlib/*.vcproj -ylwrap diff --git a/CMakeLists.txt b/CMakeLists.txt index a06495021b3..341f8d08df2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR) + PROJECT(MySql) # This reads user configuration, generated by configure.js. diff --git a/Docs/INSTALL-BINARY b/Docs/INSTALL-BINARY new file mode 100644 index 00000000000..d1c409acd67 --- /dev/null +++ b/Docs/INSTALL-BINARY @@ -0,0 +1,8 @@ + +You can find information about how to install binary distributions at + + http://dev.mysql.com/doc/refman/5.1/en/quick-standard-installation.html + +The MySQL Reference Manual is also available in various formats on +http://dev.mysql.com/doc; if you're interested in the DocBook XML +sources go to http://svn.mysql.com. diff --git a/Docs/Makefile.am b/Docs/Makefile.am index e57a1abcb0c..629618609a3 100644 --- a/Docs/Makefile.am +++ b/Docs/Makefile.am @@ -13,14 +13,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -noinst_SCRIPTS = generate-text-files.pl - -EXTRA_DIST = $(noinst_SCRIPTS) manual.chm mysql.info INSTALL-BINARY - -TXT_FILES= ../INSTALL-SOURCE ../INSTALL-WIN-SOURCE \ - INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt - -all-local: $(TXT_FILES) +EXTRA_DIST = mysql.info INSTALL-BINARY @extra_docs@ # make sure that "make install" installs the info page, too # automake only seems to take care of this automatically, @@ -32,38 +25,5 @@ install-data-hook: $(srcdir)/mysql.info uninstall-local: @RM@ -f $(DESTDIR)$(infodir)/mysql.info -# Problems with "make distclean", works differently for make files -# generated by different versions of the automake. Some require the -# generated files explicitly in DISTCLEANFILES. -DISTCLEANFILES = $(TXT_FILES) - -# This target is not used in builds, just for convinience -CLEAN_FILES: $(TXT_FILES) - touch $(TXT_FILES) - -GT = $(srcdir)/generate-text-files.pl - -../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT) - perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@ - -../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT) - perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@ - -# We put the description for the binary installation here so that -# people who download source wont have to see it. It is moved up to -# the toplevel by the script that makes the binary tar files. -INSTALL-BINARY: $(srcdir)/mysql.info $(GT) - perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@ - -../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT) - perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@ - -# Include the Windows manual.chm in source .tar.gz only if available. -# It is not in BitKeeper, but is downloaded from intranet by Bootstrap. -dist-hook: - if [ -e $(srcdir)/manual.chm ] ; then \ - cp -f $(srcdir)/manual.chm $(distdir); \ - fi - # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/Docs/generate-text-files.pl b/Docs/generate-text-files.pl deleted file mode 100755 index 69e0478eb8a..00000000000 --- a/Docs/generate-text-files.pl +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/perl -w -*- perl -*- -# Copyright (C) 2000, 2003, 2005 MySQL AB -# -# 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 St, Fifth Floor, Boston, MA 02110-1301 USA - -# Generate text files from top directory from the manual. - -$from = shift(@ARGV); -$fnode = shift(@ARGV); -$tnode = shift(@ARGV); - -open(IN, "$from") || die "Cannot open $from: $!"; - -$in = 0; - -while (<IN>) -{ - if ($in) - { - if (/Node: $tnode,/ || /\[index/) - { - $in = 0; - } - elsif (/^File: mysql.info/ || (/^/)) - { - # Just Skip node beginnings - } - else - { - print; - } - } - else - { - if (/Node: $fnode,/) - { - $in = 1; - # Skip first empty line - <IN>; - } - } -} - -close(IN); - -die "Could not find node \"$tnode\"" if ($in == 1); -exit 0; diff --git a/Docs/manual.chm b/Docs/manual.chm deleted file mode 100644 index 28c3e1b5a86..00000000000 --- a/Docs/manual.chm +++ /dev/null @@ -1,14 +0,0 @@ - -********************************************************* - -This is a dummy placeholder file for "manual.chm" in the -MySQL source trees. - -Note, that the documentation has been moved into a separate -BitKeeper source tree named "mysqldoc" - do not attempt to edit this -file! All changes to it should be done in the mysqldoc tree. - -This dummy file is being replaced with the actual file from the -mysqldoc tree when building the official source distribution. - -********************************************************* diff --git a/Docs/mysql.info b/Docs/mysql.info index 5846d7aadf6..b2c411e51ab 100644 --- a/Docs/mysql.info +++ b/Docs/mysql.info @@ -1,27 +1,4 @@ -This is mysql.info, produced by makeinfo version 4.8 from manual.texi. -START-INFO-DIR-ENTRY -* mysql: (mysql). MySQL documentation. -END-INFO-DIR-ENTRY - - -File: mysql.info, Node: Top, Next: (dir), Prev: (dir), Up: (dir) - -This is an empty placeholder file for the MySQL manual. - -The MySQL manual is now maintained in a separate BitKeeper source tree! -Please see `http://www.mysql.com/doc/en/Installing_source_tree.html' -for more info on how to work with BitKeeper. - -This file will be replaced with the current `mysql.info' when building -the official source distribution. - -You can find a specific manual for any older version of MySQL in the -binary or source distribution for that version. - - - -Tag Table: -Node: Top166 - -End Tag Table +The MySQL Reference Manual is available in various formats on +http://dev.mysql.com/doc; if you're interested in the DocBook XML +sources go to http://svn.mysql.com. diff --git a/INSTALL-SOURCE b/INSTALL-SOURCE new file mode 100644 index 00000000000..3a5dd22fa38 --- /dev/null +++ b/INSTALL-SOURCE @@ -0,0 +1,8 @@ + +You can find information about how to install from a source distributions at + + http://dev.mysql.com/doc/refman/5.1/en/installing-source.html + +The MySQL Reference Manual is also available in various formats on +http://dev.mysql.com/doc; if you're interested in the DocBook XML +sources go to http://svn.mysql.com. diff --git a/INSTALL-WIN-SOURCE b/INSTALL-WIN-SOURCE new file mode 100644 index 00000000000..9484513c431 --- /dev/null +++ b/INSTALL-WIN-SOURCE @@ -0,0 +1,9 @@ + +You can find information about how to install from a Windows source +distributions at + + http://dev.mysql.com/doc/refman/5.1/en/windows-source-build.html + +The MySQL Reference Manual is also available in various formats on +http://dev.mysql.com/doc; if you're interested in the DocBook XML +sources go to http://svn.mysql.com. diff --git a/Makefile.am b/Makefile.am index 0125f37d44c..b3f069f0e78 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,8 +53,8 @@ bin-dist: all dist-hook: rm -rf `find $(distdir) -type d -name SCCS -print` mkdir -p $(distdir)/win - scripts/mysql_install_db --no-defaults --windows \ - --basedir=$(top_builddir) \ + scripts/mysql_install_db --no-defaults --cross-bootstrap \ + --builddir=$(top_builddir) \ --datadir=$(distdir)/win/data \ --srcdir=$(top_srcdir) @@ -101,6 +101,7 @@ test-binlog-statement: cd mysql-test ; \ @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement +# This code is duplicated in "test-bt", see the Changeset comment of 2007-Dec-07 test-embedded: if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \ cd mysql-test ; MTR_BUILD_THREAD=auto \ @@ -140,7 +141,13 @@ test-bt: -cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=NDB --force --timer \ --with-ndbcluster-only - -$(MAKE) test-embedded + -if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \ + cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --comment=embedded --force --timer \ + --embedded-server --skip-rpl --skip-ndbcluster ; \ + else \ + echo "no program found for 'embedded' tests - skipped testing" ; \ + fi -cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1 -cd mysql-test ; MTR_BUILD_THREAD=auto \ diff --git a/client/mysql.cc b/client/mysql.cc index 2e23f5456cf..d30b60732bc 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1093,6 +1093,17 @@ static int read_and_execute(bool interactive) if (!interactive) { line=batch_readline(status.line_buff); + /* + Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF. + Editors like "notepad" put this marker in + the very beginning of a text file when + you save the file using "Unicode UTF-8" format. + */ + if (!line_number && + (uchar) line[0] == 0xEF && + (uchar) line[1] == 0xBB && + (uchar) line[2] == 0xBF) + line+= 3; line_number++; if (!glob_buffer.length()) status.query_start_line=line_number; @@ -2156,7 +2167,7 @@ com_go(String *buffer,char *line __attribute__((unused))) { char buff[200], time_buff[32], *pos; MYSQL_RES *result; - ulong timer, warnings; + ulong timer, warnings= 0; uint error= 0; int err= 0; @@ -2208,33 +2219,26 @@ com_go(String *buffer,char *line __attribute__((unused))) } #endif - if (error) - { - executing_query= 0; - buffer->length(0); // Remove query on error - return error; - } - error=0; buffer->length(0); + if (error) + goto end; + do { if (quick) { if (!(result=mysql_use_result(&mysql)) && mysql_field_count(&mysql)) { - executing_query= 0; - return put_error(&mysql); + error= put_error(&mysql); + goto end; } } else { error= mysql_store_result_for_lazy(&result); if (error) - { - executing_query= 0; - return error; - } + goto end; } if (verbose >= 3 || !opt_silent) @@ -2311,12 +2315,11 @@ com_go(String *buffer,char *line __attribute__((unused))) if (err >= 1) error= put_error(&mysql); - if (show_warnings == 1 && warnings >= 1) /* Show warnings if any */ - { - init_pager(); +end: + + /* Show warnings if any or error occured */ + if (show_warnings == 1 && (warnings >= 1 || error)) print_warnings(); - end_pager(); - } if (!error && !status.batch && (mysql.server_status & SERVER_STATUS_DB_DROPPED)) @@ -2741,6 +2744,9 @@ static void print_warnings() MYSQL_RES *result; MYSQL_ROW cur; my_ulonglong num_rows; + + /* Save current error before calling "show warnings" */ + uint error= mysql_errno(&mysql); /* Get the warnings */ query= "show warnings"; @@ -2749,16 +2755,28 @@ static void print_warnings() /* Bail out when no warnings */ if (!(num_rows= mysql_num_rows(result))) - { - mysql_free_result(result); - return; - } + goto end; + + cur= mysql_fetch_row(result); + + /* + Don't print a duplicate of the current error. It is possible for SHOW + WARNINGS to return multiple errors with the same code, but different + messages. To be safe, skip printing the duplicate only if it is the only + warning. + */ + if (!cur || num_rows == 1 && error == (uint) strtoul(cur[1], NULL, 10)) + goto end; /* Print the warnings */ - while ((cur= mysql_fetch_row(result))) + init_pager(); + do { tee_fprintf(PAGER, "%s (Code %s): %s\n", cur[0], cur[1], cur[2]); - } + } while ((cur= mysql_fetch_row(result))); + end_pager(); + +end: mysql_free_result(result); } diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index fb2071ce10f..3350bfa17a7 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -206,6 +206,7 @@ static void dbDisconnect(char *host); static void DBerror(MYSQL *mysql, const char *when); static void safe_exit(int error); static void print_result(); +static uint fixed_name_length(const char *name); static char *fix_table_name(char *dest, char *src); int what_to_do = 0; @@ -438,14 +439,14 @@ static int process_selected_tables(char *db, char **table_names, int tables) { /* We need table list in form `a`, `b`, `c` - that's why we need 4 more chars added to to each table name + that's why we need 2 more chars added to to each table name space is for more readable output in logs and in case of error */ char *table_names_comma_sep, *end; int i, tot_length = 0; for (i = 0; i < tables; i++) - tot_length += strlen(*(table_names + i)) + 4; + tot_length+= fixed_name_length(*(table_names + i)) + 2; if (!(table_names_comma_sep = (char *) my_malloc((sizeof(char) * tot_length) + 4, MYF(MY_WME)))) @@ -463,23 +464,46 @@ static int process_selected_tables(char *db, char **table_names, int tables) } else for (; tables > 0; tables--, table_names++) - handle_request_for_tables(*table_names, strlen(*table_names)); + handle_request_for_tables(*table_names, fixed_name_length(*table_names)); return 0; } /* process_selected_tables */ -static char *fix_table_name(char *dest, char *src) +static uint fixed_name_length(const char *name) { - char *db_sep; + const char *p; + uint extra_length= 2; /* count the first/last backticks */ + + for (p= name; *p; p++) + { + if (*p == '`') + extra_length++; + else if (*p == '.') + extra_length+= 2; + } + return (p - name) + extra_length; +} + +static char *fix_table_name(char *dest, char *src) +{ *dest++= '`'; - if ((db_sep= strchr(src, '.'))) + for (; *src; src++) { - dest= strmake(dest, src, (uint) (db_sep - src)); - dest= strmov(dest, "`.`"); - src= db_sep + 1; + switch (*src) { + case '.': /* add backticks around '.' */ + *dest++= '`'; + *dest++= '.'; + *dest++= '`'; + break; + case '`': /* escape backtick character */ + *dest++= '`'; + /* fall through */ + default: + *dest++= *src; + } } - dest= strxmov(dest, src, "`", NullS); + *dest++= '`'; return dest; } @@ -500,7 +524,7 @@ static int process_all_tables_in_db(char *database) { /* We need table list in form `a`, `b`, `c` - that's why we need 4 more chars added to to each table name + that's why we need 2 more chars added to to each table name space is for more readable output in logs and in case of error */ @@ -508,7 +532,7 @@ static int process_all_tables_in_db(char *database) uint tot_length = 0; while ((row = mysql_fetch_row(res))) - tot_length += strlen(row[0]) + 4; + tot_length+= fixed_name_length(row[0]) + 2; mysql_data_seek(res, 0); if (!(tables=(char *) my_malloc(sizeof(char)*tot_length+4, MYF(MY_WME)))) @@ -533,10 +557,13 @@ static int process_all_tables_in_db(char *database) else { while ((row = mysql_fetch_row(res))) - /* Skip tables with an engine of NULL (probably a view). */ - if (row[1]) + /* + Skip tables with an engine of NULL (probably a view) + if we don't perform renaming. + */ + if (row[1] || what_to_do == DO_UPGRADE) { - handle_request_for_tables(row[0], strlen(row[0])); + handle_request_for_tables(row[0], fixed_name_length(row[0])); } } mysql_free_result(res); @@ -826,7 +853,7 @@ int main(int argc, char **argv) for (i = 0; i < tables4repair.elements ; i++) { char *name= (char*) dynamic_array_ptr(&tables4repair, i); - handle_request_for_tables(name, strlen(name)); + handle_request_for_tables(name, fixed_name_length(name)); } } end: diff --git a/client/mysqldump.c b/client/mysqldump.c index f5362b272cd..01b484e924e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -420,8 +420,12 @@ static struct my_option my_long_options[] = "Creates a consistent snapshot by dumping all tables in a single " "transaction. Works ONLY for tables stored in storage engines which " "support multiversioning (currently only InnoDB does); the dump is NOT " - "guaranteed to be consistent for other storage engines. Option " - "automatically turns off --lock-tables.", + "guaranteed to be consistent for other storage engines. " + "While a --single-transaction dump is in process, to ensure a valid " + "dump file (correct table contents and binary log position), no other " + "connection should use the following statements: ALTER TABLE, DROP " + "TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not " + "isolated from them. Option automatically turns off --lock-tables.", (uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.", diff --git a/client/mysqltest.c b/client/mysqltest.c index af08acc4422..18212430147 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2670,7 +2670,7 @@ void do_copy_file(struct st_command *command) command command handle DESCRIPTION - chmod_file <octal> <file_name> + chmod <octal> <file_name> Change file permission of <file_name> */ diff --git a/cmd-line-utils/readline/INSTALL b/cmd-line-utils/readline/INSTALL index cb4a06fb701..f360b9e7907 100644 --- a/cmd-line-utils/readline/INSTALL +++ b/cmd-line-utils/readline/INSTALL @@ -1,7 +1,7 @@ Basic Installation ================== -These are installation instructions for Readline-5.0. +These are installation instructions for Readline-5.2. The simplest way to compile readline is: @@ -238,6 +238,9 @@ SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library SHLIB_LIBS Any additional libraries that shared libraries should be linked against when they are created. +SHLIB_LIBPREF The prefix to use when generating the filename of the shared + library. The default is `lib'; Cygwin uses `cyg'. + SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when generating the filename of the shared library. Many systems use `so'; HP-UX uses `sl'. @@ -254,6 +257,17 @@ SHLIB_LIBVERSION The string to append to the filename to indicate the version numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems. Other Unix versions use different schemes. +SHLIB_DLLVERSION The version number for shared libraries that determines API + compatibility between readline versions and the underlying + system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but + can be overridden at configuration time by defining DLLVERSION + in the environment. + +SHLIB_DOT The character used to separate the name of the shared library + from the suffix and version information. The default is `.'; + systems like Cygwin which don't separate version information + from the library name should set this to the empty string. + SHLIB_STATUS Set this to `supported' when you have defined the other necessary variables. Make uses this to determine whether or not shared library creation should be attempted. If diff --git a/cmd-line-utils/readline/README b/cmd-line-utils/readline/README index ac4e3a767f9..8da99626aa1 100644 --- a/cmd-line-utils/readline/README +++ b/cmd-line-utils/readline/README @@ -1,7 +1,7 @@ Introduction ============ -This is the Gnu Readline library, version 5.0. +This is the Gnu Readline library, version 5.2. The Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both @@ -102,6 +102,9 @@ SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library SHLIB_LIBS Any additional libraries that shared libraries should be linked against when they are created. +SHLIB_LIBPREF The prefix to use when generating the filename of the shared + library. The default is `lib'; Cygwin uses `cyg'. + SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when generating the filename of the shared library. Many systems use `so'; HP-UX uses `sl'. @@ -118,6 +121,17 @@ SHLIB_LIBVERSION The string to append to the filename to indicate the version numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems. Other Unix versions use different schemes. +SHLIB_DLLVERSION The version number for shared libraries that determines API + compatibility between readline versions and the underlying + system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but + can be overridden at configuration time by defining DLLVERSION + in the environment. + +SHLIB_DOT The character used to separate the name of the shared library + from the suffix and version information. The default is `.'; + systems like Cygwin which don't separate version information + from the library name should set this to the empty string. + SHLIB_STATUS Set this to `supported' when you have defined the other necessary variables. Make uses this to determine whether or not shared library creation should be attempted. @@ -169,4 +183,4 @@ list (mirrored to the Usenet newsgroup gnu.bash.bug) often contains Readline bug reports and fixes. Chet Ramey -chet@po.cwru.edu +chet.ramey@case.edu diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index 568c3e8776a..08c906bfcc3 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -1,6 +1,6 @@ /* bind.c -- key binding and startup file support for the readline library. */ -/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1987-2006 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -26,7 +26,9 @@ # include <floss.h> #endif -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> #include <sys/types.h> @@ -75,6 +77,9 @@ static char *_rl_read_file PARAMS((char *, size_t *)); static void _rl_init_file_error PARAMS((const char *)); static int _rl_read_init_file PARAMS((const char *, int)); static int glean_key_from_name PARAMS((char *)); +static int find_boolean_var PARAMS((const char *)); + +static char *_rl_get_string_variable_value PARAMS((const char *)); static int substring_member_of_array PARAMS((char *, const char **)); static int currently_reading_init_file; @@ -337,10 +342,9 @@ rl_generic_bind (type, keyseq, data, map) KEYMAP_ENTRY k; k.function = 0; - k.type= 0; /* If no keys to bind to, exit right away. */ - if (!keyseq || !*keyseq) + if (keyseq == 0 || *keyseq == 0) { if (type == ISMACR) free (data); @@ -366,9 +370,12 @@ rl_generic_bind (type, keyseq, data, map) ic = uc; if (ic < 0 || ic >= KEYMAP_SIZE) - return -1; + { + free (keys); + return -1; + } - if (_rl_convert_meta_chars_to_ascii && META_CHAR (ic)) + if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) { ic = UNMETA (ic); if (map[ESC].type == ISKMAP) @@ -435,7 +442,7 @@ rl_translate_keyseq (seq, array, len) { register int i, c, l, temp; - for (i = l = 0; (c = seq[i]); i++) + for (i = l = 0; c = seq[i]; i++) { if (c == '\\') { @@ -458,8 +465,24 @@ rl_translate_keyseq (seq, array, len) } else if (c == 'M') { - i++; - array[l++] = ESC; /* ESC is meta-prefix */ + i++; /* seq[i] == '-' */ + /* XXX - obey convert-meta setting */ + if (_rl_convert_meta_chars_to_ascii && _rl_keymap[ESC].type == ISKMAP) + array[l++] = ESC; /* ESC is meta-prefix */ + else if (seq[i+1] == '\\' && seq[i+2] == 'C' && seq[i+3] == '-') + { + i += 4; + temp = (seq[i] == '?') ? RUBOUT : CTRL (_rl_to_upper (seq[i])); + array[l++] = META (temp); + } + else + { + /* This doesn't yet handle things like \M-\a, which may + or may not have any reasonable meaning. You're + probably better off using straight octal or hex. */ + i++; + array[l++] = META (seq[i]); + } } else if (c == 'C') { @@ -554,6 +577,11 @@ rl_untranslate_keyseq (seq) kseq[i++] = '-'; c = UNMETA (c); } + else if (c == ESC) + { + kseq[i++] = '\\'; + c = 'e'; + } else if (CTRL_CHAR (c)) { kseq[i++] = '\\'; @@ -602,7 +630,12 @@ _rl_untranslate_macro_value (seq) *r++ = '-'; c = UNMETA (c); } - else if (CTRL_CHAR (c) && c != ESC) + else if (c == ESC) + { + *r++ = '\\'; + c = 'e'; + } + else if (CTRL_CHAR (c)) { *r++ = '\\'; *r++ = 'C'; @@ -661,7 +694,7 @@ rl_function_of_keyseq (keyseq, map, type) { register int i; - if (!map) + if (map == 0) map = _rl_keymap; for (i = 0; keyseq && keyseq[i]; i++) @@ -670,25 +703,27 @@ rl_function_of_keyseq (keyseq, map, type) if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) { - if (map[ESC].type != ISKMAP) + if (map[ESC].type == ISKMAP) + { + map = FUNCTION_TO_KEYMAP (map, ESC); + ic = UNMETA (ic); + } + /* XXX - should we just return NULL here, since this obviously + doesn't match? */ + else { if (type) *type = map[ESC].type; return (map[ESC].function); } - else - { - map = FUNCTION_TO_KEYMAP (map, ESC); - ic = UNMETA (ic); - } } if (map[ic].type == ISKMAP) { /* If this is the last key in the key sequence, return the map. */ - if (!keyseq[i + 1]) + if (keyseq[i + 1] == '\0') { if (type) *type = ISKMAP; @@ -698,7 +733,12 @@ rl_function_of_keyseq (keyseq, map, type) else map = FUNCTION_TO_KEYMAP (map, ic); } - else + /* If we're not at the end of the key sequence, and the current key + is bound to something other than a keymap, then the entire key + sequence is not bound. */ + else if (map[ic].type != ISKMAP && keyseq[i+1]) + return ((rl_command_func_t *)NULL); + else /* map[ic].type != ISKMAP && keyseq[i+1] == 0 */ { if (type) *type = map[ic].type; @@ -736,8 +776,7 @@ _rl_read_file (filename, sizep) file_size = (size_t)finfo.st_size; /* check for overflow on very large files */ - if ((long long) file_size != (long long) finfo.st_size || - file_size + 1 < file_size) + if (file_size != finfo.st_size || file_size + 1 < file_size) { if (file >= 0) close (file); @@ -767,8 +806,8 @@ _rl_read_file (filename, sizep) /* Re-read the current keybindings file. */ int -rl_re_read_init_file (int count __attribute__((unused)), - int ignore __attribute__((unused))) +rl_re_read_init_file (count, ignore) + int count, ignore; { int r; r = rl_read_init_file ((const char *)NULL); @@ -781,6 +820,7 @@ rl_re_read_init_file (int count __attribute__((unused)), 1. the filename used for the previous call 2. the value of the shell variable `INPUTRC' 3. ~/.inputrc + 4. /etc/inputrc If the file existed and could be opened and read, 0 is returned, otherwise errno is returned. */ int @@ -789,17 +829,18 @@ rl_read_init_file (filename) { /* Default the filename. */ if (filename == 0) + filename = last_readline_init_file; + if (filename == 0) + filename = sh_get_env_value ("INPUTRC"); + if (filename == 0 || *filename == 0) { - filename = last_readline_init_file; - if (filename == 0) - filename = sh_get_env_value ("INPUTRC"); - if (filename == 0) - filename = DEFAULT_INPUTRC; + filename = DEFAULT_INPUTRC; + /* Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure */ + if (_rl_read_init_file (filename, 0) == 0) + return 0; + filename = SYS_INPUTRC; } - if (*filename == 0) - filename = DEFAULT_INPUTRC; - #if defined (__MSDOS__) if (_rl_read_init_file (filename, 0) == 0) return 0; @@ -989,7 +1030,8 @@ parser_if (args) /* Invert the current parser state if there is anything on the stack. */ static int -parser_else (char *args __attribute__((unused))) +parser_else (args) + char *args; { register int i; @@ -1019,7 +1061,8 @@ parser_else (char *args __attribute__((unused))) /* Terminate a conditional, popping the value of _rl_parsing_conditionalized_out from the stack. */ static int -parser_endif (char *args __attribute__((unused))) +parser_endif (args) + char *args; { if (if_stack_depth) _rl_parsing_conditionalized_out = if_stack[--if_stack_depth]; @@ -1142,7 +1185,7 @@ rl_parse_and_bind (string) { int passc = 0; - for (i = 1; (c = string[i]); i++) + for (i = 1; c = string[i]; i++) { if (passc) { @@ -1183,9 +1226,9 @@ rl_parse_and_bind (string) /* If this is a command to set a variable, then do that. */ if (_rl_stricmp (string, "set") == 0) { - char *var = string + i; - char *value; + char *var, *value, *e; + var = string + i; /* Make VAR point to start of variable name. */ while (*var && whitespace (*var)) var++; @@ -1196,6 +1239,20 @@ rl_parse_and_bind (string) *value++ = '\0'; while (*value && whitespace (*value)) value++; + /* Strip trailing whitespace from values to boolean variables. Temp + fix until I get a real quoted-string parser here. */ + i = find_boolean_var (var); + if (i >= 0) + { + /* remove trailing whitespace */ + e = value + strlen (value) - 1; + while (e >= value && whitespace (*e)) + e--; + e++; /* skip back to whitespace or EOS */ + if (*e && e >= value) + *e = '\0'; + } + rl_variable_bind (var, value); return 0; } @@ -1216,9 +1273,10 @@ rl_parse_and_bind (string) the quoted string delimiter, like the shell. */ if (*funname == '\'' || *funname == '"') { - int delimiter = string[i++], passc; + int delimiter, passc; - for (passc = 0; (c = string[i]); i++) + delimiter = string[i++]; + for (passc = 0; c = string[i]; i++) { if (passc) { @@ -1353,6 +1411,7 @@ static struct { int *value; int flags; } boolean_varlist [] = { + { "bind-tty-special-chars", &_rl_bind_stty_chars, 0 }, { "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL }, { "byte-oriented", &rl_byte_oriented, 0 }, { "completion-ignore-case", &_rl_completion_case_fold, 0 }, @@ -1377,7 +1436,7 @@ static struct { #if defined (VISIBLE_STATS) { "visible-stats", &rl_visible_stats, 0 }, #endif /* VISIBLE_STATS */ - { (char *)NULL, (int *)NULL, 0 } + { (char *)NULL, (int *)NULL } }; static int @@ -1446,7 +1505,7 @@ static struct { { "editing-mode", V_STRING, sv_editmode }, { "isearch-terminators", V_STRING, sv_isrchterm }, { "keymap", V_STRING, sv_keymap }, - { (char *)NULL, 0, 0 } + { (char *)NULL, 0 } }; static int @@ -1466,13 +1525,32 @@ find_string_var (name) values result in 0 (false). */ static int bool_to_int (value) -const char *value; + const char *value; { return (value == 0 || *value == '\0' || (_rl_stricmp (value, "on") == 0) || (value[0] == '1' && value[1] == '\0')); } +char * +rl_variable_value (name) + const char *name; +{ + register int i; + + /* Check for simple variables first. */ + i = find_boolean_var (name); + if (i >= 0) + return (*boolean_varlist[i].value ? "on" : "off"); + + i = find_string_var (name); + if (i >= 0) + return (_rl_get_string_variable_value (string_varlist[i].name)); + + /* Unknown variable names return NULL. */ + return 0; +} + int rl_variable_bind (name, value) const char *name, *value; @@ -1725,13 +1803,13 @@ char * rl_get_keymap_name_from_edit_mode () { if (rl_editing_mode == emacs_mode) - return (char*) "emacs"; + return "emacs"; #if defined (VI_MODE) else if (rl_editing_mode == vi_mode) - return (char*) "vi"; + return "vi"; #endif /* VI_MODE */ else - return (char*) "none"; + return "none"; } /* **************************************************************** */ @@ -1899,12 +1977,16 @@ rl_invoking_keyseqs_in_map (function, map) char *keyname = (char *)xmalloc (6 + strlen (seqs[i])); if (key == ESC) -#if 0 - sprintf (keyname, "\\e"); -#else - /* XXX - experimental */ - sprintf (keyname, "\\M-"); -#endif + { + /* If ESC is the meta prefix and we're converting chars + with the eighth bit set to ESC-prefixed sequences, then + we can use \M-. Otherwise we need to use the sequence + for ESC. */ + if (_rl_convert_meta_chars_to_ascii && map[ESC].type == ISKMAP) + sprintf (keyname, "\\M-"); + else + sprintf (keyname, "\\e"); + } else if (CTRL_CHAR (key)) sprintf (keyname, "\\C-%c", _rl_to_lower (UNCTRL (key))); else if (key == RUBOUT) @@ -1966,7 +2048,7 @@ rl_function_dumper (print_readably) fprintf (rl_outstream, "\n"); - for (i = 0; (name = names[i]); i++) + for (i = 0; name = names[i]; i++) { rl_command_func_t *function; char **invokers; @@ -2025,8 +2107,8 @@ rl_function_dumper (print_readably) rl_outstream. If an explicit argument is given, then print the output in such a way that it can be read back in. */ int -rl_dump_functions (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_dump_functions (count, key) + int count, key; { if (rl_dispatching) fprintf (rl_outstream, "\r\n"); @@ -2105,7 +2187,8 @@ rl_macro_dumper (print_readably) } int -rl_dump_macros(int count __attribute__((unused)), int key __attribute__((unused))) +rl_dump_macros (count, key) + int count, key; { if (rl_dispatching) fprintf (rl_outstream, "\r\n"); @@ -2114,12 +2197,67 @@ rl_dump_macros(int count __attribute__((unused)), int key __attribute__((unused) return (0); } +static char * +_rl_get_string_variable_value (name) + const char *name; +{ + static char numbuf[32]; + char *ret; + + if (_rl_stricmp (name, "bell-style") == 0) + { + switch (_rl_bell_preference) + { + case NO_BELL: + return "none"; + case VISIBLE_BELL: + return "visible"; + case AUDIBLE_BELL: + default: + return "audible"; + } + } + else if (_rl_stricmp (name, "comment-begin") == 0) + return (_rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT); + else if (_rl_stricmp (name, "completion-query-items") == 0) + { + sprintf (numbuf, "%d", rl_completion_query_items); + return (numbuf); + } + else if (_rl_stricmp (name, "editing-mode") == 0) + return (rl_get_keymap_name_from_edit_mode ()); + else if (_rl_stricmp (name, "isearch-terminators") == 0) + { + if (_rl_isearch_terminators == 0) + return 0; + ret = _rl_untranslate_macro_value (_rl_isearch_terminators); + if (ret) + { + strncpy (numbuf, ret, sizeof (numbuf) - 1); + free (ret); + numbuf[sizeof(numbuf) - 1] = '\0'; + } + else + numbuf[0] = '\0'; + return numbuf; + } + else if (_rl_stricmp (name, "keymap") == 0) + { + ret = rl_get_keymap_name (_rl_keymap); + if (ret == 0) + ret = rl_get_keymap_name_from_edit_mode (); + return (ret ? ret : "none"); + } + else + return (0); +} + void rl_variable_dumper (print_readably) int print_readably; { int i; - const char *kname; + char *v; for (i = 0; boolean_varlist[i].name; i++) { @@ -2131,70 +2269,24 @@ rl_variable_dumper (print_readably) *boolean_varlist[i].value ? "on" : "off"); } - /* bell-style */ - switch (_rl_bell_preference) - { - case NO_BELL: - kname = "none"; break; - case VISIBLE_BELL: - kname = "visible"; break; - case AUDIBLE_BELL: - default: - kname = "audible"; break; - } - if (print_readably) - fprintf (rl_outstream, "set bell-style %s\n", kname); - else - fprintf (rl_outstream, "bell-style is set to `%s'\n", kname); - - /* comment-begin */ - if (print_readably) - fprintf (rl_outstream, "set comment-begin %s\n", _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT); - else - fprintf (rl_outstream, "comment-begin is set to `%s'\n", _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT); - - /* completion-query-items */ - if (print_readably) - fprintf (rl_outstream, "set completion-query-items %d\n", rl_completion_query_items); - else - fprintf (rl_outstream, "completion-query-items is set to `%d'\n", rl_completion_query_items); - - /* editing-mode */ - if (print_readably) - fprintf (rl_outstream, "set editing-mode %s\n", (rl_editing_mode == emacs_mode) ? "emacs" : "vi"); - else - fprintf (rl_outstream, "editing-mode is set to `%s'\n", (rl_editing_mode == emacs_mode) ? "emacs" : "vi"); - - /* isearch-terminators */ - if (_rl_isearch_terminators) + for (i = 0; string_varlist[i].name; i++) { - char *disp; - - disp = _rl_untranslate_macro_value (_rl_isearch_terminators); - + v = _rl_get_string_variable_value (string_varlist[i].name); + if (v == 0) /* _rl_isearch_terminators can be NULL */ + continue; if (print_readably) - fprintf (rl_outstream, "set isearch-terminators \"%s\"\n", disp); + fprintf (rl_outstream, "set %s %s\n", string_varlist[i].name, v); else - fprintf (rl_outstream, "isearch-terminators is set to \"%s\"\n", disp); - - free (disp); + fprintf (rl_outstream, "%s is set to `%s'\n", string_varlist[i].name, v); } - - /* keymap */ - kname = rl_get_keymap_name (_rl_keymap); - if (kname == 0) - kname = rl_get_keymap_name_from_edit_mode (); - if (print_readably) - fprintf (rl_outstream, "set keymap %s\n", kname ? kname : "none"); - else - fprintf (rl_outstream, "keymap is set to `%s'\n", kname ? kname : "none"); } /* Print all of the current variables and their values to rl_outstream. If an explicit argument is given, then print the output in such a way that it can be read back in. */ int -rl_dump_variables(int count __attribute__((unused)), int key __attribute__((unused))) +rl_dump_variables (count, key) + int count, key; { if (rl_dispatching) fprintf (rl_outstream, "\r\n"); diff --git a/cmd-line-utils/readline/callback.c b/cmd-line-utils/readline/callback.c index 0807f137b92..ada04d8593b 100644 --- a/cmd-line-utils/readline/callback.c +++ b/cmd-line-utils/readline/callback.c @@ -1,6 +1,6 @@ /* callback.c -- functions to use readline as an X `callback' mechanism. */ -/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include "rlconf.h" @@ -41,10 +43,16 @@ #include "rldefs.h" #include "readline.h" #include "rlprivate.h" +#include "xmalloc.h" + +/* Private data for callback registration functions. See comments in + rl_callback_read_char for more details. */ +_rl_callback_func_t *_rl_callback_func = 0; +_rl_callback_generic_arg *_rl_callback_data = 0; /* **************************************************************** */ /* */ -/* Callback Readline Functions */ +/* Callback Readline Functions */ /* */ /* **************************************************************** */ @@ -70,7 +78,8 @@ _rl_callback_newline () { in_handler = 1; - (*rl_prep_term_function) (_rl_meta_flag); + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); #if defined (HANDLE_SIGNALS) rl_set_signals (); @@ -87,6 +96,7 @@ rl_callback_handler_install (prompt, linefunc) rl_vcpfunc_t *linefunc; { rl_set_prompt (prompt); + RL_SETSTATE (RL_STATE_CALLBACK); rl_linefunc = linefunc; _rl_callback_newline (); } @@ -96,7 +106,8 @@ void rl_callback_read_char () { char *line; - int eof; + int eof, jcode; + static procenv_t olevel; if (rl_linefunc == NULL) { @@ -104,16 +115,89 @@ rl_callback_read_char () abort (); } - eof = readline_internal_char (); + memcpy ((void *)olevel, (void *)readline_top_level, sizeof (procenv_t)); + jcode = setjmp (readline_top_level); + if (jcode) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + memcpy ((void *)readline_top_level, (void *)olevel, sizeof (procenv_t)); + return; + } - /* We loop in case some function has pushed input back with rl_execute_next. */ - for (;;) + do { + if (RL_ISSTATE (RL_STATE_ISEARCH)) + { + eof = _rl_isearch_callback (_rl_iscxt); + if (eof == 0 && (RL_ISSTATE (RL_STATE_ISEARCH) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING)) + rl_callback_read_char (); + + return; + } + else if (RL_ISSTATE (RL_STATE_NSEARCH)) + { + eof = _rl_nsearch_callback (_rl_nscxt); + return; + } + else if (RL_ISSTATE (RL_STATE_NUMERICARG)) + { + eof = _rl_arg_callback (_rl_argcxt); + if (eof == 0 && (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) && RL_ISSTATE (RL_STATE_INPUTPENDING)) + rl_callback_read_char (); + /* XXX - this should handle _rl_last_command_was_kill better */ + else if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) + _rl_internal_char_cleanup (); + + return; + } + else if (RL_ISSTATE (RL_STATE_MULTIKEY)) + { + eof = _rl_dispatch_callback (_rl_kscxt); /* For now */ + while ((eof == -1 || eof == -2) && RL_ISSTATE (RL_STATE_MULTIKEY) && _rl_kscxt && (_rl_kscxt->flags & KSEQ_DISPATCHED)) + eof = _rl_dispatch_callback (_rl_kscxt); + if (RL_ISSTATE (RL_STATE_MULTIKEY) == 0) + { + _rl_internal_char_cleanup (); + _rl_want_redisplay = 1; + } + } + else if (_rl_callback_func) + { + /* This allows functions that simply need to read an additional + character (like quoted-insert) to register a function to be + called when input is available. _rl_callback_data is simply a + pointer to a struct that has the argument count originally + passed to the registering function and space for any additional + parameters. */ + eof = (*_rl_callback_func) (_rl_callback_data); + /* If the function `deregisters' itself, make sure the data is + cleaned up. */ + if (_rl_callback_func == 0) + { + if (_rl_callback_data) + { + _rl_callback_data_dispose (_rl_callback_data); + _rl_callback_data = 0; + } + _rl_internal_char_cleanup (); + } + } + else + eof = readline_internal_char (); + + if (rl_done == 0 && _rl_want_redisplay) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + } + if (rl_done) { line = readline_internal_teardown (eof); - (*rl_deprep_term_function) (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); #if defined (HANDLE_SIGNALS) rl_clear_signals (); #endif @@ -129,11 +213,8 @@ rl_callback_read_char () if (in_handler == 0 && rl_linefunc) _rl_callback_newline (); } - if (rl_pending_input || _rl_pushed_input_available ()) - eof = readline_internal_char (); - else - break; } + while (rl_pending_input || _rl_pushed_input_available () || RL_ISSTATE (RL_STATE_MACROINPUT)); } /* Remove the handler, and make sure the terminal is in its normal state. */ @@ -141,14 +222,37 @@ void rl_callback_handler_remove () { rl_linefunc = NULL; + RL_UNSETSTATE (RL_STATE_CALLBACK); if (in_handler) { in_handler = 0; - (*rl_deprep_term_function) (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); #if defined (HANDLE_SIGNALS) rl_clear_signals (); #endif } } +_rl_callback_generic_arg * +_rl_callback_data_alloc (count) + int count; +{ + _rl_callback_generic_arg *arg; + + arg = (_rl_callback_generic_arg *)xmalloc (sizeof (_rl_callback_generic_arg)); + arg->count = count; + + arg->i1 = arg->i2 = 0; + + return arg; +} + +void _rl_callback_data_dispose (arg) + _rl_callback_generic_arg *arg; +{ + if (arg) + free (arg); +} + #endif diff --git a/cmd-line-utils/readline/chardefs.h b/cmd-line-utils/readline/chardefs.h index 04a3b7a8e9c..def3a111bd3 100644 --- a/cmd-line-utils/readline/chardefs.h +++ b/cmd-line-utils/readline/chardefs.h @@ -59,11 +59,7 @@ #define largest_char 255 /* Largest character value. */ #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0)) -#if largest_char >= 255 -#define META_CHAR(c) ((c) > meta_character_threshold) -#else #define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char) -#endif #define CTRL(c) ((c) & control_character_mask) #define META(c) ((c) | meta_character_bit) @@ -90,6 +86,8 @@ /* Some systems define these; we want our definitions. */ #undef ISPRINT +/* Beware: these only work with single-byte ASCII characters. */ + #define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c)) #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c)) #define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) diff --git a/cmd-line-utils/readline/compat.c b/cmd-line-utils/readline/compat.c index e4fbc322cee..a66d210fd2e 100644 --- a/cmd-line-utils/readline/compat.c +++ b/cmd-line-utils/readline/compat.c @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c index 526c1edb33d..a0232b2afdf 100644 --- a/cmd-line-utils/readline/complete.c +++ b/cmd-line-utils/readline/complete.c @@ -1,6 +1,6 @@ /* complete.c -- filename completion for readline. */ -/* Copyright (C) 1987-2004 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,18 +21,12 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) -#define _XOPEN_SOURCE 500 +#if defined (HAVE_CONFIG_H) +# include <config.h> #endif -#include "config_readline.h" - #include <sys/types.h> - -/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ - #include <fcntl.h> - /* FreeBSD 5.3 will not declare u_int in sys/types.h, file.h needs it */ #if defined (HAVE_SYS_FILE_H) && !defined(__FreeBSD__) # include <sys/file.h> @@ -55,7 +49,9 @@ extern int errno; #endif /* !errno */ +#if defined (HAVE_PWD_H) #include <pwd.h> +#endif #include "posixdir.h" #include "posixstat.h" @@ -86,9 +82,9 @@ typedef int QSFUNC (); /* Most systems don't declare getpwent in <pwd.h> if _POSIX_SOURCE is defined. */ -#if !defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE) +#if defined (HAVE_GETPWENT) && (!defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE)) extern struct passwd *getpwent PARAMS((void)); -#endif /* !HAVE_GETPW_DECLS || _POSIX_SOURCE */ +#endif /* HAVE_GETPWENT && (!HAVE_GETPW_DECLS || _POSIX_SOURCE) */ /* If non-zero, then this is the address of a function to call when completing a word would normally display the list of possible matches. @@ -213,7 +209,8 @@ int rl_completion_type = 0; /* Up to this many items will be displayed in response to a possible-completions call. After that, we ask the user if - she is sure she wants to see them all. */ + she is sure she wants to see them all. A negative value means + don't ask. */ int rl_completion_query_items = 100; int _rl_page_completions = 1; @@ -361,15 +358,15 @@ rl_complete (ignore, invoking_key) /* List the possible completions. See description of rl_complete (). */ int -rl_possible_completions (int ignore __attribute__((unused)), - int invoking_key __attribute__((unused))) +rl_possible_completions (ignore, invoking_key) + int ignore, invoking_key; { return (rl_complete_internal ('?')); } int -rl_insert_completions (int ignore __attribute__((unused)), - int invoking_key __attribute__((unused))) +rl_insert_completions (ignore, invoking_key) + int ignore, invoking_key; { return (rl_complete_internal ('*')); } @@ -628,6 +625,8 @@ fnprint (to_print) mbstate_t ps; const char *end; size_t tlen; + int width, w; + wchar_t wc; end = to_print + strlen (to_print) + 1; memset (&ps, 0, sizeof (mbstate_t)); @@ -660,21 +659,28 @@ fnprint (to_print) else { #if defined (HANDLE_MULTIBYTE) - tlen = mbrlen (s, end - s, &ps); + tlen = mbrtowc (&wc, s, end - s, &ps); if (MB_INVALIDCH (tlen)) { tlen = 1; + width = 1; memset (&ps, 0, sizeof (mbstate_t)); } else if (MB_NULLWCH (tlen)) break; + else + { + w = wcwidth (wc); + width = (w >= 0) ? w : 1; + } fwrite (s, 1, tlen, rl_outstream); s += tlen; + printed_len += width; #else putc (*s, rl_outstream); s++; -#endif printed_len++; +#endif } } @@ -690,7 +696,7 @@ print_filename (to_print, full_pathname) char *to_print, *full_pathname; { int printed_len, extension_char, slen, tlen; - char *s, c, *new_full_pathname; + char *s, c, *new_full_pathname, *dn; extension_char = 0; printed_len = fnprint (to_print); @@ -715,7 +721,17 @@ print_filename (to_print, full_pathname) files in the root directory. If we pass a null string to the bash directory completion hook, for example, it will expand it to the current directory. We just want the `/'. */ - s = tilde_expand (full_pathname && *full_pathname ? full_pathname : "/"); + if (full_pathname == 0 || *full_pathname == 0) + dn = "/"; + else if (full_pathname[0] != '/') + dn = full_pathname; + else if (full_pathname[1] == 0) + dn = "//"; /* restore trailing slash to `//' */ + else if (full_pathname[1] == '/' && full_pathname[2] == 0) + dn = "/"; /* don't turn /// into // */ + else + dn = full_pathname; + s = tilde_expand (dn); if (rl_directory_completion_hook) (*rl_directory_completion_hook) (&s); @@ -723,6 +739,10 @@ print_filename (to_print, full_pathname) tlen = strlen (to_print); new_full_pathname = (char *)xmalloc (slen + tlen + 2); strcpy (new_full_pathname, s); + if (s[slen - 1] == '/') + slen--; + else + new_full_pathname[slen] = '/'; new_full_pathname[slen] = '/'; strcpy (new_full_pathname + slen + 1, to_print); @@ -761,7 +781,10 @@ print_filename (to_print, full_pathname) } static char * -rl_quote_filename (char *s, int rtype __attribute__((unused)), char *qcp) +rl_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; { char *r; @@ -811,14 +834,7 @@ _rl_find_completion_word (fp, dp) quote substrings for the completer. Try to find the start of an unclosed quoted substring. */ /* FOUND_QUOTE is set so we know what kind of quotes we found. */ -#if defined (HANDLE_MULTIBYTE) - for (scan = pass_next = 0; scan < end; - scan = ((MB_CUR_MAX == 1 || rl_byte_oriented) - ? (scan + 1) - : _rl_find_next_mbchar (rl_line_buffer, scan, 1, MB_FIND_ANY))) -#else - for (scan = pass_next = 0; scan < end; scan++) -#endif + for (scan = pass_next = 0; scan < end; scan = MB_NEXTCHAR (rl_line_buffer, scan, 1, MB_FIND_ANY)) { if (pass_next) { @@ -868,11 +884,7 @@ _rl_find_completion_word (fp, dp) /* We didn't find an unclosed quoted substring upon which to do completion, so use the word break characters to find the substring on which to complete. */ -#if defined (HANDLE_MULTIBYTE) - while ((rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY))) -#else - while (--rl_point) -#endif + while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) { scan = rl_line_buffer[rl_point]; @@ -939,7 +951,7 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char) rl_compentry_func_t *our_func; int found_quote, quote_char; { - char **matches, *temp; + char **matches; rl_completion_found_quote = found_quote; rl_completion_quote_character = quote_char; @@ -958,21 +970,9 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char) } } - /* Beware -- we're stripping the quotes here. Do this only if we know - we are doing filename completion and the application has defined a - filename dequoting function. */ - temp = (char *)NULL; - - if (found_quote && our_func == rl_filename_completion_function && - rl_filename_dequoting_function) - { - /* delete single and double quotes */ - temp = (*rl_filename_dequoting_function) (text, quote_char); - text = temp; /* not freeing text is not a memory leak */ - } + /* XXX -- filename dequoting moved into rl_filename_completion_function */ matches = rl_completion_matches (text, our_func); - FREE (temp); return matches; } @@ -1105,7 +1105,8 @@ compute_lcd_of_matches (match_list, matches, text) #if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) { - mbstate_t ps_back = ps1; + mbstate_t ps_back; + ps_back = ps1; if (!_rl_compare_chars (match_list[i], si, &ps1, match_list[i+1], si, &ps2)) break; else if ((v = _rl_get_char_len (&match_list[i][si], &ps_back)) > 1) @@ -1155,8 +1156,7 @@ compute_lcd_of_matches (match_list, matches, text) rl_completion_found_quote && rl_filename_quoting_desired) { - dtext = (*rl_filename_dequoting_function) - ((char*) text, rl_completion_quote_character); + dtext = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); text = dtext; } @@ -1402,7 +1402,7 @@ display_matches (matches) /* If there are many items, then ask the user if she really wants to see them all. */ - if (len >= rl_completion_query_items) + if (rl_completion_query_items > 0 && len >= rl_completion_query_items) { rl_crlf (); fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len); @@ -1539,7 +1539,7 @@ append_to_match (text, delimiter, quote_char, nontrivial_match) : stat (filename, &finfo); if (s == 0 && S_ISDIR (finfo.st_mode)) { - if (_rl_complete_mark_directories) + if (_rl_complete_mark_directories /* && rl_completion_suppress_append == 0 */) { /* This is clumsy. Avoid putting in a double slash if point is at the end of the line and the previous character is a @@ -1803,7 +1803,7 @@ rl_completion_matches (text, entry_function) match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); match_list[1] = (char *)NULL; - while ((string = (*entry_function) (text, matches))) + while (string = (*entry_function) (text, matches)) { if (matches + 1 == match_list_size) match_list = (char **)xrealloc @@ -1853,16 +1853,20 @@ rl_username_completion_function (text, state) setpwent (); } - while ((entry = getpwent ())) +#if defined (HAVE_GETPWENT) + while (entry = getpwent ()) { /* Null usernames should result in all users as possible completions. */ if (namelen == 0 || (STREQN (username, entry->pw_name, namelen))) break; } +#endif if (entry == 0) { +#if defined (HAVE_GETPWENT) endpwent (); +#endif return ((char *)NULL); } else @@ -1960,13 +1964,30 @@ rl_filename_completion_function (text, state) if (rl_directory_rewrite_hook) (*rl_directory_rewrite_hook) (&dirname); + /* The directory completion hook should perform any necessary + dequoting. */ if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname)) { free (users_dirname); users_dirname = savestring (dirname); } - + else if (rl_completion_found_quote && rl_filename_dequoting_function) + { + /* delete single and double quotes */ + temp = (*rl_filename_dequoting_function) (users_dirname, rl_completion_quote_character); + free (users_dirname); + users_dirname = temp; + } directory = opendir (dirname); + + /* Now dequote a non-null filename. */ + if (filename && *filename && rl_completion_found_quote && rl_filename_dequoting_function) + { + /* delete single and double quotes */ + temp = (*rl_filename_dequoting_function) (filename, rl_completion_quote_character); + free (filename); + filename = temp; + } filename_len = strlen (filename); rl_filename_completion_desired = 1; @@ -2089,7 +2110,8 @@ rl_filename_completion_function (text, state) hit the end of the match list, we restore the original unmatched text, ring the bell, and reset the counter to zero. */ int -rl_menu_complete (int count, int ignore __attribute__((unused))) +rl_menu_complete (count, ignore) + int count, ignore; { rl_compentry_func_t *our_func; int matching_filenames, found_quote; @@ -2173,9 +2195,11 @@ rl_menu_complete (int count, int ignore __attribute__((unused))) return (0); } - match_list_index = (match_list_index + count) % match_list_size; + match_list_index += count; if (match_list_index < 0) match_list_index += match_list_size; + else + match_list_index %= match_list_size; if (match_list_index == 0 && match_list_size > 1) { diff --git a/cmd-line-utils/readline/configure.in b/cmd-line-utils/readline/configure.in index 31e17606024..868773be696 100644 --- a/cmd-line-utils/readline/configure.in +++ b/cmd-line-utils/readline/configure.in @@ -4,9 +4,27 @@ dnl dnl report bugs to chet@po.cwru.edu dnl dnl Process this file with autoconf to produce a configure script. -AC_REVISION([for Readline 5.0, version 2.52, from autoconf version] AC_ACVERSION) -AC_INIT(readline, 5.0-rc1, bug-readline@gnu.org) +# Copyright (C) 1987-2005 Free Software Foundation, Inc. + +# 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; either version 2, or (at your option) +# any later version. + +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_REVISION([for Readline 5.2, version 2.61]) + +AC_INIT(readline, 5.2, bug-readline@gnu.org) dnl make sure we are using a recent autoconf version AC_PREREQ(2.50) @@ -16,20 +34,28 @@ AC_CONFIG_AUX_DIR(./support) AC_CONFIG_HEADERS(config.h) dnl update the value of RL_READLINE_VERSION in readline.h when this changes -LIBVERSION=5.0 +LIBVERSION=5.2 AC_CANONICAL_HOST dnl configure defaults opt_curses=no +opt_purify=no dnl arguments to configure AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) +AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval) if test "$opt_curses" = "yes"; then prefer_curses=yes fi +if test "$opt_purify" = yes; then + PURIFY="purify" +else + PURIFY= +fi + dnl option parsing for optional features opt_multibyte=yes opt_static_libs=yes @@ -43,6 +69,36 @@ if test $opt_multibyte = no; then AC_DEFINE(NO_MULTIBYTE_SUPPORT) fi +dnl load up the cross-building cache file -- add more cases and cache +dnl files as necessary + +dnl Note that host and target machine are the same, and different than the +dnl build machine. + +CROSS_COMPILE= +if test "x$cross_compiling" = "xyes"; then + case "${host}" in + *-cygwin*) + cross_cache=${srcdir}/cross-build/cygwin.cache + ;; + *-mingw*) + cross_cache=${srcdir}/cross-build/mingw.cache + ;; + i[[3456]]86-*-beos*) + cross_cache=${srcdir}/cross-build/x86-beos.cache + ;; + *) echo "configure: cross-compiling for $host is not supported" >&2 + ;; + esac + if test -n "${cross_cache}" && test -r "${cross_cache}"; then + echo "loading cross-build cache file ${cross_cache}" + . ${cross_cache} + fi + unset cross_cache + CROSS_COMPILE='-DCROSS_COMPILING' + AC_SUBST(CROSS_COMPILE) +fi + echo "" echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}" echo "" @@ -83,14 +139,24 @@ AC_HEADER_STDC AC_HEADER_STAT AC_HEADER_DIRENT -AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \ - strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit) +AC_CHECK_FUNCS(fcntl kill lstat) +AC_CHECK_FUNCS(memmove putenv select setenv setlocale \ + strcasecmp strpbrk tcgetattr vsnprintf) +AC_CHECK_FUNCS(isascii isxdigit) +AC_CHECK_FUNCS(getpwent getpwnam getpwuid) AC_FUNC_STRCOLL -AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \ - limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \ - termcap.h termios.h termio.h sys/file.h locale.h memory.h ) +AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \ + limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h) +AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h) + +AC_CHECK_HEADERS(sys/ptem.h,,, +[[ +#if HAVE_SYS_STREAM_H +# include <sys/stream.h> +#endif +]]) BASH_SYS_SIGNAL_VINTAGE BASH_SYS_REINSTALL_SIGHANDLERS @@ -143,7 +209,13 @@ esac # if test -f ${srcdir}/support/shobj-conf; then AC_MSG_CHECKING(configuration for building shared libraries) - eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` + eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` + +# case "$SHLIB_LIBS" in +# *curses*|*termcap*|*termlib*) ;; +# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; +# esac + AC_SUBST(SHOBJ_CC) AC_SUBST(SHOBJ_CFLAGS) AC_SUBST(SHOBJ_LD) @@ -153,8 +225,11 @@ if test -f ${srcdir}/support/shobj-conf; then AC_SUBST(SHOBJ_STATUS) AC_SUBST(SHLIB_STATUS) AC_SUBST(SHLIB_XLDFLAGS) + AC_SUBST(SHLIB_DOT) + AC_SUBST(SHLIB_LIBPREF) AC_SUBST(SHLIB_LIBSUFF) AC_SUBST(SHLIB_LIBVERSION) + AC_SUBST(SHLIB_DLLVERSION) AC_SUBST(SHLIB_LIBS) AC_MSG_RESULT($SHLIB_STATUS) @@ -191,6 +266,12 @@ msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file *) BUILD_DIR=`pwd` ;; esac +case "$BUILD_DIR" in +*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;; +*) ;; +esac + +AC_SUBST(PURIFY) AC_SUBST(BUILD_DIR) AC_SUBST(CFLAGS) diff --git a/cmd-line-utils/readline/display.c b/cmd-line-utils/readline/display.c index 06cac3bfd32..47ff0615974 100644 --- a/cmd-line-utils/readline/display.c +++ b/cmd-line-utils/readline/display.c @@ -1,6 +1,6 @@ /* display.c -- readline redisplay facility. */ -/* Copyright (C) 1987-2004 Free Software Foundation, Inc. +/* Copyright (C) 1987-2006 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,16 +21,12 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE 500 +#if defined (HAVE_CONFIG_H) +# include <config.h> #endif -#include "config_readline.h" - #include <sys/types.h> -/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ - #if defined (HAVE_UNISTD_H) # include <unistd.h> #endif /* HAVE_UNISTD_H */ @@ -63,10 +59,6 @@ extern char *strchr (), *strrchr (); #endif /* !strchr && !__STDC__ */ -#if defined (HACK_TERMCAP_MOTION) -extern char *_rl_term_forward_char; -#endif - static void update_line PARAMS((char *, char *, int, int, int, int)); static void space_to_eol PARAMS((int)); static void delete_chars PARAMS((int)); @@ -84,9 +76,18 @@ static int *inv_lbreaks, *vis_lbreaks; static int inv_lbsize, vis_lbsize; /* Heuristic used to decide whether it is faster to move from CUR to NEW - by backing up or outputting a carriage return and moving forward. */ + by backing up or outputting a carriage return and moving forward. CUR + and NEW are either both buffer positions or absolute screen positions. */ #define CR_FASTER(new, cur) (((new) + 1) < ((cur) - (new))) +/* _rl_last_c_pos is an absolute cursor position in multibyte locales and a + buffer index in others. This macro is used when deciding whether the + current cursor position is in the middle of a prompt string containing + invisible characters. */ +#define PROMPT_ENDING_INDEX \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) ? prompt_physical_chars : prompt_last_invisible+1) + + /* **************************************************************** */ /* */ /* Display stuff */ @@ -122,16 +123,25 @@ rl_voidfunc_t *rl_redisplay_function = rl_redisplay; int rl_display_fixed = 0; int _rl_suppress_redisplay = 0; +int _rl_want_redisplay = 0; /* The stuff that gets printed out before the actual text of the line. This is usually pointing to rl_prompt. */ char *rl_display_prompt = (char *)NULL; /* Pseudo-global variables declared here. */ + /* The visible cursor position. If you print some text, adjust this. */ +/* NOTE: _rl_last_c_pos is used as a buffer index when not in a locale + supporting multibyte characters, and an absolute cursor position when + in such a locale. This is an artifact of the donated multibyte support. + Care must be taken when modifying its value. */ int _rl_last_c_pos = 0; int _rl_last_v_pos = 0; +static int cpos_adjusted; +static int cpos_buffer_position; + /* Number of lines currently on screen minus 1. */ int _rl_vis_botlin = 0; @@ -158,6 +168,7 @@ static int line_size = 1024; include invisible characters. */ static char *local_prompt, *local_prompt_prefix; +static int local_prompt_len; static int prompt_visible_length, prompt_prefix_length; /* The number of invisible characters in the line currently being @@ -184,6 +195,19 @@ static int prompt_last_screen_line; static int prompt_physical_chars; +/* Variables to save and restore prompt and display information. */ + +/* These are getting numerous enough that it's time to create a struct. */ + +static char *saved_local_prompt; +static char *saved_local_prefix; +static int saved_last_invisible; +static int saved_visible_length; +static int saved_prefix_length; +static int saved_local_length; +static int saved_invis_chars_first_line; +static int saved_physical_chars; + /* Expand the prompt string S and return the number of visible characters in *LP, if LP is not null. This is currently more-or-less a placeholder for expansion. LIP, if non-null is a place to store the @@ -204,8 +228,8 @@ expand_prompt (pmt, lp, lip, niflp, vlp) char *pmt; int *lp, *lip, *niflp, *vlp; { - char *r, *ret, *p; - int l, rl, last, ignoring, ninvis, invfl, ind, pind, physchars; + char *r, *ret, *p, *igstart; + int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars; /* Short-circuit if we can. */ if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0) @@ -218,7 +242,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp) if (niflp) *niflp = 0; if (vlp) - *vlp = lp ? *lp : (int) strlen (r); + *vlp = lp ? *lp : strlen (r); return r; } @@ -226,20 +250,24 @@ expand_prompt (pmt, lp, lip, niflp, vlp) r = ret = (char *)xmalloc (l + 1); invfl = 0; /* invisible chars in first line of prompt */ + invflset = 0; /* we only want to set invfl once */ + igstart = 0; for (rl = ignoring = last = ninvis = physchars = 0, p = pmt; p && *p; p++) { /* This code strips the invisible character string markers RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE */ - if (*p == RL_PROMPT_START_IGNORE) + if (ignoring == 0 && *p == RL_PROMPT_START_IGNORE) /* XXX - check ignoring? */ { - ignoring++; + ignoring = 1; + igstart = p; continue; } else if (ignoring && *p == RL_PROMPT_END_IGNORE) { ignoring = 0; - last = r - ret - 1; + if (p != (igstart + 1)) + last = r - ret - 1; continue; } else @@ -253,7 +281,10 @@ expand_prompt (pmt, lp, lip, niflp, vlp) while (l--) *r++ = *p++; if (!ignoring) - rl += ind - pind; + { + rl += ind - pind; + physchars += _rl_col_width (pmt, pind, ind); + } else ninvis += ind - pind; p--; /* compensate for later increment */ @@ -263,16 +294,19 @@ expand_prompt (pmt, lp, lip, niflp, vlp) { *r++ = *p; if (!ignoring) - rl++; /* visible length byte counter */ + { + rl++; /* visible length byte counter */ + physchars++; + } else ninvis++; /* invisible chars byte counter */ } - if (rl >= _rl_screenwidth) - invfl = ninvis; - - if (ignoring == 0) - physchars++; + if (invflset == 0 && rl >= _rl_screenwidth) + { + invfl = ninvis; + invflset = 1; + } } } @@ -332,7 +366,9 @@ rl_expand_prompt (prompt) FREE (local_prompt_prefix); local_prompt = local_prompt_prefix = (char *)0; - prompt_last_invisible = prompt_visible_length = 0; + local_prompt_len = 0; + prompt_last_invisible = prompt_invis_chars_first_line = 0; + prompt_visible_length = prompt_physical_chars = 0; if (prompt == 0 || *prompt == 0) return (0); @@ -346,6 +382,7 @@ rl_expand_prompt (prompt) &prompt_invis_chars_first_line, &prompt_physical_chars); local_prompt_prefix = (char *)0; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; return (prompt_visible_length); } else @@ -355,15 +392,16 @@ rl_expand_prompt (prompt) local_prompt = expand_prompt (p, &prompt_visible_length, &prompt_last_invisible, (int *)NULL, - (int *)NULL); + &prompt_physical_chars); c = *t; *t = '\0'; /* The portion of the prompt string up to and including the final newline is now null-terminated. */ local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length, (int *)NULL, &prompt_invis_chars_first_line, - &prompt_physical_chars); + (int *)NULL); *t = c; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; return (prompt_prefix_length); } } @@ -420,13 +458,13 @@ rl_redisplay () { register int in, out, c, linenum, cursor_linenum; register char *line; - int c_pos, inv_botlin, lb_botlin, lb_linenum; - int newlines, lpos, temp, modmark; + int inv_botlin, lb_botlin, lb_linenum, o_cpos; + int newlines, lpos, temp, modmark, n0, num; char *prompt_this_line; #if defined (HANDLE_MULTIBYTE) wchar_t wc; size_t wc_bytes; - int wc_width= 0; + int wc_width; mbstate_t ps; int _rl_wrapped_multicolumn = 0; #endif @@ -435,16 +473,16 @@ rl_redisplay () return; if (!rl_display_prompt) - rl_display_prompt = (char*) ""; + rl_display_prompt = ""; - if (invisible_line == 0) + if (invisible_line == 0 || vis_lbreaks == 0) { init_line_structures (0); rl_on_new_line (); } /* Draw the line into the buffer. */ - c_pos = -1; + cpos_buffer_position = -1; line = invisible_line; out = inv_botlin = 0; @@ -471,24 +509,23 @@ rl_redisplay () number of non-visible characters in the prompt string. */ if (rl_display_prompt == rl_prompt || local_prompt) { - int local_len = local_prompt ? strlen (local_prompt) : 0; if (local_prompt_prefix && forced_display) _rl_output_some_chars (local_prompt_prefix, strlen (local_prompt_prefix)); - if (local_len > 0) + if (local_prompt_len > 0) { - temp = local_len + out + 2; + temp = local_prompt_len + out + 2; if (temp >= line_size) { line_size = (temp + 1024) - (temp % 1024); visible_line = (char *)xrealloc (visible_line, line_size); line = invisible_line = (char *)xrealloc (invisible_line, line_size); } - strncpy (line + out, local_prompt, local_len); - out += local_len; + strncpy (line + out, local_prompt, local_prompt_len); + out += local_prompt_len; } line[out] = '\0'; - wrap_offset = local_len - prompt_visible_length; + wrap_offset = local_prompt_len - prompt_visible_length; } else { @@ -524,17 +561,6 @@ rl_redisplay () wrap_offset = prompt_invis_chars_first_line = 0; } -#if defined (HANDLE_MULTIBYTE) -#define CHECK_INV_LBREAKS() \ - do { \ - if (newlines >= (inv_lbsize - 2)) \ - { \ - inv_lbsize *= 2; \ - inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ - _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \ - } \ - } while (0) -#else #define CHECK_INV_LBREAKS() \ do { \ if (newlines >= (inv_lbsize - 2)) \ @@ -543,7 +569,6 @@ rl_redisplay () inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \ } \ } while (0) -#endif #if defined (HANDLE_MULTIBYTE) #define CHECK_LPOS() \ @@ -589,6 +614,7 @@ rl_redisplay () #if defined (HANDLE_MULTIBYTE) memset (_rl_wrapped_line, 0, vis_lbsize); + num = 0; #endif /* prompt_invis_chars_first_line is the number of invisible characters in @@ -600,6 +626,7 @@ rl_redisplay () contents of the command line? */ while (lpos >= _rl_screenwidth) { + int z; /* fix from Darin Johnson <darin@acuson.com> for prompt string with invisible characters that is longer than the screen width. The prompt_invis_chars_first_line variable could be made into an array @@ -607,19 +634,47 @@ rl_redisplay () probably too much work for the benefit gained. How many people have prompts that exceed two physical lines? Additional logic fix from Edward Catmur <ed@catmur.co.uk> */ - temp = ((newlines + 1) * _rl_screenwidth) + - ((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line - : ((newlines == 1) ? wrap_offset : 0)) - : ((newlines == 0) ? wrap_offset :0)); +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + n0 = num; + temp = local_prompt_len; + while (num < temp) + { + z = _rl_col_width (local_prompt, n0, num); + if (z > _rl_screenwidth) + { + num = _rl_find_prev_mbchar (local_prompt, num, MB_FIND_ANY); + break; + } + else if (z == _rl_screenwidth) + break; + num++; + } + temp = num; + } + else +#endif /* !HANDLE_MULTIBYTE */ + temp = ((newlines + 1) * _rl_screenwidth); + + /* Now account for invisible characters in the current line. */ + temp += ((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line + : ((newlines == 1) ? wrap_offset : 0)) + : ((newlines == 0) ? wrap_offset :0)); inv_lbreaks[++newlines] = temp; - lpos -= _rl_screenwidth; +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + lpos -= _rl_col_width (local_prompt, n0, num); + else +#endif + lpos -= _rl_screenwidth; } prompt_last_screen_line = newlines; /* Draw the rest of the line (after the prompt) into invisible_line, keeping - track of where the cursor is (c_pos), the number of the line containing + track of where the cursor is (cpos_buffer_position), the number of the line containing the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin). It maintains an array of line breaks for display (inv_lbreaks). This handles expanding tabs for display and displaying meta characters. */ @@ -672,7 +727,7 @@ rl_redisplay () if (in == rl_point) { - c_pos = out; + cpos_buffer_position = out; lb_linenum = newlines; } @@ -766,10 +821,10 @@ rl_redisplay () } if (in == rl_point) { - c_pos = out; + cpos_buffer_position = out; lb_linenum = newlines; } - for (i = in; i < (int) (in+wc_bytes); i++) + for (i = in; i < in+wc_bytes; i++) line[out++] = rl_line_buffer[i]; for (i = 0; i < wc_width; i++) CHECK_LPOS(); @@ -797,9 +852,9 @@ rl_redisplay () } line[out] = '\0'; - if (c_pos < 0) + if (cpos_buffer_position < 0) { - c_pos = out; + cpos_buffer_position = out; lb_linenum = newlines; } @@ -808,7 +863,7 @@ rl_redisplay () inv_lbreaks[newlines+1] = out; cursor_linenum = lb_linenum; - /* C_POS == position in buffer where cursor should be placed. + /* CPOS_BUFFER_POSITION == position in buffer where cursor should be placed. CURSOR_LINENUM == line number where the cursor should be placed. */ /* PWP: now is when things get a bit hairy. The visible and invisible @@ -822,7 +877,7 @@ rl_redisplay () if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up) { - int nleft, pos, changed_screen_line; + int nleft, pos, changed_screen_line, tx; if (!rl_display_fixed || forced_display) { @@ -847,15 +902,38 @@ rl_redisplay () #define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l])) #define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l]) #define VIS_CHARS(line) (visible_line + vis_lbreaks[line]) -#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? (char*) "" : VIS_CHARS(line) +#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line) #define INV_LINE(line) (invisible_line + inv_lbreaks[line]) /* For each line in the buffer, do the updating display. */ for (linenum = 0; linenum <= inv_botlin; linenum++) { + /* This can lead us astray if we execute a program that changes + the locale from a non-multibyte to a multibyte one. */ + o_cpos = _rl_last_c_pos; + cpos_adjusted = 0; update_line (VIS_LINE(linenum), INV_LINE(linenum), linenum, VIS_LLEN(linenum), INV_LLEN(linenum), inv_botlin); + /* update_line potentially changes _rl_last_c_pos, but doesn't + take invisible characters into account, since _rl_last_c_pos + is an absolute cursor position in a multibyte locale. See + if compensating here is the right thing, or if we have to + change update_line itself. There is one case in which + update_line adjusts _rl_last_c_pos itself (so it can pass + _rl_move_cursor_relative accurate values); it communicates + this back by setting cpos_adjusted. If we assume that + _rl_last_c_pos is correct (an absolute cursor position) each + time update_line is called, then we can assume in our + calculations that o_cpos does not need to be adjusted by + wrap_offset. */ + if (linenum == 0 && (MB_CUR_MAX > 1 && rl_byte_oriented == 0) && + cpos_adjusted == 0 && + _rl_last_c_pos != o_cpos && + _rl_last_c_pos > wrap_offset && + o_cpos < prompt_last_invisible) + _rl_last_c_pos -= wrap_offset; + /* If this is the line with the prompt, we might need to compensate for invisible characters in the new line. Do this only if there is not more than one new line (which @@ -867,7 +945,10 @@ rl_redisplay () (wrap_offset > visible_wrap_offset) && (_rl_last_c_pos < visible_first_line_len)) { - nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + nleft = _rl_screenwidth - _rl_last_c_pos; + else + nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos; if (nleft) _rl_clear_to_eol (nleft); } @@ -888,7 +969,7 @@ rl_redisplay () _rl_move_vert (linenum); _rl_move_cursor_relative (0, tt); _rl_clear_to_eol - ((linenum == _rl_vis_botlin) ? (int) strlen (tt) : _rl_screenwidth); + ((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth); } } _rl_vis_botlin = inv_botlin; @@ -903,7 +984,7 @@ rl_redisplay () the physical cursor position on the screen stays the same, but the buffer position needs to be adjusted to account for invisible characters. */ - if (cursor_linenum == 0 && wrap_offset) + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && cursor_linenum == 0 && wrap_offset) _rl_last_c_pos += wrap_offset; } @@ -914,7 +995,11 @@ rl_redisplay () invisible character in the prompt string. */ nleft = prompt_visible_length + wrap_offset; if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 && - _rl_last_c_pos <= prompt_last_invisible && local_prompt) +#if 0 + _rl_last_c_pos <= PROMPT_ENDING_INDEX && local_prompt) +#else + _rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt) +#endif { #if defined (__MSDOS__) putc ('\r', rl_outstream); @@ -924,7 +1009,7 @@ rl_redisplay () #endif _rl_output_some_chars (local_prompt, nleft); if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft); + _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft) - wrap_offset; else _rl_last_c_pos = nleft; } @@ -933,21 +1018,35 @@ rl_redisplay () in the buffer? */ pos = inv_lbreaks[cursor_linenum]; /* nleft == number of characters in the line buffer between the - start of the line and the cursor position. */ - nleft = c_pos - pos; + start of the line and the desired cursor position. */ + nleft = cpos_buffer_position - pos; + + /* NLEFT is now a number of characters in a buffer. When in a + multibyte locale, however, _rl_last_c_pos is an absolute cursor + position that doesn't take invisible characters in the prompt + into account. We use a fudge factor to compensate. */ /* Since _rl_backspace() doesn't know about invisible characters in the prompt, and there's no good way to tell it, we compensate for those characters here and call _rl_backspace() directly. */ if (wrap_offset && cursor_linenum == 0 && nleft < _rl_last_c_pos) { - _rl_backspace (_rl_last_c_pos - nleft); + /* TX == new physical cursor position in multibyte locale. */ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - _rl_last_c_pos = _rl_col_width (&visible_line[pos], 0, nleft); + tx = _rl_col_width (&visible_line[pos], 0, nleft) - visible_wrap_offset; else - _rl_last_c_pos = nleft; + tx = nleft; + if (_rl_last_c_pos > tx) + { + _rl_backspace (_rl_last_c_pos - tx); /* XXX */ + _rl_last_c_pos = tx; + } } + /* We need to note that in a multibyte locale we are dealing with + _rl_last_c_pos as an absolute cursor position, but moving to a + point specified by a buffer position (NLEFT) that doesn't take + invisible characters into account. */ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) _rl_move_cursor_relative (nleft, &invisible_line[pos]); else if (nleft != _rl_last_c_pos) @@ -966,11 +1065,11 @@ rl_redisplay () will be LMARGIN. */ /* The number of characters that will be displayed before the cursor. */ - ndisp = c_pos - wrap_offset; + ndisp = cpos_buffer_position - wrap_offset; nleft = prompt_visible_length + wrap_offset; /* Where the new cursor position will be on the screen. This can be longer than SCREENWIDTH; if it is, lmargin will be adjusted. */ - phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset); + phys_c_pos = cpos_buffer_position - (last_lmargin ? last_lmargin : wrap_offset); t = _rl_screenwidth / 3; /* If the number of characters had already exceeded the screenwidth, @@ -981,7 +1080,7 @@ rl_redisplay () two-thirds of the way across the screen. */ if (phys_c_pos > _rl_screenwidth - 2) { - lmargin = c_pos - (2 * t); + lmargin = cpos_buffer_position - (2 * t); if (lmargin < 0) lmargin = 0; /* If the left margin would be in the middle of a prompt with @@ -995,7 +1094,7 @@ rl_redisplay () { /* If we are moving back towards the beginning of the line and the last margin is no longer correct, compute a new one. */ - lmargin = ((c_pos - 1) / t) * t; /* XXX */ + lmargin = ((cpos_buffer_position - 1) / t) * t; /* XXX */ if (wrap_offset && lmargin > 0 && lmargin < nleft) lmargin = nleft; } @@ -1040,7 +1139,7 @@ rl_redisplay () if (visible_first_line_len > _rl_screenwidth) visible_first_line_len = _rl_screenwidth; - _rl_move_cursor_relative (c_pos - lmargin, &invisible_line[lmargin]); + _rl_move_cursor_relative (cpos_buffer_position - lmargin, &invisible_line[lmargin]); last_lmargin = lmargin; } } @@ -1106,7 +1205,10 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) the exact cursor position and cut-and-paste with certain terminal emulators. In this calculation, TEMP is the physical screen position of the cursor. */ - temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + temp = _rl_last_c_pos; + else + temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset); if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode && _rl_last_v_pos == current_line - 1) { @@ -1171,7 +1273,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) putc (new[0], rl_outstream); else putc (' ', rl_outstream); - _rl_last_c_pos = 1; /* XXX */ + _rl_last_c_pos = 1; _rl_last_v_pos++; if (old[0] && new[0]) old[0] = new[0]; @@ -1312,7 +1414,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) if (_rl_last_v_pos != current_line) { _rl_move_vert (current_line); - if (current_line == 0 && visible_wrap_offset) + if ((MB_CUR_MAX == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset) _rl_last_c_pos += visible_wrap_offset; } @@ -1328,11 +1430,11 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) sequences (like drawing the `unbold' sequence without a corresponding `bold') that manifests itself on certain terminals. */ - lendiff = local_prompt ? strlen (local_prompt) : 0; + lendiff = local_prompt_len; od = ofd - old; /* index of first difference in visible line */ if (current_line == 0 && !_rl_horizontal_scroll_mode && _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 && - od >= lendiff && _rl_last_c_pos <= prompt_last_invisible) + od >= lendiff && _rl_last_c_pos < PROMPT_ENDING_INDEX) { #if defined (__MSDOS__) putc ('\r', rl_outstream); @@ -1341,12 +1443,29 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) #endif _rl_output_some_chars (local_prompt, lendiff); if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - _rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff); + { + /* We take wrap_offset into account here so we can pass correct + information to _rl_move_cursor_relative. */ + _rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff) - wrap_offset; + cpos_adjusted = 1; + } else _rl_last_c_pos = lendiff; } + /* When this function returns, _rl_last_c_pos is correct, and an absolute + cursor postion in multibyte mode, but a buffer index when not in a + multibyte locale. */ _rl_move_cursor_relative (od, old); +#if 1 +#if defined (HANDLE_MULTIBYTE) + /* We need to indicate that the cursor position is correct in the presence of + invisible characters in the prompt string. Let's see if setting this when + we make sure we're at the end of the drawn prompt string works. */ + if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars) + cpos_adjusted = 1; +#endif +#endif /* if (len (new) > len (old)) lendiff == difference in buffer @@ -1403,7 +1522,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) insert_some_chars (nfd, lendiff, col_lendiff); _rl_last_c_pos += col_lendiff; } - else if (*ols == 0 && lendiff > 0) + else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && lendiff > 0) { /* At the end of a line the characters do not have to be "inserted". They can just be placed on the screen. */ @@ -1442,6 +1561,10 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) /* cannot insert chars, write to EOL */ _rl_output_some_chars (nfd, temp); _rl_last_c_pos += col_temp; + /* If we're in a multibyte locale and were before the last invisible + char in the current line (which implies we just output some invisible + characters) we need to adjust _rl_last_c_pos, since it represents + a physical character position. */ } } else /* Delete characters from line. */ @@ -1473,7 +1596,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin) if (temp > 0) { _rl_output_some_chars (nfd, temp); - _rl_last_c_pos += col_temp; + _rl_last_c_pos += col_temp; /* XXX */ } lendiff = (oe - old) - (ne - new); if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) @@ -1535,7 +1658,7 @@ rl_on_new_line_with_prompt () l = strlen (prompt_last_line); if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - _rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l); + _rl_last_c_pos = _rl_col_width (prompt_last_line, 0, l); /* XXX */ else _rl_last_c_pos = l; @@ -1570,10 +1693,11 @@ rl_on_new_line_with_prompt () int rl_forced_update_display () { + register char *temp; + if (visible_line) { - register char *temp = visible_line; - + temp = visible_line; while (*temp) *temp++ = '\0'; } @@ -1584,6 +1708,8 @@ rl_forced_update_display () } /* Move the cursor from _rl_last_c_pos to NEW, which are buffer indices. + (Well, when we don't have multibyte characters, _rl_last_c_pos is a + buffer index.) DATA is the contents of the screen line of interest; i.e., where the movement is being done. */ void @@ -1592,29 +1718,47 @@ _rl_move_cursor_relative (new, data) const char *data; { register int i; + int woff; /* number of invisible chars on current line */ + int cpos, dpos; /* current and desired cursor positions */ - /* If we don't have to do anything, then return. */ + woff = W_OFFSET (_rl_last_v_pos, wrap_offset); + cpos = _rl_last_c_pos; #if defined (HANDLE_MULTIBYTE) /* If we have multibyte characters, NEW is indexed by the buffer point in a multibyte string, but _rl_last_c_pos is the display position. In this case, NEW's display position is not obvious and must be - calculated. */ - if (MB_CUR_MAX == 1 || rl_byte_oriented) + calculated. We need to account for invisible characters in this line, + as long as we are past them and they are counted by _rl_col_width. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) { - if (_rl_last_c_pos == new) - return; + dpos = _rl_col_width (data, 0, new); + if (dpos > prompt_last_invisible) /* XXX - don't use woff here */ + { + dpos -= woff; + /* Since this will be assigned to _rl_last_c_pos at the end (more + precisely, _rl_last_c_pos == dpos when this function returns), + let the caller know. */ + cpos_adjusted = 1; + } } - else if (_rl_last_c_pos == _rl_col_width (data, 0, new)) - return; -#else - if (_rl_last_c_pos == new) return; + else #endif + dpos = new; + + /* If we don't have to do anything, then return. */ + if (cpos == dpos) + return; /* It may be faster to output a CR, and then move forwards instead of moving backwards. */ /* i == current physical cursor position. */ - i = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset); - if (new == 0 || CR_FASTER (new, _rl_last_c_pos) || +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + i = _rl_last_c_pos; + else +#endif + i = _rl_last_c_pos - woff; + if (dpos == 0 || CR_FASTER (dpos, _rl_last_c_pos) || (_rl_term_autowrap && i == _rl_screenwidth)) { #if defined (__MSDOS__) @@ -1622,10 +1766,10 @@ _rl_move_cursor_relative (new, data) #else tputs (_rl_term_cr, 1, _rl_output_character_function); #endif /* !__MSDOS__ */ - _rl_last_c_pos = 0; + cpos = _rl_last_c_pos = 0; } - if (_rl_last_c_pos < new) + if (cpos < dpos) { /* Move the cursor forward. We do it by printing the command to move the cursor forward if there is one, else print that @@ -1636,67 +1780,43 @@ _rl_move_cursor_relative (new, data) sequence telling the terminal to move forward one character. That kind of control is for people who don't know what the data is underneath the cursor. */ -#if defined (HACK_TERMCAP_MOTION) - if (_rl_term_forward_char) + + /* However, we need a handle on where the current display position is + in the buffer for the immediately preceding comment to be true. + In multibyte locales, we don't currently have that info available. + Without it, we don't know where the data we have to display begins + in the buffer and we have to go back to the beginning of the screen + line. In this case, we can use the terminal sequence to move forward + if it's available. */ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) { - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + if (_rl_term_forward_char) { - int width; - width = _rl_col_width (data, _rl_last_c_pos, new); - for (i = 0; i < width; i++) - tputs (_rl_term_forward_char, 1, _rl_output_character_function); + for (i = cpos; i < dpos; i++) + tputs (_rl_term_forward_char, 1, _rl_output_character_function); } else { - for (i = _rl_last_c_pos; i < new; i++) - tputs (_rl_term_forward_char, 1, _rl_output_character_function); + tputs (_rl_term_cr, 1, _rl_output_character_function); + for (i = 0; i < new; i++) + putc (data[i], rl_outstream); } } - else if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - { - tputs (_rl_term_cr, 1, _rl_output_character_function); - for (i = 0; i < new; i++) - putc (data[i], rl_outstream); - } else - for (i = _rl_last_c_pos; i < new; i++) + for (i = cpos; i < new; i++) putc (data[i], rl_outstream); - -#else /* !HACK_TERMCAP_MOTION */ - - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - { - tputs (_rl_term_cr, 1, _rl_output_character_function); - for (i = 0; i < new; i++) - putc (data[i], rl_outstream); - } - else - for (i = _rl_last_c_pos; i < new; i++) - putc (data[i], rl_outstream); - -#endif /* !HACK_TERMCAP_MOTION */ - } + #if defined (HANDLE_MULTIBYTE) /* NEW points to the buffer point, but _rl_last_c_pos is the display point. The byte length of the string is probably bigger than the column width of the string, which means that if NEW == _rl_last_c_pos, then NEW's display point is less than _rl_last_c_pos. */ - else if (_rl_last_c_pos >= new) -#else - else if (_rl_last_c_pos > new) #endif - { - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - _rl_backspace (_rl_last_c_pos - _rl_col_width (data, 0, new)); - else - _rl_backspace (_rl_last_c_pos - new); - } + else if (cpos > dpos) + _rl_backspace (cpos - dpos); - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - _rl_last_c_pos = _rl_col_width (data, 0, new); - else - _rl_last_c_pos = new; + _rl_last_c_pos = dpos; } /* PWP: move the cursor up or down. */ @@ -1785,9 +1905,9 @@ rl_character_len (c, pos) return ((ISPRINT (uc)) ? 1 : 2); } - /* How to print things in the "echo-area". The prompt is treated as a mini-modeline. */ +static int msg_saved_prompt = 0; #if defined (USE_VARARGS) int @@ -1818,8 +1938,20 @@ rl_message (va_alist) #endif va_end (args); + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } rl_display_prompt = msg_buf; + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; (*rl_redisplay_function) (); + return 0; } #else /* !USE_VARARGS */ @@ -1829,8 +1961,21 @@ rl_message (format, arg1, arg2) { sprintf (msg_buf, format, arg1, arg2); msg_buf[sizeof(msg_buf) - 1] = '\0'; /* overflow? */ + rl_display_prompt = msg_buf; + if (saved_local_prompt == 0) + { + rl_save_prompt (); + msg_saved_prompt = 1; + } + local_prompt = expand_prompt (msg_buf, &prompt_visible_length, + &prompt_last_invisible, + &prompt_invis_chars_first_line, + &prompt_physical_chars); + local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; (*rl_redisplay_function) (); + return 0; } #endif /* !USE_VARARGS */ @@ -1840,6 +1985,11 @@ int rl_clear_message () { rl_display_prompt = rl_prompt; + if (msg_saved_prompt) + { + rl_restore_prompt (); + msg_saved_prompt = 0; + } (*rl_redisplay_function) (); return 0; } @@ -1849,32 +1999,26 @@ rl_reset_line_state () { rl_on_new_line (); - rl_display_prompt = rl_prompt ? rl_prompt : (char*) ""; + rl_display_prompt = rl_prompt ? rl_prompt : ""; forced_display = 1; return 0; } -/* These are getting numerous enough that it's time to create a struct. */ - -static char *saved_local_prompt; -static char *saved_local_prefix; -static int saved_last_invisible; -static int saved_visible_length; -static int saved_invis_chars_first_line; -static int saved_physical_chars; - void rl_save_prompt () { saved_local_prompt = local_prompt; saved_local_prefix = local_prompt_prefix; + saved_prefix_length = prompt_prefix_length; + saved_local_length = local_prompt_len; saved_last_invisible = prompt_last_invisible; saved_visible_length = prompt_visible_length; saved_invis_chars_first_line = prompt_invis_chars_first_line; saved_physical_chars = prompt_physical_chars; local_prompt = local_prompt_prefix = (char *)0; - prompt_last_invisible = prompt_visible_length = 0; + local_prompt_len = 0; + prompt_last_invisible = prompt_visible_length = prompt_prefix_length = 0; prompt_invis_chars_first_line = prompt_physical_chars = 0; } @@ -1886,10 +2030,18 @@ rl_restore_prompt () local_prompt = saved_local_prompt; local_prompt_prefix = saved_local_prefix; + local_prompt_len = saved_local_length; + prompt_prefix_length = saved_prefix_length; prompt_last_invisible = saved_last_invisible; prompt_visible_length = saved_visible_length; prompt_invis_chars_first_line = saved_invis_chars_first_line; prompt_physical_chars = saved_physical_chars; + + /* can test saved_local_prompt to see if prompt info has been saved. */ + saved_local_prompt = saved_local_prefix = (char *)0; + saved_local_length = 0; + saved_last_invisible = saved_visible_length = saved_prefix_length = 0; + saved_invis_chars_first_line = saved_physical_chars = 0; } char * @@ -1897,11 +2049,15 @@ _rl_make_prompt_for_search (pchar) int pchar; { int len; - char *pmt; + char *pmt, *p; rl_save_prompt (); - if (saved_local_prompt == 0) + /* We've saved the prompt, and can do anything with the various prompt + strings we need before they're restored. We want the unexpanded + portion of the prompt string after any final newline. */ + p = rl_prompt ? strrchr (rl_prompt, '\n') : 0; + if (p == 0) { len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0; pmt = (char *)xmalloc (len + 2); @@ -1912,17 +2068,17 @@ _rl_make_prompt_for_search (pchar) } else { - len = *saved_local_prompt ? strlen (saved_local_prompt) : 0; + p++; + len = strlen (p); pmt = (char *)xmalloc (len + 2); if (len) - strcpy (pmt, saved_local_prompt); + strcpy (pmt, p); pmt[len] = pchar; pmt[len+1] = '\0'; - local_prompt = savestring (pmt); - prompt_last_invisible = saved_last_invisible; - prompt_visible_length = saved_visible_length + 1; - } + } + /* will be overwritten by expand_prompt, called from rl_message */ + prompt_physical_chars = saved_physical_chars + 1; return pmt; } @@ -1983,6 +2139,9 @@ insert_some_chars (string, count, col) char *string; int count, col; { +#if defined (__MSDOS__) || defined (__MINGW32__) + _rl_output_some_chars (string, count); +#else /* DEBUGGING */ if (MB_CUR_MAX == 1 || rl_byte_oriented) if (count != col) @@ -2021,6 +2180,7 @@ insert_some_chars (string, count, col) if (_rl_term_ei && *_rl_term_ei) tputs (_rl_term_ei, 1, _rl_output_character_function); } +#endif /* __MSDOS__ || __MINGW32__ */ } /* Delete COUNT characters from the display line. */ @@ -2031,6 +2191,7 @@ delete_chars (count) if (count > _rl_screenwidth) /* XXX */ return; +#if !defined (__MSDOS__) && !defined (__MINGW32__) if (_rl_term_DC && *_rl_term_DC) { char *buffer; @@ -2043,6 +2204,7 @@ delete_chars (count) while (count--) tputs (_rl_term_dc, 1, _rl_output_character_function); } +#endif /* !__MSDOS__ && !__MINGW32__ */ } void @@ -2066,7 +2228,8 @@ _rl_update_final () char *last_line; last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]]; - _rl_move_cursor_relative (_rl_screenwidth - 1, last_line); + cpos_buffer_position = -1; /* don't know where we are in buffer */ + _rl_move_cursor_relative (_rl_screenwidth - 1, last_line); /* XXX */ _rl_clear_to_eol (0); putc (last_line[_rl_screenwidth - 1], rl_outstream); } @@ -2098,18 +2261,10 @@ static void redraw_prompt (t) char *t; { - char *oldp, *oldl, *oldlprefix; - int oldlen, oldlast, oldplen, oldninvis, oldphyschars; + char *oldp; - /* Geez, I should make this a struct. */ oldp = rl_display_prompt; - oldl = local_prompt; - oldlprefix = local_prompt_prefix; - oldlen = prompt_visible_length; - oldplen = prompt_prefix_length; - oldlast = prompt_last_invisible; - oldninvis = prompt_invis_chars_first_line; - oldphyschars = prompt_physical_chars; + rl_save_prompt (); rl_display_prompt = t; local_prompt = expand_prompt (t, &prompt_visible_length, @@ -2117,16 +2272,12 @@ redraw_prompt (t) &prompt_invis_chars_first_line, &prompt_physical_chars); local_prompt_prefix = (char *)NULL; + local_prompt_len = local_prompt ? strlen (local_prompt) : 0; + rl_forced_update_display (); rl_display_prompt = oldp; - local_prompt = oldl; - local_prompt_prefix = oldlprefix; - prompt_visible_length = oldlen; - prompt_prefix_length = oldplen; - prompt_last_invisible = oldlast; - prompt_invis_chars_first_line = oldninvis; - prompt_physical_chars = oldphyschars; + rl_restore_prompt(); } /* Redisplay the current line after a SIGWINCH is received. */ @@ -2230,10 +2381,11 @@ _rl_col_width (str, start, end) if (end <= start) return 0; + memset (&ps, 0, sizeof (mbstate_t)); + point = 0; max = end; - memset (&ps, 0, sizeof(ps)); while (point < start) { tmp = mbrlen (str + point, max, &ps); diff --git a/cmd-line-utils/readline/funmap.c b/cmd-line-utils/readline/funmap.c index d56ffb9fadc..9c760cc3475 100644 --- a/cmd-line-utils/readline/funmap.c +++ b/cmd-line-utils/readline/funmap.c @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #if !defined (BUFSIZ) #include <stdio.h> @@ -174,6 +176,7 @@ static FUNMAP default_funmap[] = { { "vi-put", rl_vi_put }, { "vi-redo", rl_vi_redo }, { "vi-replace", rl_vi_replace }, + { "vi-rubout", rl_vi_rubout }, { "vi-search", rl_vi_search }, { "vi-search-again", rl_vi_search_again }, { "vi-set-mark", rl_vi_set_mark }, diff --git a/cmd-line-utils/readline/histexpand.c b/cmd-line-utils/readline/histexpand.c index 0a45438990a..f46c0b2a45d 100644 --- a/cmd-line-utils/readline/histexpand.c +++ b/cmd-line-utils/readline/histexpand.c @@ -22,7 +22,9 @@ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> @@ -54,8 +56,6 @@ typedef int _hist_search_func_t PARAMS((const char *, int)); -extern int rl_byte_oriented; /* declared in mbutil.c */ - static char error_pointer; static char *subst_lhs; @@ -87,14 +87,14 @@ char history_comment_char = '\0'; /* The list of characters which inhibit the expansion of text if found immediately following history_expansion_char. */ -char *history_no_expand_chars = (char*) " \t\n\r="; +char *history_no_expand_chars = " \t\n\r="; /* If set to a non-zero value, single quotes inhibit history expansion. The default is 0. */ int history_quotes_inhibit_expansion = 0; /* Used to split words by history_tokenize_internal. */ -char *history_word_delimiters = (char*) HISTORY_WORD_DELIMITERS; +char *history_word_delimiters = HISTORY_WORD_DELIMITERS; /* If set, this points to a function that is called to verify that a particular history expansion should be performed. */ @@ -203,24 +203,25 @@ get_history_event (string, caller_index, delimiting_quote) } /* Only a closing `?' or a newline delimit a substring search string. */ - for (local_index = i; (c = string[i]); i++) + for (local_index = i; c = string[i]; i++) + { #if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - { - int v; - mbstate_t ps; + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + int v; + mbstate_t ps; + + memset (&ps, 0, sizeof (mbstate_t)); + /* These produce warnings because we're passing a const string to a + function that takes a non-const string. */ + _rl_adjust_point ((char *)string, i, &ps); + if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1) + { + i += v - 1; + continue; + } + } - memset (&ps, 0, sizeof (mbstate_t)); - /* These produce warnings because we're passing a const string to a - function that takes a non-const string. */ - _rl_adjust_point ((char *)string, i, &ps); - if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1) - { - i += v - 1; - continue; - } - } - else #endif /* HANDLE_MULTIBYTE */ if ((!substring_okay && (whitespace (c) || c == ':' || (history_search_delimiter_chars && member (c, history_search_delimiter_chars)) || @@ -228,6 +229,7 @@ get_history_event (string, caller_index, delimiting_quote) string[i] == '\n' || (substring_okay && string[i] == '?')) break; + } which = i - local_index; temp = (char *)xmalloc (1 + which); @@ -560,12 +562,12 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) #if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) { - int chr, l; + int ch, l; l = _rl_find_prev_mbchar (string, i, MB_FIND_ANY); - chr = string[l]; + ch = string[l]; /* XXX - original patch had i - 1 ??? If i == 0 it would fail. */ - if (i && (chr == '\'' || chr == '"')) - quoted_search_delimiter = chr; + if (i && (ch == '\'' || ch == '"')) + quoted_search_delimiter = ch; } else #endif /* HANDLE_MULTIBYTE */ @@ -1426,6 +1428,8 @@ history_tokenize_word (string, ind) { if (peek == '<' && string[i + 2] == '-') i++; + else if (peek == '<' && string[i + 2] == '<') + i++; i += 2; return i; } diff --git a/cmd-line-utils/readline/histfile.c b/cmd-line-utils/readline/histfile.c index f1822b105a4..2f051a32563 100644 --- a/cmd-line-utils/readline/histfile.c +++ b/cmd-line-utils/readline/histfile.c @@ -30,7 +30,9 @@ # include <floss.h> #endif -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> @@ -184,8 +186,7 @@ read_history_range (filename, from, to) file_size = (size_t)finfo.st_size; /* check for overflow on very large files */ - if ((long long) file_size != (long long) finfo.st_size || - file_size + 1 < file_size) + if (file_size != finfo.st_size || file_size + 1 < file_size) { errno = overflow_errno; goto error_and_exit; @@ -255,7 +256,11 @@ read_history_range (filename, from, to) for (line_end = line_start; line_end < bufend; line_end++) if (*line_end == '\n') { - *line_end = '\0'; + /* Change to allow Windows-like \r\n end of line delimiter. */ + if (line_end > line_start && line_end[-1] == '\r') + line_end[-1] = '\0'; + else + *line_end = '\0'; if (*line_start) { @@ -334,8 +339,7 @@ history_truncate_file (fname, lines) file_size = (size_t)finfo.st_size; /* check for overflow on very large files */ - if ((long long) file_size != (long long) finfo.st_size || - file_size + 1 < file_size) + if (file_size != finfo.st_size || file_size + 1 < file_size) { close (file); #if defined (EFBIG) diff --git a/cmd-line-utils/readline/history.c b/cmd-line-utils/readline/history.c index bb1960d8d99..1ccf4db786c 100644 --- a/cmd-line-utils/readline/history.c +++ b/cmd-line-utils/readline/history.c @@ -1,6 +1,6 @@ /* history.c -- standalone history library */ -/* Copyright (C) 1989-2003 Free Software Foundation, Inc. +/* Copyright (C) 1989-2005 Free Software Foundation, Inc. This file contains the GNU History Library (the Library), a set of routines for managing the text of previously typed lines. @@ -25,7 +25,9 @@ you can call. I think I have done that. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> @@ -202,11 +204,27 @@ history_get (offset) int local_index; local_index = offset - history_base; - return (local_index >= history_length || local_index < 0 || !the_history) + return (local_index >= history_length || local_index < 0 || the_history == 0) ? (HIST_ENTRY *)NULL : the_history[local_index]; } +HIST_ENTRY * +alloc_history_entry (string, ts) + char *string; + char *ts; +{ + HIST_ENTRY *temp; + + temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); + + temp->line = string ? savestring (string) : string; + temp->data = (char *)NULL; + temp->timestamp = ts; + + return temp; +} + time_t history_get_time (hist) HIST_ENTRY *hist; @@ -288,11 +306,7 @@ add_history (string) } } - temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); - temp->line = savestring (string); - temp->data = (char *)NULL; - - temp->timestamp = hist_inittime (); + temp = alloc_history_entry (string, hist_inittime ()); the_history[history_length] = (HIST_ENTRY *)NULL; the_history[history_length - 1] = temp; @@ -326,6 +340,26 @@ free_history_entry (hist) free (hist); return (x); } + +HIST_ENTRY * +copy_history_entry (hist) + HIST_ENTRY *hist; +{ + HIST_ENTRY *ret; + char *ts; + + if (hist == 0) + return hist; + + ret = alloc_history_entry (hist->line, (char *)NULL); + + ts = hist->timestamp ? savestring (hist->timestamp) : hist->timestamp; + ret->timestamp = ts; + + ret->data = hist->data; + + return ret; +} /* Make the history entry at WHICH have LINE and DATA. This returns the old entry so you can dispose of the data. In the case of an @@ -338,7 +372,7 @@ replace_history_entry (which, line, data) { HIST_ENTRY *temp, *old_value; - if (which >= history_length) + if (which < 0 || which >= history_length) return ((HIST_ENTRY *)NULL); temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); @@ -352,6 +386,51 @@ replace_history_entry (which, line, data) return (old_value); } +/* Replace the DATA in the specified history entries, replacing OLD with + NEW. WHICH says which one(s) to replace: WHICH == -1 means to replace + all of the history entries where entry->data == OLD; WHICH == -2 means + to replace the `newest' history entry where entry->data == OLD; and + WHICH >= 0 means to replace that particular history entry's data, as + long as it matches OLD. */ +void +replace_history_data (which,old, new) + int which; + histdata_t *old, *new; +{ + HIST_ENTRY *entry; + register int i, last; + + if (which < -2 || which >= history_length || history_length == 0 || the_history == 0) + return; + + if (which >= 0) + { + entry = the_history[which]; + if (entry && entry->data == old) + entry->data = new; + return; + } + + last = -1; + for (i = 0; i < history_length; i++) + { + entry = the_history[i]; + if (entry == 0) + continue; + if (entry->data == old) + { + last = i; + if (which == -1) + entry->data = new; + } + } + if (which == -2 && last >= 0) + { + entry = the_history[last]; + entry->data = new; /* XXX - we don't check entry->old */ + } +} + /* Remove history element WHICH from the history. The removed element is returned to you so you can free the line, data, and containing structure. */ @@ -362,17 +441,15 @@ remove_history (which) HIST_ENTRY *return_value; register int i; - if (which >= history_length || !history_length) - return_value = (HIST_ENTRY *)NULL; - else - { - return_value = the_history[which]; + if (which < 0 || which >= history_length || history_length == 0 || the_history == 0) + return ((HIST_ENTRY *)NULL); - for (i = which; i < history_length; i++) - the_history[i] = the_history[i + 1]; + return_value = the_history[which]; - history_length--; - } + for (i = which; i < history_length; i++) + the_history[i] = the_history[i + 1]; + + history_length--; return (return_value); } diff --git a/cmd-line-utils/readline/histsearch.c b/cmd-line-utils/readline/histsearch.c index 778b323afdc..1cc5875a4b4 100644 --- a/cmd-line-utils/readline/histsearch.c +++ b/cmd-line-utils/readline/histsearch.c @@ -22,7 +22,9 @@ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> #if defined (HAVE_STDLIB_H) diff --git a/cmd-line-utils/readline/input.c b/cmd-line-utils/readline/input.c index 818f2e8763d..da5d771c481 100644 --- a/cmd-line-utils/readline/input.c +++ b/cmd-line-utils/readline/input.c @@ -1,6 +1,6 @@ /* input.c -- character input functions for readline. */ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -25,7 +25,9 @@ # include <floss.h> #endif -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> #include <fcntl.h> @@ -177,6 +179,7 @@ rl_gather_tyi () struct timeval timeout; #endif + chars_avail = 0; tty = fileno (rl_instream); #if defined (HAVE_SELECT) @@ -218,6 +221,13 @@ rl_gather_tyi () } #endif /* O_NDELAY */ +#if defined (__MINGW32__) + /* Use getch/_kbhit to check for available console input, in the same way + that we read it normally. */ + chars_avail = isatty (tty) ? _kbhit () : 0; + result = 0; +#endif + /* If there's nothing available, don't waste time trying to read something. */ if (chars_avail <= 0) @@ -261,7 +271,7 @@ rl_set_keyboard_input_timeout (u) int o; o = _keyboard_input_timeout; - if (u > 0) + if (u >= 0) _keyboard_input_timeout = u; return (o); } @@ -303,6 +313,11 @@ _rl_input_available () #endif +#if defined (__MINGW32__) + if (isatty (tty)) + return (_kbhit ()); +#endif + return 0; } @@ -405,7 +420,7 @@ rl_read_key () else { /* If input is coming from a macro, then use that. */ - if ((c= _rl_next_macro_key ())) + if (c = _rl_next_macro_key ()) return (c); /* If the user has an event function, then call it periodically. */ @@ -442,6 +457,10 @@ rl_getc (stream) while (1) { +#if defined (__MINGW32__) + if (isatty (fileno (stream))) + return (getch ()); +#endif result = read (fileno (stream), &c, sizeof (unsigned char)); if (result == sizeof (unsigned char)) @@ -483,7 +502,7 @@ rl_getc (stream) this is simply an interrupted system call to read (). Otherwise, some error ocurred, also signifying EOF. */ if (errno != EINTR) - return (EOF); + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); } } @@ -517,6 +536,12 @@ _rl_read_mbchar (mbchar, size) ps = ps_back; continue; } + else if (mbchar_bytes_length == 0) + { + mbchar[0] = '\0'; /* null wide character */ + mb_len = 1; + break; + } else if (mbchar_bytes_length > (size_t)(0)) break; } @@ -525,21 +550,21 @@ _rl_read_mbchar (mbchar, size) } /* Read a multibyte-character string whose first character is FIRST into - the buffer MB of length MBLEN. Returns the last character read, which + the buffer MB of length MLEN. Returns the last character read, which may be FIRST. Used by the search functions, among others. Very similar to _rl_read_mbchar. */ int -_rl_read_mbstring (first, mb, mb_len) +_rl_read_mbstring (first, mb, mlen) int first; char *mb; - int mb_len; + int mlen; { int i, c; mbstate_t ps; c = first; - memset (mb, 0, mb_len); - for (i = 0; i < mb_len; i++) + memset (mb, 0, mlen); + for (i = 0; i < mlen; i++) { mb[i] = (char)c; memset (&ps, 0, sizeof (mbstate_t)); diff --git a/cmd-line-utils/readline/isearch.c b/cmd-line-utils/readline/isearch.c index 9071695dda8..9f67bfc0801 100644 --- a/cmd-line-utils/readline/isearch.c +++ b/cmd-line-utils/readline/isearch.c @@ -4,7 +4,7 @@ /* */ /* **************************************************************** */ -/* Copyright (C) 1987-2002 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file contains the Readline Library (the Library), a set of routines for providing Emacs style line input to programs that ask @@ -26,7 +26,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> @@ -54,21 +56,77 @@ /* Variables exported to other files in the readline library. */ char *_rl_isearch_terminators = (char *)NULL; +_rl_search_cxt *_rl_iscxt = 0; + /* Variables imported from other files in the readline library. */ extern HIST_ENTRY *_rl_saved_line_for_history; -/* Forward declarations */ static int rl_search_history PARAMS((int, int)); +static _rl_search_cxt *_rl_isearch_init PARAMS((int)); +static void _rl_isearch_fini PARAMS((_rl_search_cxt *)); +static int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int)); + /* Last line found by the current incremental search, so we don't `find' - identical lines many times in a row. */ -static char *prev_line_found; + identical lines many times in a row. Now part of isearch context. */ +/* static char *prev_line_found; */ /* Last search string and its length. */ static char *last_isearch_string; static int last_isearch_string_len; -static char *default_isearch_terminators = (char*) "\033\012"; +static char *default_isearch_terminators = "\033\012"; + +_rl_search_cxt * +_rl_scxt_alloc (type, flags) + int type, flags; +{ + _rl_search_cxt *cxt; + + cxt = (_rl_search_cxt *)xmalloc (sizeof (_rl_search_cxt)); + + cxt->type = type; + cxt->sflags = flags; + + cxt->search_string = 0; + cxt->search_string_size = cxt->search_string_index = 0; + + cxt->lines = 0; + cxt->allocated_line = 0; + cxt->hlen = cxt->hindex = 0; + + cxt->save_point = rl_point; + cxt->save_mark = rl_mark; + cxt->save_line = where_history (); + cxt->last_found_line = cxt->save_line; + cxt->prev_line_found = 0; + + cxt->save_undo_list = 0; + + cxt->history_pos = 0; + cxt->direction = 0; + + cxt->lastc = 0; + + cxt->sline = 0; + cxt->sline_len = cxt->sline_index = 0; + + cxt->search_terminators = 0; + + return cxt; +} + +void +_rl_scxt_dispose (cxt, flags) + _rl_search_cxt *cxt; + int flags; +{ + FREE (cxt->search_string); + FREE (cxt->allocated_line); + FREE (cxt->lines); + + free (cxt); +} /* Search backwards through the history looking for a string which is typed interactively. Start with the current line. */ @@ -90,12 +148,13 @@ rl_forward_search_history (sign, key) /* Display the current state of the search in the echo-area. SEARCH_STRING contains the string that is being searched for, - DIRECTION is zero for forward, or 1 for reverse, + DIRECTION is zero for forward, or non-zero for reverse, WHERE is the history list number of the current line. If it is -1, then this line is the starting one. */ static void -rl_display_search (char *search_string, int reverse_p, - int where __attribute__((unused))) +rl_display_search (search_string, reverse_p, where) + char *search_string; + int reverse_p, where; { char *message; int msglen, searchlen; @@ -137,65 +196,23 @@ rl_display_search (char *search_string, int reverse_p, (*rl_redisplay_function) (); } -/* Search through the history looking for an interactively typed string. - This is analogous to i-search. We start the search in the current line. - DIRECTION is which direction to search; >= 0 means forward, < 0 means - backwards. */ -static int -rl_search_history (int direction, int invoking_key __attribute__((unused))) +static _rl_search_cxt * +_rl_isearch_init (direction) + int direction; { - /* The string that the user types in to search for. */ - char *search_string; - - /* The current length of SEARCH_STRING. */ - int search_string_index; - - /* The amount of space that SEARCH_STRING has allocated to it. */ - int search_string_size; - - /* The list of lines to search through. */ - char **lines, *allocated_line; - - /* The length of LINES. */ - int hlen; - - /* Where we get LINES from. */ - HIST_ENTRY **hlist; - + _rl_search_cxt *cxt; register int i; - int orig_point, orig_mark, orig_line, last_found_line; - int c, found, failed, sline_len; - int n, wstart, wlen; -#if defined (HANDLE_MULTIBYTE) - char mb[MB_LEN_MAX]; -#endif - - /* The line currently being searched. */ - char *sline; - - /* Offset in that line. */ - int line_index; - - /* Non-zero if we are doing a reverse search. */ - int reverse; - - /* The list of characters which terminate the search, but are not - subsequently executed. If the variable isearch-terminators has - been set, we use that value, otherwise we use ESC and C-J. */ - char *isearch_terminators; + HIST_ENTRY **hlist; - RL_SETSTATE(RL_STATE_ISEARCH); - orig_point = rl_point; - orig_mark = rl_mark; - last_found_line = orig_line = where_history (); - reverse = direction < 0; - hlist = history_list (); - allocated_line = (char *)NULL; + cxt = _rl_scxt_alloc (RL_SEARCH_ISEARCH, 0); + if (direction < 0) + cxt->sflags |= SF_REVERSE; - isearch_terminators = _rl_isearch_terminators ? _rl_isearch_terminators + cxt->search_terminators = _rl_isearch_terminators ? _rl_isearch_terminators : default_isearch_terminators; /* Create an arrary of pointers to the lines that we want to search. */ + hlist = history_list (); rl_maybe_replace_line (); i = 0; if (hlist) @@ -203,354 +220,447 @@ rl_search_history (int direction, int invoking_key __attribute__((unused))) /* Allocate space for this many lines, +1 for the current input line, and remember those lines. */ - lines = (char **)xmalloc ((1 + (hlen = i)) * sizeof (char *)); - for (i = 0; i < hlen; i++) - lines[i] = hlist[i]->line; + cxt->lines = (char **)xmalloc ((1 + (cxt->hlen = i)) * sizeof (char *)); + for (i = 0; i < cxt->hlen; i++) + cxt->lines[i] = hlist[i]->line; if (_rl_saved_line_for_history) - lines[i] = _rl_saved_line_for_history->line; + cxt->lines[i] = _rl_saved_line_for_history->line; else { /* Keep track of this so we can free it. */ - allocated_line = (char *)xmalloc (1 + strlen (rl_line_buffer)); - strcpy (allocated_line, &rl_line_buffer[0]); - lines[i] = allocated_line; + cxt->allocated_line = (char *)xmalloc (1 + strlen (rl_line_buffer)); + strcpy (cxt->allocated_line, &rl_line_buffer[0]); + cxt->lines[i] = cxt->allocated_line; } - hlen++; + cxt->hlen++; /* The line where we start the search. */ - i = orig_line; + cxt->history_pos = cxt->save_line; rl_save_prompt (); /* Initialize search parameters. */ - search_string = (char *)xmalloc (search_string_size = 128); - *search_string = '\0'; - search_string_index = 0; - prev_line_found = (char *)0; /* XXX */ + cxt->search_string = (char *)xmalloc (cxt->search_string_size = 128); + cxt->search_string[cxt->search_string_index = 0] = '\0'; /* Normalize DIRECTION into 1 or -1. */ - direction = (direction >= 0) ? 1 : -1; + cxt->direction = (direction >= 0) ? 1 : -1; - rl_display_search (search_string, reverse, -1); + cxt->sline = rl_line_buffer; + cxt->sline_len = strlen (cxt->sline); + cxt->sline_index = rl_point; - sline = rl_line_buffer; - sline_len = strlen (sline); - line_index = rl_point; + _rl_iscxt = cxt; /* save globally */ - found = failed = 0; - for (;;) + return cxt; +} + +static void +_rl_isearch_fini (cxt) + _rl_search_cxt *cxt; +{ + /* First put back the original state. */ + strcpy (rl_line_buffer, cxt->lines[cxt->save_line]); + + rl_restore_prompt (); + + /* Save the search string for possible later use. */ + FREE (last_isearch_string); + last_isearch_string = cxt->search_string; + last_isearch_string_len = cxt->search_string_index; + cxt->search_string = 0; + + if (cxt->last_found_line < cxt->save_line) + rl_get_previous_history (cxt->save_line - cxt->last_found_line, 0); + else + rl_get_next_history (cxt->last_found_line - cxt->save_line, 0); + + /* If the string was not found, put point at the end of the last matching + line. If last_found_line == orig_line, we didn't find any matching + history lines at all, so put point back in its original position. */ + if (cxt->sline_index < 0) { - rl_command_func_t *f = (rl_command_func_t *)NULL; + if (cxt->last_found_line == cxt->save_line) + cxt->sline_index = cxt->save_point; + else + cxt->sline_index = strlen (rl_line_buffer); + rl_mark = cxt->save_mark; + } + + rl_point = cxt->sline_index; + /* Don't worry about where to put the mark here; rl_get_previous_history + and rl_get_next_history take care of it. */ + + rl_clear_message (); +} - /* Read a key and decide how to proceed. */ - RL_SETSTATE(RL_STATE_MOREINPUT); - c = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); +int +_rl_search_getchar (cxt) + _rl_search_cxt *cxt; +{ + int c; + + /* Read a key and decide how to proceed. */ + RL_SETSTATE(RL_STATE_MOREINPUT); + c = cxt->lastc = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); #if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - c = _rl_read_mbstring (c, mb, MB_LEN_MAX); + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + c = cxt->lastc = _rl_read_mbstring (cxt->lastc, cxt->mb, MB_LEN_MAX); #endif - /* Translate the keys we do something with to opcodes. */ - if (c >= 0 && _rl_keymap[c].type == ISFUNC) - { - f = _rl_keymap[c].function; - - if (f == rl_reverse_search_history) - c = reverse ? -1 : -2; - else if (f == rl_forward_search_history) - c = !reverse ? -1 : -2; - else if (f == rl_rubout) - c = -3; - else if (c == CTRL ('G')) - c = -4; - else if (c == CTRL ('W')) /* XXX */ - c = -5; - else if (c == CTRL ('Y')) /* XXX */ - c = -6; - } + return c; +} - /* The characters in isearch_terminators (set from the user-settable - variable isearch-terminators) are used to terminate the search but - not subsequently execute the character as a command. The default - value is "\033\012" (ESC and C-J). */ - if (strchr (isearch_terminators, c)) - { - /* ESC still terminates the search, but if there is pending - input or if input arrives within 0.1 seconds (on systems - with select(2)) it is used as a prefix character - with rl_execute_next. WATCH OUT FOR THIS! This is intended - to allow the arrow keys to be used like ^F and ^B are used - to terminate the search and execute the movement command. - XXX - since _rl_input_available depends on the application- - settable keyboard timeout value, this could alternatively - use _rl_input_queued(100000) */ - if (c == ESC && _rl_input_available ()) - rl_execute_next (ESC); - break; - } +/* Process just-read character C according to isearch context CXT. Return + -1 if the caller should just free the context and return, 0 if we should + break out of the loop, and 1 if we should continue to read characters. */ +int +_rl_isearch_dispatch (cxt, c) + _rl_search_cxt *cxt; + int c; +{ + int n, wstart, wlen, limit, cval; + rl_command_func_t *f; + + f = (rl_command_func_t *)NULL; + + /* Translate the keys we do something with to opcodes. */ + if (c >= 0 && _rl_keymap[c].type == ISFUNC) + { + f = _rl_keymap[c].function; + + if (f == rl_reverse_search_history) + cxt->lastc = (cxt->sflags & SF_REVERSE) ? -1 : -2; + else if (f == rl_forward_search_history) + cxt->lastc = (cxt->sflags & SF_REVERSE) ? -2 : -1; + else if (f == rl_rubout) + cxt->lastc = -3; + else if (c == CTRL ('G')) + cxt->lastc = -4; + else if (c == CTRL ('W')) /* XXX */ + cxt->lastc = -5; + else if (c == CTRL ('Y')) /* XXX */ + cxt->lastc = -6; + } + + /* The characters in isearch_terminators (set from the user-settable + variable isearch-terminators) are used to terminate the search but + not subsequently execute the character as a command. The default + value is "\033\012" (ESC and C-J). */ + if (strchr (cxt->search_terminators, cxt->lastc)) + { + /* ESC still terminates the search, but if there is pending + input or if input arrives within 0.1 seconds (on systems + with select(2)) it is used as a prefix character + with rl_execute_next. WATCH OUT FOR THIS! This is intended + to allow the arrow keys to be used like ^F and ^B are used + to terminate the search and execute the movement command. + XXX - since _rl_input_available depends on the application- + settable keyboard timeout value, this could alternatively + use _rl_input_queued(100000) */ + if (cxt->lastc == ESC && _rl_input_available ()) + rl_execute_next (ESC); + return (0); + } #define ENDSRCH_CHAR(c) \ ((CTRL_CHAR (c) || META_CHAR (c) || (c) == RUBOUT) && ((c) != CTRL ('G'))) #if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + if (cxt->lastc >= 0 && (cxt->mb[0] && cxt->mb[1] == '\0') && ENDSRCH_CHAR (cxt->lastc)) + { + /* This sets rl_pending_input to c; it will be picked up the next + time rl_read_key is called. */ + rl_execute_next (cxt->lastc); + return (0); + } + } + else +#endif + if (cxt->lastc >= 0 && ENDSRCH_CHAR (cxt->lastc)) + { + /* This sets rl_pending_input to LASTC; it will be picked up the next + time rl_read_key is called. */ + rl_execute_next (cxt->lastc); + return (0); + } + + /* Now dispatch on the character. `Opcodes' affect the search string or + state. Other characters are added to the string. */ + switch (cxt->lastc) + { + /* search again */ + case -1: + if (cxt->search_string_index == 0) { - if (c >= 0 && strlen (mb) == 1 && ENDSRCH_CHAR (c)) + if (last_isearch_string) { - /* This sets rl_pending_input to c; it will be picked up the next - time rl_read_key is called. */ - rl_execute_next (c); + cxt->search_string_size = 64 + last_isearch_string_len; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + strcpy (cxt->search_string, last_isearch_string); + cxt->search_string_index = last_isearch_string_len; + rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1); break; } + return (1); } + else if (cxt->sflags & SF_REVERSE) + cxt->sline_index--; + else if (cxt->sline_index != cxt->sline_len) + cxt->sline_index++; else -#endif - if (c >= 0 && ENDSRCH_CHAR (c)) + rl_ding (); + break; + + /* switch directions */ + case -2: + cxt->direction = -cxt->direction; + if (cxt->direction < 0) + cxt->sflags |= SF_REVERSE; + else + cxt->sflags &= ~SF_REVERSE; + break; + + /* delete character from search string. */ + case -3: /* C-H, DEL */ + /* This is tricky. To do this right, we need to keep a + stack of search positions for the current search, with + sentinels marking the beginning and end. But this will + do until we have a real isearch-undo. */ + if (cxt->search_string_index == 0) + rl_ding (); + else + cxt->search_string[--cxt->search_string_index] = '\0'; + break; + + case -4: /* C-G, abort */ + rl_replace_line (cxt->lines[cxt->save_line], 0); + rl_point = cxt->save_point; + rl_mark = cxt->save_mark; + rl_restore_prompt(); + rl_clear_message (); + + return -1; + + case -5: /* C-W */ + /* skip over portion of line we already matched and yank word */ + wstart = rl_point + cxt->search_string_index; + if (wstart >= rl_end) { - /* This sets rl_pending_input to c; it will be picked up the next - time rl_read_key is called. */ - rl_execute_next (c); + rl_ding (); break; } - switch (c) + /* if not in a word, move to one. */ + cval = _rl_char_value (rl_line_buffer, wstart); + if (_rl_walphabetic (cval) == 0) { - case -1: - if (search_string_index == 0) - { - if (last_isearch_string) - { - search_string_size = 64 + last_isearch_string_len; - search_string = (char *)xrealloc (search_string, search_string_size); - strcpy (search_string, last_isearch_string); - search_string_index = last_isearch_string_len; - rl_display_search (search_string, reverse, -1); - break; - } - continue; - } - else if (reverse) - --line_index; - else if (line_index != sline_len) - ++line_index; - else - rl_ding (); + rl_ding (); break; - - /* switch directions */ - case -2: - direction = -direction; - reverse = direction < 0; + } + n = MB_NEXTCHAR (rl_line_buffer, wstart, 1, MB_FIND_NONZERO);; + while (n < rl_end) + { + cval = _rl_char_value (rl_line_buffer, n); + if (_rl_walphabetic (cval) == 0) + break; + n = MB_NEXTCHAR (rl_line_buffer, n, 1, MB_FIND_NONZERO);; + } + wlen = n - wstart + 1; + if (cxt->search_string_index + wlen + 1 >= cxt->search_string_size) + { + cxt->search_string_size += wlen + 1; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + } + for (; wstart < n; wstart++) + cxt->search_string[cxt->search_string_index++] = rl_line_buffer[wstart]; + cxt->search_string[cxt->search_string_index] = '\0'; + break; + + case -6: /* C-Y */ + /* skip over portion of line we already matched and yank rest */ + wstart = rl_point + cxt->search_string_index; + if (wstart >= rl_end) + { + rl_ding (); break; + } + n = rl_end - wstart + 1; + if (cxt->search_string_index + n + 1 >= cxt->search_string_size) + { + cxt->search_string_size += n + 1; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + } + for (n = wstart; n < rl_end; n++) + cxt->search_string[cxt->search_string_index++] = rl_line_buffer[n]; + cxt->search_string[cxt->search_string_index] = '\0'; + break; + + /* Add character to search string and continue search. */ + default: + if (cxt->search_string_index + 2 >= cxt->search_string_size) + { + cxt->search_string_size += 128; + cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size); + } +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + { + int j, l; + for (j = 0, l = strlen (cxt->mb); j < l; ) + cxt->search_string[cxt->search_string_index++] = cxt->mb[j++]; + } + else +#endif + cxt->search_string[cxt->search_string_index++] = c; + cxt->search_string[cxt->search_string_index] = '\0'; + break; + } - /* delete character from search string. */ - case -3: /* C-H, DEL */ - /* This is tricky. To do this right, we need to keep a - stack of search positions for the current search, with - sentinels marking the beginning and end. But this will - do until we have a real isearch-undo. */ - if (search_string_index == 0) - rl_ding (); - else - search_string[--search_string_index] = '\0'; - - break; + for (cxt->sflags &= ~(SF_FOUND|SF_FAILED);; ) + { + limit = cxt->sline_len - cxt->search_string_index + 1; - case -4: /* C-G */ - rl_replace_line (lines[orig_line], 0); - rl_point = orig_point; - rl_mark = orig_mark; - rl_restore_prompt(); - rl_clear_message (); - if (allocated_line) - free (allocated_line); - free (lines); - RL_UNSETSTATE(RL_STATE_ISEARCH); - return 0; - - case -5: /* C-W */ - /* skip over portion of line we already matched */ - wstart = rl_point + search_string_index; - if (wstart >= rl_end) + /* Search the current line. */ + while ((cxt->sflags & SF_REVERSE) ? (cxt->sline_index >= 0) : (cxt->sline_index < limit)) + { + if (STREQN (cxt->search_string, cxt->sline + cxt->sline_index, cxt->search_string_index)) { - rl_ding (); + cxt->sflags |= SF_FOUND; break; } + else + cxt->sline_index += cxt->direction; + } + if (cxt->sflags & SF_FOUND) + break; - /* if not in a word, move to one. */ - if (rl_alphabetic(rl_line_buffer[wstart]) == 0) - { - rl_ding (); - break; - } - n = wstart; - while (n < rl_end && rl_alphabetic(rl_line_buffer[n])) - n++; - wlen = n - wstart + 1; - if (search_string_index + wlen + 1 >= search_string_size) - { - search_string_size += wlen + 1; - search_string = (char *)xrealloc (search_string, search_string_size); - } - for (; wstart < n; wstart++) - search_string[search_string_index++] = rl_line_buffer[wstart]; - search_string[search_string_index] = '\0'; - break; + /* Move to the next line, but skip new copies of the line + we just found and lines shorter than the string we're + searching for. */ + do + { + /* Move to the next line. */ + cxt->history_pos += cxt->direction; - case -6: /* C-Y */ - /* skip over portion of line we already matched */ - wstart = rl_point + search_string_index; - if (wstart >= rl_end) + /* At limit for direction? */ + if ((cxt->sflags & SF_REVERSE) ? (cxt->history_pos < 0) : (cxt->history_pos == cxt->hlen)) { - rl_ding (); + cxt->sflags |= SF_FAILED; break; } - n = rl_end - wstart + 1; - if (search_string_index + n + 1 >= search_string_size) - { - search_string_size += n + 1; - search_string = (char *)xrealloc (search_string, search_string_size); - } - for (n = wstart; n < rl_end; n++) - search_string[search_string_index++] = rl_line_buffer[n]; - search_string[search_string_index] = '\0'; - break; - default: - /* Add character to search string and continue search. */ - if (search_string_index + 2 >= search_string_size) - { - search_string_size += 128; - search_string = (char *)xrealloc (search_string, search_string_size); - } -#if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - { - int j, l; - for (j = 0, l = strlen (mb); j < l; ) - search_string[search_string_index++] = mb[j++]; - } - else -#endif - search_string[search_string_index++] = c; - search_string[search_string_index] = '\0'; - break; + /* We will need these later. */ + cxt->sline = cxt->lines[cxt->history_pos]; + cxt->sline_len = strlen (cxt->sline); } + while ((cxt->prev_line_found && STREQ (cxt->prev_line_found, cxt->lines[cxt->history_pos])) || + (cxt->search_string_index > cxt->sline_len)); - for (found = failed = 0;;) - { - int limit = sline_len - search_string_index + 1; + if (cxt->sflags & SF_FAILED) + break; - /* Search the current line. */ - while (reverse ? (line_index >= 0) : (line_index < limit)) - { - if (STREQN (search_string, sline + line_index, search_string_index)) - { - found++; - break; - } - else - line_index += direction; - } - if (found) - break; + /* Now set up the line for searching... */ + cxt->sline_index = (cxt->sflags & SF_REVERSE) ? cxt->sline_len - cxt->search_string_index : 0; + } - /* Move to the next line, but skip new copies of the line - we just found and lines shorter than the string we're - searching for. */ - do - { - /* Move to the next line. */ - i += direction; - - /* At limit for direction? */ - if (reverse ? (i < 0) : (i == hlen)) - { - failed++; - break; - } - - /* We will need these later. */ - sline = lines[i]; - sline_len = strlen (sline); - } - while ((prev_line_found && STREQ (prev_line_found, lines[i])) || - (search_string_index > sline_len)); + if (cxt->sflags & SF_FAILED) + { + /* We cannot find the search string. Ding the bell. */ + rl_ding (); + cxt->history_pos = cxt->last_found_line; + return 1; + } - if (failed) - break; + /* We have found the search string. Just display it. But don't + actually move there in the history list until the user accepts + the location. */ + if (cxt->sflags & SF_FOUND) + { + cxt->prev_line_found = cxt->lines[cxt->history_pos]; + rl_replace_line (cxt->lines[cxt->history_pos], 0); + rl_point = cxt->sline_index; + cxt->last_found_line = cxt->history_pos; + rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos); + } - /* Now set up the line for searching... */ - line_index = reverse ? sline_len - search_string_index : 0; - } + return 1; +} - if (failed) - { - /* We cannot find the search string. Ding the bell. */ - rl_ding (); - i = last_found_line; - continue; /* XXX - was break */ - } +static int +_rl_isearch_cleanup (cxt, r) + _rl_search_cxt *cxt; + int r; +{ + if (r >= 0) + _rl_isearch_fini (cxt); + _rl_scxt_dispose (cxt, 0); + _rl_iscxt = 0; - /* We have found the search string. Just display it. But don't - actually move there in the history list until the user accepts - the location. */ - if (found) - { - prev_line_found = lines[i]; - rl_replace_line (lines[i], 0); - rl_point = line_index; - last_found_line = i; - rl_display_search (search_string, reverse, (i == orig_line) ? -1 : i); - } - } + RL_UNSETSTATE(RL_STATE_ISEARCH); - /* The searching is over. The user may have found the string that she - was looking for, or else she may have exited a failing search. If - LINE_INDEX is -1, then that shows that the string searched for was - not found. We use this to determine where to place rl_point. */ + return (r != 0); +} - /* First put back the original state. */ - strcpy (rl_line_buffer, lines[orig_line]); +/* Search through the history looking for an interactively typed string. + This is analogous to i-search. We start the search in the current line. + DIRECTION is which direction to search; >= 0 means forward, < 0 means + backwards. */ +static int +rl_search_history (direction, invoking_key) + int direction, invoking_key; +{ + _rl_search_cxt *cxt; /* local for now, but saved globally */ + int c, r; - rl_restore_prompt (); + RL_SETSTATE(RL_STATE_ISEARCH); + cxt = _rl_isearch_init (direction); - /* Save the search string for possible later use. */ - FREE (last_isearch_string); - last_isearch_string = search_string; - last_isearch_string_len = search_string_index; + rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1); - if (last_found_line < orig_line) - rl_get_previous_history (orig_line - last_found_line, 0); - else - rl_get_next_history (last_found_line - orig_line, 0); + /* If we are using the callback interface, all we do is set up here and + return. The key is that we leave RL_STATE_ISEARCH set. */ + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); - /* If the string was not found, put point at the end of the last matching - line. If last_found_line == orig_line, we didn't find any matching - history lines at all, so put point back in its original position. */ - if (line_index < 0) + r = -1; + for (;;) { - if (last_found_line == orig_line) - line_index = orig_point; - else - line_index = strlen (rl_line_buffer); - rl_mark = orig_mark; + c = _rl_search_getchar (cxt); + /* We might want to handle EOF here (c == 0) */ + r = _rl_isearch_dispatch (cxt, cxt->lastc); + if (r <= 0) + break; } - rl_point = line_index; - /* Don't worry about where to put the mark here; rl_get_previous_history - and rl_get_next_history take care of it. */ - - rl_clear_message (); + /* The searching is over. The user may have found the string that she + was looking for, or else she may have exited a failing search. If + LINE_INDEX is -1, then that shows that the string searched for was + not found. We use this to determine where to place rl_point. */ + return (_rl_isearch_cleanup (cxt, r)); +} - FREE (allocated_line); - free (lines); +#if defined (READLINE_CALLBACKS) +/* Called from the callback functions when we are ready to read a key. The + callback functions know to call this because RL_ISSTATE(RL_STATE_ISEARCH). + If _rl_isearch_dispatch finishes searching, this function is responsible + for turning off RL_STATE_ISEARCH, which it does using _rl_isearch_cleanup. */ +int +_rl_isearch_callback (cxt) + _rl_search_cxt *cxt; +{ + int c, r; - RL_UNSETSTATE(RL_STATE_ISEARCH); + c = _rl_search_getchar (cxt); + /* We might want to handle EOF here */ + r = _rl_isearch_dispatch (cxt, cxt->lastc); - return 0; + return (r <= 0) ? _rl_isearch_cleanup (cxt, r) : 0; } +#endif diff --git a/cmd-line-utils/readline/keymaps.c b/cmd-line-utils/readline/keymaps.c index 2be03f7086f..70d0cc08d3f 100644 --- a/cmd-line-utils/readline/keymaps.c +++ b/cmd-line-utils/readline/keymaps.c @@ -20,7 +20,9 @@ Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #if defined (HAVE_STDLIB_H) # include <stdlib.h> diff --git a/cmd-line-utils/readline/kill.c b/cmd-line-utils/readline/kill.c index 4d31a8ff170..031ddf47c5b 100644 --- a/cmd-line-utils/readline/kill.c +++ b/cmd-line-utils/readline/kill.c @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> @@ -76,7 +78,8 @@ static int rl_yank_nth_arg_internal PARAMS((int, int, int)); /* How to say that you only want to save a certain amount of kill material. */ int -rl_set_retained_kills (int num __attribute__((unused))) +rl_set_retained_kills (num) + int num; { return 0; } @@ -292,8 +295,8 @@ rl_backward_kill_line (direction, ignore) /* Kill the whole line, no matter where point is. */ int -rl_kill_full_line (int count __attribute__((unused)), - int ignore __attribute__((unused))) +rl_kill_full_line (count, ignore) + int count, ignore; { rl_begin_undo_group (); rl_point = 0; @@ -310,7 +313,8 @@ rl_kill_full_line (int count __attribute__((unused)), /* This does what C-w does in Unix. We can't prevent people from using behaviour that they expect. */ int -rl_unix_word_rubout (int count, int key __attribute__((unused))) +rl_unix_word_rubout (count, key) + int count, key; { int orig_point; @@ -342,7 +346,8 @@ rl_unix_word_rubout (int count, int key __attribute__((unused))) /* This deletes one filename component in a Unix pathname. That is, it deletes backward to directory separator (`/') or whitespace. */ int -rl_unix_filename_rubout (int count, int key __attribute__((unused))) +rl_unix_filename_rubout (count, key) + int count, key; { int orig_point, c; @@ -385,8 +390,8 @@ rl_unix_filename_rubout (int count, int key __attribute__((unused))) into the line at all, and if you aren't, then you know what you are doing. */ int -rl_unix_line_discard (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_unix_line_discard (count, key) + int count, key; { if (rl_point == 0) rl_ding (); @@ -422,16 +427,16 @@ region_kill_internal (delete) /* Copy the text in the region to the kill ring. */ int -rl_copy_region_to_kill (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_copy_region_to_kill (count, ignore) + int count, ignore; { return (region_kill_internal (0)); } /* Kill the text between the point and mark. */ int -rl_kill_region (int count __attribute__((unused)), - int ignore __attribute__((unused))) +rl_kill_region (count, ignore) + int count, ignore; { int r, npoint; @@ -495,7 +500,8 @@ rl_copy_backward_word (count, key) /* Yank back the last killed text. This ignores arguments. */ int -rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused))) +rl_yank (count, ignore) + int count, ignore; { if (rl_kill_ring == 0) { @@ -513,7 +519,8 @@ rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused))) delete that text from the line, rotate the index down, and yank back some other text. */ int -rl_yank_pop (int count __attribute__((unused)), int key __attribute__((unused))) +rl_yank_pop (count, key) + int count, key; { int l, n; @@ -575,6 +582,7 @@ rl_yank_nth_arg_internal (count, ignore, history_skip) if (!arg || !*arg) { rl_ding (); + FREE (arg); return -1; } diff --git a/cmd-line-utils/readline/macro.c b/cmd-line-utils/readline/macro.c index 8727285e181..00cd58d628c 100644 --- a/cmd-line-utils/readline/macro.c +++ b/cmd-line-utils/readline/macro.c @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> @@ -98,6 +100,8 @@ _rl_with_macro_input (string) int _rl_next_macro_key () { + int c; + if (rl_executing_macro == 0) return (0); @@ -107,7 +111,14 @@ _rl_next_macro_key () return (_rl_next_macro_key ()); } +#if defined (READLINE_CALLBACKS) + c = rl_executing_macro[executing_macro_index++]; + if (RL_ISSTATE (RL_STATE_CALLBACK) && RL_ISSTATE (RL_STATE_READCMD|RL_STATE_MOREINPUT) && rl_executing_macro[executing_macro_index] == 0) + _rl_pop_executing_macro (); + return c; +#else return (rl_executing_macro[executing_macro_index++]); +#endif } /* Save the currently executing macro on a stack of saved macros. */ @@ -189,8 +200,8 @@ _rl_kill_kbd_macro () definition to the end of the existing macro, and start by re-executing the existing macro. */ int -rl_start_kbd_macro (int ignore1 __attribute__((unused)), - int ignore2 __attribute__((unused))) +rl_start_kbd_macro (ignore1, ignore2) + int ignore1, ignore2; { if (RL_ISSTATE (RL_STATE_MACRODEF)) { @@ -214,7 +225,8 @@ rl_start_kbd_macro (int ignore1 __attribute__((unused)), A numeric argument says to execute the macro right now, that many times, counting the definition as the first time. */ int -rl_end_kbd_macro (int count, int ignore __attribute__((unused))) +rl_end_kbd_macro (count, ignore) + int count, ignore; { if (RL_ISSTATE (RL_STATE_MACRODEF) == 0) { @@ -233,7 +245,8 @@ rl_end_kbd_macro (int count, int ignore __attribute__((unused))) /* Execute the most recently defined keyboard macro. COUNT says how many times to execute it. */ int -rl_call_last_kbd_macro (int count, int ignore __attribute__((unused))) +rl_call_last_kbd_macro (count, ignore) + int count, ignore; { if (current_macro == 0) _rl_abort_internal (); diff --git a/cmd-line-utils/readline/mbutil.c b/cmd-line-utils/readline/mbutil.c index 284ea63aae4..17dde53ed7b 100644 --- a/cmd-line-utils/readline/mbutil.c +++ b/cmd-line-utils/readline/mbutil.c @@ -1,6 +1,6 @@ /* mbutil.c -- readline multibyte character utility functions */ -/* Copyright (C) 2001-2004 Free Software Foundation, Inc. +/* Copyright (C) 2001-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,16 +21,11 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE 500 +#if defined (HAVE_CONFIG_H) +# include <config.h> #endif -#include "config_readline.h" - #include <sys/types.h> - -/* To get SuSE 9.3 to define wcwidth() (in wchar.h) */ - #include <fcntl.h> #include "posixjmp.h" @@ -82,18 +77,20 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero) char *string; int seed, count, find_non_zero; { - size_t tmp = 0; + size_t tmp; mbstate_t ps; - int point = 0; + int point; wchar_t wc; + tmp = 0; + memset(&ps, 0, sizeof (mbstate_t)); if (seed < 0) seed = 0; if (count <= 0) return seed; - point = seed + _rl_adjust_point(string, seed, &ps); + point = seed + _rl_adjust_point (string, seed, &ps); /* if this is true, means that seed was not pointed character started byte. So correct the point and consume count */ if (seed < point) @@ -131,15 +128,16 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero) if (find_non_zero) { tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); - while (wcwidth (wc) == 0) + while (tmp > 0 && wcwidth (wc) == 0) { point += tmp; tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); - if (tmp == (size_t)(0) || tmp == (size_t)(-1) || tmp == (size_t)(-2)) + if (MB_NULLWCH (tmp) || MB_INVALIDCH (tmp)) break; } } - return point; + + return point; } static int @@ -318,6 +316,28 @@ _rl_is_mbchar_matched (string, seed, end, mbchar, length) return 0; return 1; } + +wchar_t +_rl_char_value (buf, ind) + char *buf; + int ind; +{ + size_t tmp; + wchar_t wc; + mbstate_t ps; + int l; + + if (MB_LEN_MAX == 1 || rl_byte_oriented) + return ((wchar_t) buf[ind]); + l = strlen (buf); + if (ind >= l - 1) + return ((wchar_t) buf[ind]); + memset (&ps, 0, sizeof (mbstate_t)); + tmp = mbrtowc (&wc, buf + ind, l - ind, &ps); + if (MB_INVALIDCH (tmp) || MB_NULLWCH (tmp)) + return ((wchar_t) buf[ind]); + return wc; +} #endif /* HANDLE_MULTIBYTE */ /* Find next `count' characters started byte point of the specified seed. diff --git a/cmd-line-utils/readline/misc.c b/cmd-line-utils/readline/misc.c index c8739d0d750..94ecb25900a 100644 --- a/cmd-line-utils/readline/misc.c +++ b/cmd-line-utils/readline/misc.c @@ -1,6 +1,6 @@ /* misc.c -- miscellaneous bindable readline functions. */ -/* Copyright (C) 1987-2004 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #if defined (HAVE_UNISTD_H) # include <unistd.h> @@ -61,6 +63,8 @@ void _rl_free_history_entry PARAMS((HIST_ENTRY *)); to preserve the value of rl_point from line to line. */ int _rl_history_preserve_point = 0; +_rl_arg_cxt _rl_argcxt; + /* Saved target point for when _rl_history_preserve_point is set. Special value of -1 means that point is at the end of the line. */ int _rl_history_saved_point = -1; @@ -71,77 +75,74 @@ int _rl_history_saved_point = -1; /* */ /* **************************************************************** */ -/* Handle C-u style numeric args, as well as M--, and M-digits. */ -static int -rl_digit_loop () +int +_rl_arg_overflow () { - int key, c, sawminus, sawdigits; + if (rl_numeric_arg > 1000000) + { + _rl_argcxt = 0; + rl_explicit_arg = rl_numeric_arg = 0; + rl_ding (); + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + return 1; + } + return 0; +} +void +_rl_arg_init () +{ rl_save_prompt (); - + _rl_argcxt = 0; RL_SETSTATE(RL_STATE_NUMERICARG); - sawminus = sawdigits = 0; - while (1) - { - if (rl_numeric_arg > 1000000) - { - sawdigits = rl_explicit_arg = rl_numeric_arg = 0; - rl_ding (); - rl_restore_prompt (); - rl_clear_message (); - RL_UNSETSTATE(RL_STATE_NUMERICARG); - return 1; - } - rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); - RL_SETSTATE(RL_STATE_MOREINPUT); - key = c = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); +} - if (c < 0) - { - _rl_abort_internal (); - return -1; - } +int +_rl_arg_getchar () +{ + int c; - /* If we see a key bound to `universal-argument' after seeing digits, - it ends the argument but is otherwise ignored. */ - if (_rl_keymap[c].type == ISFUNC && - _rl_keymap[c].function == rl_universal_argument) - { - if (sawdigits == 0) - { - rl_numeric_arg *= 4; - continue; - } - else - { - RL_SETSTATE(RL_STATE_MOREINPUT); - key = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); - rl_restore_prompt (); - rl_clear_message (); - RL_UNSETSTATE(RL_STATE_NUMERICARG); - return (_rl_dispatch (key, _rl_keymap)); - } - } + rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); - c = UNMETA (c); + return c; +} - if (_rl_digit_p (c)) - { - rl_numeric_arg = rl_explicit_arg ? (rl_numeric_arg * 10) + c - '0' : c - '0'; - sawdigits = rl_explicit_arg = 1; - } - else if (c == '-' && rl_explicit_arg == 0) +/* Process C as part of the current numeric argument. Return -1 if the + argument should be aborted, 0 if we should not read any more chars, and + 1 if we should continue to read chars. */ +int +_rl_arg_dispatch (cxt, c) + _rl_arg_cxt cxt; + int c; +{ + int key, r; + + key = c; + + /* If we see a key bound to `universal-argument' after seeing digits, + it ends the argument but is otherwise ignored. */ + if (_rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument) + { + if ((cxt & NUM_SAWDIGITS) == 0) { - rl_numeric_arg = sawminus = 1; - rl_arg_sign = -1; + rl_numeric_arg *= 4; + return 1; } + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_argcxt |= NUM_READONE; + return 0; /* XXX */ + } else { - /* Make M-- command equivalent to M--1 command. */ - if (sawminus && rl_numeric_arg == 1 && rl_explicit_arg == 0) - rl_explicit_arg = 1; + RL_SETSTATE(RL_STATE_MOREINPUT); + key = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); rl_restore_prompt (); rl_clear_message (); RL_UNSETSTATE(RL_STATE_NUMERICARG); @@ -149,45 +150,144 @@ rl_digit_loop () } } - /*NOTREACHED*/ -} + c = UNMETA (c); -/* Add the current digit to the argument in progress. */ -int -rl_digit_argument (int ignore __attribute__((unused)), int key) -{ - rl_execute_next (key); - return (rl_digit_loop ()); + if (_rl_digit_p (c)) + { + r = _rl_digit_value (c); + rl_numeric_arg = rl_explicit_arg ? (rl_numeric_arg * 10) + r : r; + rl_explicit_arg = 1; + _rl_argcxt |= NUM_SAWDIGITS; + } + else if (c == '-' && rl_explicit_arg == 0) + { + rl_numeric_arg = 1; + _rl_argcxt |= NUM_SAWMINUS; + rl_arg_sign = -1; + } + else + { + /* Make M-- command equivalent to M--1 command. */ + if ((_rl_argcxt & NUM_SAWMINUS) && rl_numeric_arg == 1 && rl_explicit_arg == 0) + rl_explicit_arg = 1; + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + + r = _rl_dispatch (key, _rl_keymap); + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + /* At worst, this will cause an extra redisplay. Otherwise, + we have to wait until the next character comes in. */ + if (rl_done == 0) + (*rl_redisplay_function) (); + r = 0; + } + return r; + } + + return 1; } -/* What to do when you abort reading an argument. */ -int -rl_discard_argument () +/* Handle C-u style numeric args, as well as M--, and M-digits. */ +static int +rl_digit_loop () { - rl_ding (); - rl_clear_message (); - _rl_init_argument (); - return 0; + int c, r; + + while (1) + { + if (_rl_arg_overflow ()) + return 1; + + c = _rl_arg_getchar (); + + if (c < 0) + { + _rl_abort_internal (); + return -1; + } + + r = _rl_arg_dispatch (_rl_argcxt, c); + if (r <= 0 || (RL_ISSTATE (RL_STATE_NUMERICARG) == 0)) + break; + } + + return r; } /* Create a default argument. */ -int -_rl_init_argument () +void +_rl_reset_argument () { rl_numeric_arg = rl_arg_sign = 1; rl_explicit_arg = 0; - return 0; + _rl_argcxt = 0; +} + +/* Start a numeric argument with initial value KEY */ +int +rl_digit_argument (ignore, key) + int ignore, key; +{ + _rl_arg_init (); + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_arg_dispatch (_rl_argcxt, key); + rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); + return 0; + } + else + { + rl_execute_next (key); + return (rl_digit_loop ()); + } } /* C-u, universal argument. Multiply the current argument by 4. Read a key. If the key has nothing to do with arguments, then dispatch on it. If the key is the abort character then abort. */ int -rl_universal_argument (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_universal_argument (count, key) + int count, key; { + _rl_arg_init (); rl_numeric_arg *= 4; - return (rl_digit_loop ()); + + return (RL_ISSTATE (RL_STATE_CALLBACK) ? 0 : rl_digit_loop ()); +} + +int +_rl_arg_callback (cxt) + _rl_arg_cxt cxt; +{ + int c, r; + + c = _rl_arg_getchar (); + + if (_rl_argcxt & NUM_READONE) + { + _rl_argcxt &= ~NUM_READONE; + rl_restore_prompt (); + rl_clear_message (); + RL_UNSETSTATE(RL_STATE_NUMERICARG); + rl_execute_next (c); + return 0; + } + + r = _rl_arg_dispatch (cxt, c); + return (r != 1); +} + +/* What to do when you abort reading an argument. */ +int +rl_discard_argument () +{ + rl_ding (); + rl_clear_message (); + _rl_reset_argument (); + + return 0; } /* **************************************************************** */ @@ -222,8 +322,10 @@ _rl_free_history_entry (entry) { if (entry == 0) return; - if (entry->line) - free (entry->line); + + FREE (entry->line); + FREE (entry->timestamp); + free (entry); } @@ -239,6 +341,7 @@ rl_maybe_replace_line () { temp = replace_history_entry (where_history (), rl_line_buffer, (histdata_t)rl_undo_list); free (temp->line); + FREE (temp->timestamp); free (temp); } return 0; @@ -271,14 +374,9 @@ rl_maybe_save_line () { _rl_saved_line_for_history = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY)); _rl_saved_line_for_history->line = savestring (rl_line_buffer); + _rl_saved_line_for_history->timestamp = (char *)NULL; _rl_saved_line_for_history->data = (char *)rl_undo_list; } - else if (STREQ (rl_line_buffer, _rl_saved_line_for_history->line) == 0) - { - free (_rl_saved_line_for_history->line); - _rl_saved_line_for_history->line = savestring (rl_line_buffer); - _rl_saved_line_for_history->data = (char *)rl_undo_list; /* XXX possible memleak */ - } return 0; } @@ -313,7 +411,9 @@ _rl_history_set_point () } void -rl_replace_from_history (HIST_ENTRY *entry, int flags __attribute__((unused))) +rl_replace_from_history (entry, flags) + HIST_ENTRY *entry; + int flags; /* currently unused */ { /* Can't call with `1' because rl_undo_list might point to an undo list from a history entry, just like we're setting up here. */ @@ -339,15 +439,16 @@ rl_replace_from_history (HIST_ENTRY *entry, int flags __attribute__((unused))) /* Meta-< goes to the start of the history. */ int -rl_beginning_of_history (int count __attribute__((unused)), int key) +rl_beginning_of_history (count, key) + int count, key; { return (rl_get_previous_history (1 + where_history (), key)); } /* Meta-> goes to the end of the history. (The current line). */ int -rl_end_of_history (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_end_of_history (count, key) + int count, key; { rl_maybe_replace_line (); using_history (); @@ -451,7 +552,8 @@ rl_get_previous_history (count, key) /* **************************************************************** */ /* How to toggle back and forth between editing modes. */ int -rl_vi_editing_mode (int count __attribute__((unused)), int key) +rl_vi_editing_mode (count, key) + int count, key; { #if defined (VI_MODE) _rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */ @@ -463,8 +565,8 @@ rl_vi_editing_mode (int count __attribute__((unused)), int key) } int -rl_emacs_editing_mode (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_emacs_editing_mode (count, key) + int count, key; { rl_editing_mode = emacs_mode; _rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */ @@ -474,7 +576,8 @@ rl_emacs_editing_mode (int count __attribute__((unused)), /* Function for the rest of the library to use to set insert/overwrite mode. */ void -_rl_set_insert_mode (int im, int force __attribute__((unused))) +_rl_set_insert_mode (im, force) + int im, force; { #ifdef CURSOR_MODE _rl_set_cursor (im, force); @@ -486,7 +589,8 @@ _rl_set_insert_mode (int im, int force __attribute__((unused))) /* Toggle overwrite mode. A positive explicit argument selects overwrite mode. A negative or zero explicit argument selects insert mode. */ int -rl_overwrite_mode (int count, int key __attribute__((unused))) +rl_overwrite_mode (count, key) + int count, key; { if (rl_explicit_arg == 0) _rl_set_insert_mode (rl_insert_mode ^ 1, 0); diff --git a/cmd-line-utils/readline/nls.c b/cmd-line-utils/readline/nls.c index 73ad0227195..bcee87561aa 100644 --- a/cmd-line-utils/readline/nls.c +++ b/cmd-line-utils/readline/nls.c @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> @@ -111,7 +113,7 @@ _rl_init_eightbit () if (lspec == 0 || *lspec == 0) lspec = setlocale (LC_CTYPE, (char *)NULL); if (lspec == 0) - lspec = (char*) ""; + lspec = ""; t = setlocale (LC_CTYPE, lspec); if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0)) diff --git a/cmd-line-utils/readline/parens.c b/cmd-line-utils/readline/parens.c index bb893ac1bfb..737f7675e93 100644 --- a/cmd-line-utils/readline/parens.c +++ b/cmd-line-utils/readline/parens.c @@ -27,7 +27,9 @@ #include "rlconf.h" -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> #include <sys/types.h> diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c index dd3724a86d7..c2b74006b05 100644 --- a/cmd-line-utils/readline/readline.c +++ b/cmd-line-utils/readline/readline.c @@ -1,7 +1,7 @@ /* readline.c -- a general facility for reading lines of input with emacs style editing and completion. */ -/* Copyright (C) 1987-2002 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -22,7 +22,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> #include "posixstat.h" @@ -47,6 +49,11 @@ #include <stdio.h> #include "posixjmp.h" +#include <errno.h> + +#if !defined (errno) +extern int errno; +#endif /* !errno */ /* System-specific feature definitions and include files. */ #include "rldefs.h" @@ -66,11 +73,11 @@ #include "xmalloc.h" #ifndef RL_LIBRARY_VERSION -# define RL_LIBRARY_VERSION "5.0" +# define RL_LIBRARY_VERSION "5.1" #endif #ifndef RL_READLINE_VERSION -# define RL_READLINE_VERSION 0x0500 +# define RL_READLINE_VERSION 0x0501 #endif extern void _rl_free_history_entry PARAMS((HIST_ENTRY *)); @@ -83,9 +90,10 @@ static void bind_arrow_keys_internal PARAMS((Keymap)); static void bind_arrow_keys PARAMS((void)); static void readline_default_bindings PARAMS((void)); -#ifdef NOT_USED static void reset_default_bindings PARAMS((void)); -#endif + +static int _rl_subseq_result PARAMS((int, Keymap, int, int)); +static int _rl_subseq_getchar PARAMS((int)); /* **************************************************************** */ /* */ @@ -104,6 +112,7 @@ int rl_gnu_readline_p = 1; By default, it is the standard emacs keymap. */ Keymap _rl_keymap = emacs_standard_keymap; + /* The current style of editing. */ int rl_editing_mode = emacs_mode; @@ -219,6 +228,9 @@ char *_rl_comment_begin; /* Keymap holding the function currently being executed. */ Keymap rl_executing_keymap; +/* Keymap we're currently using to dispatch. */ +Keymap _rl_dispatching_keymap; + /* Non-zero means to erase entire line, including prompt, on empty input lines. */ int rl_erase_empty_line = 0; @@ -230,6 +242,9 @@ int rl_num_chars_to_read; char *rl_line_buffer = (char *)NULL; int rl_line_buffer_len = 0; +/* Key sequence `contexts' */ +_rl_keyseq_cxt *_rl_kscxt = 0; + /* Forward declarations used by the display, termcap, and history code. */ /* **************************************************************** */ @@ -251,6 +266,10 @@ int _rl_convert_meta_chars_to_ascii = 1; rather than as a meta-prefixed escape sequence. */ int _rl_output_meta_chars = 0; +/* Non-zero means to look at the termios special characters and bind + them to equivalent readline functions at startup. */ +int _rl_bind_stty_chars = 1; + /* **************************************************************** */ /* */ /* Top Level Functions */ @@ -268,6 +287,7 @@ rl_set_prompt (prompt) { FREE (rl_prompt); rl_prompt = prompt ? savestring (prompt) : (char *)NULL; + rl_display_prompt = rl_prompt ? rl_prompt : ""; rl_visible_prompt_length = rl_expand_prompt (rl_prompt); return 0; @@ -291,14 +311,16 @@ readline (prompt) rl_set_prompt (prompt); rl_initialize (); - (*rl_prep_term_function) (_rl_meta_flag); + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); #if defined (HANDLE_SIGNALS) rl_set_signals (); #endif value = readline_internal (); - (*rl_deprep_term_function) (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); #if defined (HANDLE_SIGNALS) rl_clear_signals (); @@ -388,6 +410,36 @@ readline_internal_teardown (eof) return (eof ? (char *)NULL : savestring (the_line)); } +void +_rl_internal_char_cleanup () +{ +#if defined (VI_MODE) + /* In vi mode, when you exit insert mode, the cursor moves back + over the previous character. We explicitly check for that here. */ + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap) + rl_vi_check (); +#endif /* VI_MODE */ + + if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + rl_newline (1, '\n'); + } + + if (rl_done == 0) + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + } + + /* If the application writer has told us to erase the entire line if + the only character typed was something bound to rl_newline, do so. */ + if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && + rl_point == 0 && rl_end == 0) + _rl_erase_entire_line (); +} + STATIC_CALLBACK int #if defined (READLINE_CALLBACKS) readline_internal_char () @@ -410,12 +462,21 @@ readline_internal_charloop () code = setjmp (readline_top_level); if (code) - (*rl_redisplay_function) (); + { + (*rl_redisplay_function) (); + _rl_want_redisplay = 0; + /* If we get here, we're not being called from something dispatched + from _rl_callback_read_char(), which sets up its own value of + readline_top_level (saving and restoring the old, of course), so + we can just return here. */ + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); + } if (rl_pending_input == 0) { /* Then initialize the argument and number of keys read. */ - _rl_init_argument (); + _rl_reset_argument (); rl_key_sequence_length = 0; } @@ -423,6 +484,20 @@ readline_internal_charloop () c = rl_read_key (); RL_UNSETSTATE(RL_STATE_READCMD); + /* look at input.c:rl_getc() for the circumstances under which this will + be returned; punt immediately on read error without converting it to + a newline. */ + if (c == READERR) + { +#if defined (READLINE_CALLBACKS) + RL_SETSTATE(RL_STATE_DONE); + return (rl_done = 1); +#else + eof_found = 1; + break; +#endif + } + /* EOF typed to a non-blank line is a <NL>. */ if (c == EOF && rl_end) c = NEWLINE; @@ -449,27 +524,7 @@ readline_internal_charloop () if (rl_pending_input == 0 && lk == _rl_last_command_was_kill) _rl_last_command_was_kill = 0; -#if defined (VI_MODE) - /* In vi mode, when you exit insert mode, the cursor moves back - over the previous character. We explicitly check for that here. */ - if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap) - rl_vi_check (); -#endif /* VI_MODE */ - - if (rl_num_chars_to_read && rl_end >= rl_num_chars_to_read) - { - (*rl_redisplay_function) (); - rl_newline (1, '\n'); - } - - if (rl_done == 0) - (*rl_redisplay_function) (); - - /* If the application writer has told us to erase the entire line if - the only character typed was something bound to rl_newline, do so. */ - if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline && - rl_point == 0 && rl_end == 0) - _rl_erase_entire_line (); + _rl_internal_char_cleanup (); #if defined (READLINE_CALLBACKS) return 0; @@ -519,6 +574,107 @@ _rl_set_the_line () the_line = rl_line_buffer; } +#if defined (READLINE_CALLBACKS) +_rl_keyseq_cxt * +_rl_keyseq_cxt_alloc () +{ + _rl_keyseq_cxt *cxt; + + cxt = (_rl_keyseq_cxt *)xmalloc (sizeof (_rl_keyseq_cxt)); + + cxt->flags = cxt->subseq_arg = cxt->subseq_retval = 0; + + cxt->okey = 0; + cxt->ocxt = _rl_kscxt; + cxt->childval = 42; /* sentinel value */ + + return cxt; +} + +void +_rl_keyseq_cxt_dispose (cxt) + _rl_keyseq_cxt *cxt; +{ + free (cxt); +} + +void +_rl_keyseq_chain_dispose () +{ + _rl_keyseq_cxt *cxt; + + while (_rl_kscxt) + { + cxt = _rl_kscxt; + _rl_kscxt = _rl_kscxt->ocxt; + _rl_keyseq_cxt_dispose (cxt); + } +} +#endif + +static int +_rl_subseq_getchar (key) + int key; +{ + int k; + + if (key == ESC) + RL_SETSTATE(RL_STATE_METANEXT); + RL_SETSTATE(RL_STATE_MOREINPUT); + k = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + if (key == ESC) + RL_UNSETSTATE(RL_STATE_METANEXT); + + return k; +} + +#if defined (READLINE_CALLBACKS) +int +_rl_dispatch_callback (cxt) + _rl_keyseq_cxt *cxt; +{ + int nkey, r; + + /* For now */ +#if 1 + /* The first time this context is used, we want to read input and dispatch + on it. When traversing the chain of contexts back `up', we want to use + the value from the next context down. We're simulating recursion using + a chain of contexts. */ + if ((cxt->flags & KSEQ_DISPATCHED) == 0) + { + nkey = _rl_subseq_getchar (cxt->okey); + r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg); + cxt->flags |= KSEQ_DISPATCHED; + } + else + r = cxt->childval; +#else + r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg); +#endif + + /* For now */ + r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); + + if (r == 0) /* success! */ + { + _rl_keyseq_chain_dispose (); + RL_UNSETSTATE (RL_STATE_MULTIKEY); + return r; + } + + if (r != -3) /* magic value that says we added to the chain */ + _rl_kscxt = cxt->ocxt; + if (_rl_kscxt) + _rl_kscxt->childval = r; + if (r != -3) + _rl_keyseq_cxt_dispose (cxt); + + return r; +} +#endif /* READLINE_CALLBACKS */ + /* Do the command associated with KEY in MAP. If the associated command is really a keymap, then read another key, and dispatch into that map. */ @@ -527,6 +683,7 @@ _rl_dispatch (key, map) register int key; Keymap map; { + _rl_dispatching_keymap = map; return _rl_dispatch_subseq (key, map, 0); } @@ -539,6 +696,9 @@ _rl_dispatch_subseq (key, map, got_subseq) int r, newkey; char *macro; rl_command_func_t *func; +#if defined (READLINE_CALLBACKS) + _rl_keyseq_cxt *cxt; +#endif if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii) { @@ -572,13 +732,9 @@ _rl_dispatch_subseq (key, map, got_subseq) rl_executing_keymap = map; -#if 0 - _rl_suppress_redisplay = (map[key].function == rl_insert) && _rl_input_available (); -#endif - rl_dispatching = 1; RL_SETSTATE(RL_STATE_DISPATCHING); - r = (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); + (*map[key].function)(rl_numeric_arg * rl_arg_sign, key); RL_UNSETSTATE(RL_STATE_DISPATCHING); rl_dispatching = 0; @@ -607,6 +763,10 @@ _rl_dispatch_subseq (key, map, got_subseq) } else { +#if defined (READLINE_CALLBACKS) + RL_UNSETSTATE (RL_STATE_MULTIKEY); + _rl_keyseq_chain_dispose (); +#endif _rl_abort_internal (); return -1; } @@ -628,58 +788,43 @@ _rl_dispatch_subseq (key, map, got_subseq) #endif rl_key_sequence_length++; + _rl_dispatching_keymap = FUNCTION_TO_KEYMAP (map, key); - if (key == ESC) - RL_SETSTATE(RL_STATE_METANEXT); - RL_SETSTATE(RL_STATE_MOREINPUT); - newkey = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); - if (key == ESC) - RL_UNSETSTATE(RL_STATE_METANEXT); + /* Allocate new context here. Use linked contexts (linked through + cxt->ocxt) to simulate recursion */ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + /* Return 0 only the first time, to indicate success to + _rl_callback_read_char. The rest of the time, we're called + from _rl_dispatch_callback, so we return 3 to indicate + special handling is necessary. */ + r = RL_ISSTATE (RL_STATE_MULTIKEY) ? -3 : 0; + cxt = _rl_keyseq_cxt_alloc (); + + if (got_subseq) + cxt->flags |= KSEQ_SUBSEQ; + cxt->okey = key; + cxt->oldmap = map; + cxt->dmap = _rl_dispatching_keymap; + cxt->subseq_arg = got_subseq || cxt->dmap[ANYOTHERKEY].function; + + RL_SETSTATE (RL_STATE_MULTIKEY); + _rl_kscxt = cxt; + + return r; /* don't indicate immediate success */ + } +#endif + newkey = _rl_subseq_getchar (key); if (newkey < 0) { _rl_abort_internal (); return -1; } - r = _rl_dispatch_subseq (newkey, FUNCTION_TO_KEYMAP (map, key), got_subseq || map[ANYOTHERKEY].function); - - if (r == -2) - /* We didn't match anything, and the keymap we're indexed into - shadowed a function previously bound to that prefix. Call - the function. The recursive call to _rl_dispatch_subseq has - already taken care of pushing any necessary input back onto - the input queue with _rl_unget_char. */ - { -#if 0 - r = _rl_dispatch (ANYOTHERKEY, FUNCTION_TO_KEYMAP (map, key)); -#else - /* XXX - experimental code -- might never be executed. Save - for later. */ - Keymap m = FUNCTION_TO_KEYMAP (map, key); - int type = m[ANYOTHERKEY].type; - func = m[ANYOTHERKEY].function; - if (type == ISFUNC && func == rl_do_lowercase_version) - r = _rl_dispatch (_rl_to_lower (key), map); - else - r = _rl_dispatch (ANYOTHERKEY, m); -#endif - } - else if (r && map[ANYOTHERKEY].function) - { - /* We didn't match (r is probably -1), so return something to - tell the caller that it should try ANYOTHERKEY for an - overridden function. */ - _rl_unget_char (key); - return -2; - } - else if (r && got_subseq) - { - /* OK, back up the chain. */ - _rl_unget_char (key); - return -1; - } + r = _rl_dispatch_subseq (newkey, _rl_dispatching_keymap, got_subseq || map[ANYOTHERKEY].function); + return _rl_subseq_result (r, map, key, got_subseq); } else { @@ -703,9 +848,69 @@ _rl_dispatch_subseq (key, map, got_subseq) _rl_vi_textmod_command (key)) _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); #endif + return (r); } +static int +_rl_subseq_result (r, map, key, got_subseq) + int r; + Keymap map; + int key, got_subseq; +{ + Keymap m; + int type, nt; + rl_command_func_t *func, *nf; + + if (r == -2) + /* We didn't match anything, and the keymap we're indexed into + shadowed a function previously bound to that prefix. Call + the function. The recursive call to _rl_dispatch_subseq has + already taken care of pushing any necessary input back onto + the input queue with _rl_unget_char. */ + { + m = _rl_dispatching_keymap; + type = m[ANYOTHERKEY].type; + func = m[ANYOTHERKEY].function; + if (type == ISFUNC && func == rl_do_lowercase_version) + r = _rl_dispatch (_rl_to_lower (key), map); + else if (type == ISFUNC && func == rl_insert) + { + /* If the function that was shadowed was self-insert, we + somehow need a keymap with map[key].func == self-insert. + Let's use this one. */ + nt = m[key].type; + nf = m[key].function; + + m[key].type = type; + m[key].function = func; + r = _rl_dispatch (key, m); + m[key].type = nt; + m[key].function = nf; + } + else + r = _rl_dispatch (ANYOTHERKEY, m); + } + else if (r && map[ANYOTHERKEY].function) + { + /* We didn't match (r is probably -1), so return something to + tell the caller that it should try ANYOTHERKEY for an + overridden function. */ + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -2; + } + else if (r && got_subseq) + { + /* OK, back up the chain. */ + _rl_unget_char (key); + _rl_dispatching_keymap = map; + return -1; + } + + return r; +} + /* **************************************************************** */ /* */ /* Initializations */ @@ -863,19 +1068,21 @@ readline_initialize_everything () static void readline_default_bindings () { - rl_tty_set_default_bindings (_rl_keymap); + if (_rl_bind_stty_chars) + rl_tty_set_default_bindings (_rl_keymap); } /* Reset the default bindings for the terminal special characters we're interested in back to rl_insert and read the new ones. */ -#ifdef NOT_USED static void reset_default_bindings () { - rl_tty_unset_default_bindings (_rl_keymap); - rl_tty_set_default_bindings (_rl_keymap); + if (_rl_bind_stty_chars) + { + rl_tty_unset_default_bindings (_rl_keymap); + rl_tty_set_default_bindings (_rl_keymap); + } } -#endif /* Bind some common arrow key sequences in MAP. */ static void @@ -908,6 +1115,13 @@ bind_arrow_keys_internal (map) rl_bind_keyseq_if_unbound ("\033OH", rl_beg_of_line); rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line); +#if defined (__MINGW32__) + rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history); + rl_bind_keyseq_if_unbound ("\340P", rl_get_next_history); + rl_bind_keyseq_if_unbound ("\340M", rl_forward_char); + rl_bind_keyseq_if_unbound ("\340K", rl_backward_char); +#endif + _rl_keymap = xkeymap; } diff --git a/cmd-line-utils/readline/readline.h b/cmd-line-utils/readline/readline.h index 222b317c4a8..b71bf98d204 100644 --- a/cmd-line-utils/readline/readline.h +++ b/cmd-line-utils/readline/readline.h @@ -1,6 +1,6 @@ /* Readline.h -- the names of functions callable from within readline. */ -/* Copyright (C) 1987-2004 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -40,9 +40,9 @@ extern "C" { #endif /* Hex-encoded Readline version number. */ -#define RL_READLINE_VERSION 0x0500 /* Readline 5.0 */ +#define RL_READLINE_VERSION 0x0502 /* Readline 5.2 */ #define RL_VERSION_MAJOR 5 -#define RL_VERSION_MINOR 0 +#define RL_VERSION_MINOR 2 /* Readline data structures. */ @@ -241,6 +241,7 @@ extern int rl_vi_column PARAMS((int, int)); extern int rl_vi_delete_to PARAMS((int, int)); extern int rl_vi_change_to PARAMS((int, int)); extern int rl_vi_yank_to PARAMS((int, int)); +extern int rl_vi_rubout PARAMS((int, int)); extern int rl_vi_delete PARAMS((int, int)); extern int rl_vi_back_to_indent PARAMS((int, int)); extern int rl_vi_first_print PARAMS((int, int)); @@ -302,6 +303,8 @@ extern int rl_bind_keyseq_in_map PARAMS((const char *, rl_command_func_t *, Keym extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *)); extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap)); extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap)); + +extern char *rl_variable_value PARAMS((const char *)); extern int rl_variable_bind PARAMS((const char *, const char *)); /* Backwards compatibility, use rl_bind_keyseq_in_map instead. */ @@ -401,6 +404,7 @@ extern int rl_reset_terminal PARAMS((const char *)); extern void rl_resize_terminal PARAMS((void)); extern void rl_set_screen_size PARAMS((int, int)); extern void rl_get_screen_size PARAMS((int *, int *)); +extern void rl_reset_screen_size PARAMS((void)); extern char *rl_get_termcap PARAMS((const char *)); @@ -528,6 +532,11 @@ extern const char *rl_terminal_name; extern FILE *rl_instream; extern FILE *rl_outstream; +/* If non-zero, Readline gives values of LINES and COLUMNS from the environment + greater precedence than values fetched from the kernel when computing the + screen dimensions. */ +extern int rl_prefer_env_winsize; + /* If non-zero, then this is the address of a function to call just before readline_internal () prints the first prompt. */ extern rl_hook_func_t *rl_startup_hook; @@ -748,6 +757,10 @@ extern int rl_ignore_completion_duplicates; completion character will be inserted as any other. */ extern int rl_inhibit_completion; +/* Input error; can be returned by (*rl_getc_function) if readline is reading + a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */ +#define READERR (-2) + /* Definitions available for use by readline clients. */ #define RL_PROMPT_START_IGNORE '\001' #define RL_PROMPT_END_IGNORE '\002' @@ -759,29 +772,33 @@ extern int rl_inhibit_completion; #define MULT_MATCH 2 /* Possible state values for rl_readline_state */ -#define RL_STATE_NONE 0x00000 /* no state; before first call */ - -#define RL_STATE_INITIALIZING 0x00001 /* initializing */ -#define RL_STATE_INITIALIZED 0x00002 /* initialization done */ -#define RL_STATE_TERMPREPPED 0x00004 /* terminal is prepped */ -#define RL_STATE_READCMD 0x00008 /* reading a command key */ -#define RL_STATE_METANEXT 0x00010 /* reading input after ESC */ -#define RL_STATE_DISPATCHING 0x00020 /* dispatching to a command */ -#define RL_STATE_MOREINPUT 0x00040 /* reading more input in a command function */ -#define RL_STATE_ISEARCH 0x00080 /* doing incremental search */ -#define RL_STATE_NSEARCH 0x00100 /* doing non-inc search */ -#define RL_STATE_SEARCH 0x00200 /* doing a history search */ -#define RL_STATE_NUMERICARG 0x00400 /* reading numeric argument */ -#define RL_STATE_MACROINPUT 0x00800 /* getting input from a macro */ -#define RL_STATE_MACRODEF 0x01000 /* defining keyboard macro */ -#define RL_STATE_OVERWRITE 0x02000 /* overwrite mode */ -#define RL_STATE_COMPLETING 0x04000 /* doing completion */ -#define RL_STATE_SIGHANDLER 0x08000 /* in readline sighandler */ -#define RL_STATE_UNDOING 0x10000 /* doing an undo */ -#define RL_STATE_INPUTPENDING 0x20000 /* rl_execute_next called */ -#define RL_STATE_TTYCSAVED 0x40000 /* tty special chars saved */ - -#define RL_STATE_DONE 0x80000 /* done; accepted line */ +#define RL_STATE_NONE 0x000000 /* no state; before first call */ + +#define RL_STATE_INITIALIZING 0x000001 /* initializing */ +#define RL_STATE_INITIALIZED 0x000002 /* initialization done */ +#define RL_STATE_TERMPREPPED 0x000004 /* terminal is prepped */ +#define RL_STATE_READCMD 0x000008 /* reading a command key */ +#define RL_STATE_METANEXT 0x000010 /* reading input after ESC */ +#define RL_STATE_DISPATCHING 0x000020 /* dispatching to a command */ +#define RL_STATE_MOREINPUT 0x000040 /* reading more input in a command function */ +#define RL_STATE_ISEARCH 0x000080 /* doing incremental search */ +#define RL_STATE_NSEARCH 0x000100 /* doing non-inc search */ +#define RL_STATE_SEARCH 0x000200 /* doing a history search */ +#define RL_STATE_NUMERICARG 0x000400 /* reading numeric argument */ +#define RL_STATE_MACROINPUT 0x000800 /* getting input from a macro */ +#define RL_STATE_MACRODEF 0x001000 /* defining keyboard macro */ +#define RL_STATE_OVERWRITE 0x002000 /* overwrite mode */ +#define RL_STATE_COMPLETING 0x004000 /* doing completion */ +#define RL_STATE_SIGHANDLER 0x008000 /* in readline sighandler */ +#define RL_STATE_UNDOING 0x010000 /* doing an undo */ +#define RL_STATE_INPUTPENDING 0x020000 /* rl_execute_next called */ +#define RL_STATE_TTYCSAVED 0x040000 /* tty special chars saved */ +#define RL_STATE_CALLBACK 0x080000 /* using the callback interface */ +#define RL_STATE_VIMOTION 0x100000 /* reading vi motion arg */ +#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */ +#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */ + +#define RL_STATE_DONE 0x800000 /* done; accepted line */ #define RL_SETSTATE(x) (rl_readline_state |= (x)) #define RL_UNSETSTATE(x) (rl_readline_state &= ~(x)) diff --git a/cmd-line-utils/readline/rlconf.h b/cmd-line-utils/readline/rlconf.h index c651fd8b41f..ff3929e0bf5 100644 --- a/cmd-line-utils/readline/rlconf.h +++ b/cmd-line-utils/readline/rlconf.h @@ -37,9 +37,12 @@ /* Ugly but working hack for binding prefix meta. */ #define PREFIX_META_HACK -/* The final, last-ditch effort file name for an init file. */ +/* The next-to-last-ditch effort file name for a user-specific init file. */ #define DEFAULT_INPUTRC "~/.inputrc" +/* The ultimate last-ditch filenname for an init file -- system-wide. */ +#define SYS_INPUTRC "/etc/inputrc" + /* If defined, expand tabs to spaces. */ #define DISPLAY_TABS diff --git a/cmd-line-utils/readline/rldefs.h b/cmd-line-utils/readline/rldefs.h index 0d600407b5f..0f6c87446dd 100644 --- a/cmd-line-utils/readline/rldefs.h +++ b/cmd-line-utils/readline/rldefs.h @@ -2,7 +2,7 @@ for readline. This should be included after any files that define system-specific constants like _POSIX_VERSION or USG. */ -/* Copyright (C) 1987,1989 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file contains the Readline Library (the Library), a set of routines for providing Emacs style line input to programs that ask @@ -38,7 +38,11 @@ # if defined (HAVE_TERMIO_H) # define TERMIO_TTY_DRIVER # else -# define NEW_TTY_DRIVER +# if !defined (__MINGW32__) +# define NEW_TTY_DRIVER +# else +# define NO_TTY_DRIVER +# endif # endif #endif diff --git a/cmd-line-utils/readline/rlmbutil.h b/cmd-line-utils/readline/rlmbutil.h index 77cc026e3e8..dd317e2a090 100644 --- a/cmd-line-utils/readline/rlmbutil.h +++ b/cmd-line-utils/readline/rlmbutil.h @@ -32,10 +32,19 @@ /* For platforms which support the ISO C amendement 1 functionality we support user defined character classes. */ /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ -#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) +#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H) # include <wchar.h> # include <wctype.h> -# if defined (HAVE_MBSRTOWCS) && defined (HAVE_MBRTOWC) && defined (HAVE_MBRLEN) && defined (HAVE_WCWIDTH) +# if defined (HAVE_ISWCTYPE) && \ + defined (HAVE_ISWLOWER) && \ + defined (HAVE_ISWUPPER) && \ + defined (HAVE_MBSRTOWCS) && \ + defined (HAVE_MBRTOWC) && \ + defined (HAVE_MBRLEN) && \ + defined (HAVE_TOWLOWER) && \ + defined (HAVE_TOWUPPER) && \ + defined (HAVE_WCHAR_T) && \ + defined (HAVE_WCWIDTH) /* system is supposed to support XPG5 */ # define HANDLE_MULTIBYTE 1 # endif @@ -97,6 +106,21 @@ extern int _rl_read_mbstring PARAMS((int, char *, int)); extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); +extern wchar_t _rl_char_value PARAMS((char *, int)); +extern int _rl_walphabetic PARAMS((wchar_t)); + +#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc)) +#define _rl_to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc)) + +#define MB_NEXTCHAR(b,s,c,f) \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ + ? _rl_find_next_mbchar ((b), (s), (c), (f)) \ + : ((s) + (c))) +#define MB_PREVCHAR(b,s,f) \ + ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ + ? _rl_find_prev_mbchar ((b), (s), (f)) \ + : ((s) - 1)) + #define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2) #define MB_NULLWCH(x) ((x) == 0) @@ -111,6 +135,16 @@ extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); #define _rl_find_prev_mbchar(b, i, f) (((i) == 0) ? (i) : ((i) - 1)) #define _rl_find_next_mbchar(b, i1, i2, f) ((i1) + (i2)) +#define _rl_char_value(buf,ind) ((buf)[(ind)]) + +#define _rl_walphabetic(c) (rl_alphabetic (c)) + +#define _rl_to_wupper(c) (_rl_to_upper (c)) +#define _rl_to_wlower(c) (_rl_to_lower (c)) + +#define MB_NEXTCHAR(b,s,c,f) ((s) + (c)) +#define MB_PREVCHAR(b,s,f) ((s) - 1) + #define MB_INVALIDCH(x) (0) #define MB_NULLWCH(x) (0) diff --git a/cmd-line-utils/readline/rlprivate.h b/cmd-line-utils/readline/rlprivate.h index c3cee917b76..64aa7bdd3fa 100644 --- a/cmd-line-utils/readline/rlprivate.h +++ b/cmd-line-utils/readline/rlprivate.h @@ -1,7 +1,7 @@ /* rlprivate.h -- functions and variables global to the readline library, but not intended for use by applications. */ -/* Copyright (C) 1999-2004 Free Software Foundation, Inc. +/* Copyright (C) 1999-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -30,6 +30,95 @@ /************************************************************************* * * + * Global structs undocumented in texinfo manual and not in readline.h * + * * + *************************************************************************/ +/* search types */ +#define RL_SEARCH_ISEARCH 0x01 /* incremental search */ +#define RL_SEARCH_NSEARCH 0x02 /* non-incremental search */ +#define RL_SEARCH_CSEARCH 0x04 /* intra-line char search */ + +/* search flags */ +#define SF_REVERSE 0x01 +#define SF_FOUND 0x02 +#define SF_FAILED 0x04 + +typedef struct __rl_search_context +{ + int type; + int sflags; + + char *search_string; + int search_string_index; + int search_string_size; + + char **lines; + char *allocated_line; + int hlen; + int hindex; + + int save_point; + int save_mark; + int save_line; + int last_found_line; + char *prev_line_found; + + UNDO_LIST *save_undo_list; + + int history_pos; + int direction; + + int lastc; +#if defined (HANDLE_MULTIBYTE) + char mb[MB_LEN_MAX]; +#endif + + char *sline; + int sline_len; + int sline_index; + + char *search_terminators; +} _rl_search_cxt; + +/* Callback data for reading numeric arguments */ +#define NUM_SAWMINUS 0x01 +#define NUM_SAWDIGITS 0x02 +#define NUM_READONE 0x04 + +typedef int _rl_arg_cxt; + +/* A context for reading key sequences longer than a single character when + using the callback interface. */ +#define KSEQ_DISPATCHED 0x01 +#define KSEQ_SUBSEQ 0x02 +#define KSEQ_RECURSIVE 0x04 + +typedef struct __rl_keyseq_context +{ + int flags; + int subseq_arg; + int subseq_retval; /* XXX */ + Keymap dmap; + + Keymap oldmap; + int okey; + struct __rl_keyseq_context *ocxt; + int childval; +} _rl_keyseq_cxt; + + /* fill in more as needed */ +/* `Generic' callback data and functions */ +typedef struct __rl_callback_generic_arg +{ + int count; + int i1, i2; + /* add here as needed */ +} _rl_callback_generic_arg; + +typedef int _rl_callback_func_t PARAMS((_rl_callback_generic_arg *)); + +/************************************************************************* + * * * Global functions undocumented in texinfo manual and not in readline.h * * * *************************************************************************/ @@ -54,6 +143,8 @@ extern int readline_echoing_p; extern int rl_key_sequence_length; extern int rl_byte_oriented; +extern _rl_keyseq_cxt *_rl_kscxt; + /* display.c */ extern int rl_display_fixed; @@ -100,6 +191,16 @@ extern void readline_internal_setup PARAMS((void)); extern char *readline_internal_teardown PARAMS((int)); extern int readline_internal_char PARAMS((void)); +extern _rl_keyseq_cxt *_rl_keyseq_cxt_alloc PARAMS((void)); +extern void _rl_keyseq_cxt_dispose PARAMS((_rl_keyseq_cxt *)); +extern void _rl_keyseq_chain_dispose PARAMS((void)); + +extern int _rl_dispatch_callback PARAMS((_rl_keyseq_cxt *)); + +/* callback.c */ +extern _rl_callback_generic_arg *_rl_callback_data_alloc PARAMS((int)); +extern void _rl_callback_data_dispose PARAMS((_rl_callback_generic_arg *)); + #endif /* READLINE_CALLBACKS */ /* bind.c */ @@ -132,6 +233,15 @@ extern void _rl_insert_typein PARAMS((int)); extern int _rl_unget_char PARAMS((int)); extern int _rl_pushed_input_available PARAMS((void)); +/* isearch.c */ +extern _rl_search_cxt *_rl_scxt_alloc PARAMS((int, int)); +extern void _rl_scxt_dispose PARAMS((_rl_search_cxt *, int)); + +extern int _rl_isearch_dispatch PARAMS((_rl_search_cxt *, int)); +extern int _rl_isearch_callback PARAMS((_rl_search_cxt *)); + +extern int _rl_search_getchar PARAMS((_rl_search_cxt *)); + /* macro.c */ extern void _rl_with_macro_input PARAMS((char *)); extern int _rl_next_macro_key PARAMS((void)); @@ -141,7 +251,12 @@ extern void _rl_add_macro_char PARAMS((int)); extern void _rl_kill_kbd_macro PARAMS((void)); /* misc.c */ -extern int _rl_init_argument PARAMS((void)); +extern int _rl_arg_overflow PARAMS((void)); +extern void _rl_arg_init PARAMS((void)); +extern int _rl_arg_getchar PARAMS((void)); +extern int _rl_arg_callback PARAMS((_rl_arg_cxt)); +extern void _rl_reset_argument PARAMS((void)); + extern void _rl_start_using_history PARAMS((void)); extern int _rl_free_saved_history_line PARAMS((void)); extern void _rl_set_insert_mode PARAMS((int, int)); @@ -157,11 +272,15 @@ extern void _rl_init_line_state PARAMS((void)); extern void _rl_set_the_line PARAMS((void)); extern int _rl_dispatch PARAMS((int, Keymap)); extern int _rl_dispatch_subseq PARAMS((int, Keymap, int)); +extern void _rl_internal_char_cleanup PARAMS((void)); /* rltty.c */ extern int _rl_disable_tty_signals PARAMS((void)); extern int _rl_restore_tty_signals PARAMS((void)); +/* search.c */ +extern int _rl_nsearch_callback PARAMS((_rl_search_cxt *)); + /* terminal.c */ extern void _rl_get_screen_size PARAMS((int, int)); extern int _rl_init_terminal_io PARAMS((const char *)); @@ -190,6 +309,10 @@ extern int _rl_char_search_internal PARAMS((int, int, int)); #endif extern int _rl_set_mark_at_pos PARAMS((int)); +/* undo.c */ +extern UNDO_LIST *_rl_copy_undo_entry PARAMS((UNDO_LIST *)); +extern UNDO_LIST *_rl_copy_undo_list PARAMS((UNDO_LIST *)); + /* util.c */ extern int _rl_abort_internal PARAMS((void)); extern char *_rl_strindex PARAMS((const char *, const char *)); @@ -217,6 +340,10 @@ extern void _rl_vi_done_inserting PARAMS((void)); extern const char *_rl_possible_control_prefixes[]; extern const char *_rl_possible_meta_prefixes[]; +/* callback.c */ +extern _rl_callback_func_t *_rl_callback_func; +extern _rl_callback_generic_arg *_rl_callback_data; + /* complete.c */ extern int _rl_complete_show_all; extern int _rl_complete_show_unmodified; @@ -231,11 +358,14 @@ extern int _rl_page_completions; extern int _rl_vis_botlin; extern int _rl_last_c_pos; extern int _rl_suppress_redisplay; +extern int _rl_want_redisplay; extern char *rl_display_prompt; /* isearch.c */ extern char *_rl_isearch_terminators; +extern _rl_search_cxt *_rl_iscxt; + /* macro.c */ extern char *_rl_executing_macro; @@ -243,6 +373,8 @@ extern char *_rl_executing_macro; extern int _rl_history_preserve_point; extern int _rl_history_saved_point; +extern _rl_arg_cxt _rl_argcxt; + /* readline.c */ extern int _rl_horizontal_scroll_mode; extern int _rl_mark_modified_lines; @@ -250,6 +382,7 @@ extern int _rl_bell_preference; extern int _rl_meta_flag; extern int _rl_convert_meta_chars_to_ascii; extern int _rl_output_meta_chars; +extern int _rl_bind_stty_chars; extern char *_rl_comment_begin; extern unsigned char _rl_parsing_conditionalized_out; extern Keymap _rl_keymap; @@ -259,6 +392,9 @@ extern int _rl_last_command_was_kill; extern int _rl_eof_char; extern procenv_t readline_top_level; +/* search.c */ +extern _rl_search_cxt *_rl_nscxt; + /* terminal.c */ extern int _rl_enable_keypad; extern int _rl_enable_meta; @@ -272,6 +408,7 @@ extern char *_rl_term_up; extern char *_rl_term_dc; extern char *_rl_term_cr; extern char *_rl_term_IC; +extern char *_rl_term_forward_char; extern int _rl_screenheight; extern int _rl_screenwidth; extern int _rl_screenchars; diff --git a/cmd-line-utils/readline/rltty.c b/cmd-line-utils/readline/rltty.c index 869538af9ab..12f3a93e524 100644 --- a/cmd-line-utils/readline/rltty.c +++ b/cmd-line-utils/readline/rltty.c @@ -1,7 +1,7 @@ /* rltty.c -- functions to prepare and restore the terminal for readline's use. */ -/* Copyright (C) 1992 Free Software Foundation, Inc. +/* Copyright (C) 1992-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -22,7 +22,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> #include <signal.h> @@ -149,7 +151,9 @@ set_winsize (int tty __attribute__((unused))) #endif /* TIOCGWINSZ */ } -#if defined (NEW_TTY_DRIVER) +#if defined (NO_TTY_DRIVER) +/* Nothing */ +#elif defined (NEW_TTY_DRIVER) /* Values for the `flags' field of a struct bsdtty. This tells which elements of the struct bsdtty have been fetched from the system and @@ -230,6 +234,7 @@ get_tty_settings (tty, tiop) tiop->flags = tiop->lflag = 0; + errno = 0; if (ioctl (tty, TIOCGETP, &(tiop->sgttyb)) < 0) return -1; tiop->flags |= SGTTY_SET; @@ -515,6 +520,7 @@ get_tty_settings (tty, tiop) { set_winsize (tty); + errno = 0; if (_get_tty_settings (tty, tiop) < 0) return -1; @@ -628,9 +634,23 @@ prepare_terminal_settings (meta_flag, oldtio, tiop) #endif /* TERMIOS_TTY_DRIVER && _POSIX_VDISABLE */ } -#endif /* NEW_TTY_DRIVER */ +#endif /* !NEW_TTY_DRIVER */ /* Put the terminal in CBREAK mode so that we can detect key presses. */ +#if defined (NO_TTY_DRIVER) +void +rl_prep_terminal (meta_flag) + int meta_flag; +{ + readline_echoing_p = 1; +} + +void +rl_deprep_terminal () +{ +} + +#else /* ! NO_TTY_DRIVER */ void rl_prep_terminal (meta_flag) int meta_flag; @@ -648,16 +668,43 @@ rl_prep_terminal (meta_flag) if (get_tty_settings (tty, &tio) < 0) { +#if defined (ENOTSUP) + /* MacOS X, at least, lies about the value of errno if tcgetattr fails. */ + if (errno == ENOTTY || errno == ENOTSUP) +#else + if (errno == ENOTTY) +#endif + readline_echoing_p = 1; /* XXX */ release_sigint (); return; } otio = tio; - rl_tty_unset_default_bindings (_rl_keymap); + if (_rl_bind_stty_chars) + { +#if defined (VI_MODE) + /* If editing in vi mode, make sure we restore the bindings in the + insertion keymap no matter what keymap we ended up in. */ + if (rl_editing_mode == vi_mode) + rl_tty_unset_default_bindings (vi_insertion_keymap); + else +#endif + rl_tty_unset_default_bindings (_rl_keymap); + } save_tty_chars (&otio); RL_SETSTATE(RL_STATE_TTYCSAVED); - _rl_bind_tty_special_chars (_rl_keymap, tio); + if (_rl_bind_stty_chars) + { +#if defined (VI_MODE) + /* If editing in vi mode, make sure we set the bindings in the + insertion keymap no matter what keymap we ended up in. */ + if (rl_editing_mode == vi_mode) + _rl_bind_tty_special_chars (vi_insertion_keymap, tio); + else +#endif + _rl_bind_tty_special_chars (_rl_keymap, tio); + } prepare_terminal_settings (meta_flag, otio, &tio); @@ -707,6 +754,7 @@ rl_deprep_terminal () release_sigint (); } +#endif /* !NO_TTY_DRIVER */ /* **************************************************************** */ /* */ @@ -715,8 +763,13 @@ rl_deprep_terminal () /* **************************************************************** */ int -rl_restart_output(int count __attribute__((unused)), int key __attribute__((unused))) +rl_restart_output (count, key) + int count, key; { +#if defined (__MINGW32__) + return 0; +#else /* !__MING32__ */ + int fildes = fileno (rl_outstream); #if defined (TIOCSTART) #if defined (apollo) @@ -744,11 +797,17 @@ rl_restart_output(int count __attribute__((unused)), int key __attribute__((unus #endif /* !TIOCSTART */ return 0; +#endif /* !__MINGW32__ */ } int -rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused))) +rl_stop_output (count, key) + int count, key; { +#if defined (__MINGW32__) + return 0; +#else + int fildes = fileno (rl_instream); #if defined (TIOCSTOP) @@ -771,6 +830,7 @@ rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused) #endif /* !TIOCSTOP */ return 0; +#endif /* !__MINGW32__ */ } /* **************************************************************** */ @@ -779,9 +839,16 @@ rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused) /* */ /* **************************************************************** */ +#if !defined (NO_TTY_DRIVER) #define SET_SPECIAL(sc, func) set_special_char(kmap, &ttybuff, sc, func) +#endif -#if defined (NEW_TTY_DRIVER) +#if defined (NO_TTY_DRIVER) + +#define SET_SPECIAL(sc, func) +#define RESET_SPECIAL(c) + +#elif defined (NEW_TTY_DRIVER) static void set_special_char (kmap, tiop, sc, func) Keymap kmap; @@ -862,6 +929,7 @@ void rltty_set_default_bindings (kmap) Keymap kmap; { +#if !defined (NO_TTY_DRIVER) TIOTYPE ttybuff; int tty; @@ -869,6 +937,7 @@ rltty_set_default_bindings (kmap) if (get_tty_settings (tty, &ttybuff) == 0) _rl_bind_tty_special_chars (kmap, ttybuff); +#endif } /* New public way to set the system default editing chars to their readline @@ -906,7 +975,7 @@ rl_tty_unset_default_bindings (kmap) #if defined (HANDLE_SIGNALS) -#if defined (NEW_TTY_DRIVER) +#if defined (NEW_TTY_DRIVER) || defined (NO_TTY_DRIVER) int _rl_disable_tty_signals () { diff --git a/cmd-line-utils/readline/savestring.c b/cmd-line-utils/readline/savestring.c index ae605374d13..820428d8881 100644 --- a/cmd-line-utils/readline/savestring.c +++ b/cmd-line-utils/readline/savestring.c @@ -21,8 +21,7 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" - +#include <config.h> #ifdef HAVE_STRING_H # include <string.h> #endif diff --git a/cmd-line-utils/readline/search.c b/cmd-line-utils/readline/search.c index 6479427be2f..33cc4fc1e73 100644 --- a/cmd-line-utils/readline/search.c +++ b/cmd-line-utils/readline/search.c @@ -1,6 +1,6 @@ /* search.c - code for non-incremental searching in emacs and vi modes. */ -/* Copyright (C) 1992 Free Software Foundation, Inc. +/* Copyright (C) 1992-2005 Free Software Foundation, Inc. This file is part of the Readline Library (the Library), a set of routines for providing Emacs style line input to programs that ask @@ -22,7 +22,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> #include <stdio.h> @@ -51,6 +53,8 @@ #endif #define abs(x) (((x) >= 0) ? (x) : -(x)) +_rl_search_cxt *_rl_nscxt = 0; + extern HIST_ENTRY *_rl_saved_line_for_history; /* Functions imported from the rest of the library. */ @@ -68,11 +72,16 @@ static int history_string_size; static void make_history_line_current PARAMS((HIST_ENTRY *)); static int noninc_search_from_pos PARAMS((char *, int, int)); -static void noninc_dosearch PARAMS((char *, int)); -static void noninc_search PARAMS((int, int)); +static int noninc_dosearch PARAMS((char *, int)); +static int noninc_search PARAMS((int, int)); static int rl_history_search_internal PARAMS((int, int)); static void rl_history_search_reinit PARAMS((void)); +static _rl_search_cxt *_rl_nsearch_init PARAMS((int, int)); +static int _rl_nsearch_cleanup PARAMS((_rl_search_cxt *, int)); +static void _rl_nsearch_abort PARAMS((_rl_search_cxt *)); +static int _rl_nsearch_dispatch PARAMS((_rl_search_cxt *, int)); + /* Make the data from the history entry ENTRY be the contents of the current line. This doesn't do anything with rl_point; the caller must set it. */ @@ -80,12 +89,15 @@ static void make_history_line_current (entry) HIST_ENTRY *entry; { -#if 0 - rl_replace_line (entry->line, 1); - rl_undo_list = (UNDO_LIST *)entry->data; -#else _rl_replace_text (entry->line, 0, rl_end); _rl_fix_point (1); +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + /* POSIX.2 says that the `U' command doesn't affect the copy of any + command lines to the edit line. We're going to implement that by + making the undo list start after the matching line is copied to the + current editing buffer. */ + rl_free_undo_list (); #endif if (_rl_saved_line_for_history) @@ -128,8 +140,8 @@ noninc_search_from_pos (string, pos, dir) /* Search for a line in the history containing STRING. If DIR is < 0, the search is backwards through previous entries, else through subsequent - entries. */ -static void + entries. Returns 1 if the search was successful, 0 otherwise. */ +static int noninc_dosearch (string, dir) char *string; int dir; @@ -140,7 +152,7 @@ noninc_dosearch (string, dir) if (string == 0 || *string == '\0' || noninc_history_pos < 0) { rl_ding (); - return; + return 0; } pos = noninc_search_from_pos (string, noninc_history_pos + dir, dir); @@ -151,7 +163,7 @@ noninc_dosearch (string, dir) rl_clear_message (); rl_point = 0; rl_ding (); - return; + return 0; } noninc_history_pos = pos; @@ -162,7 +174,7 @@ noninc_dosearch (string, dir) #if defined (VI_MODE) if (rl_editing_mode != vi_mode) #endif - history_set_pos (oldpos); + history_set_pos (oldpos); make_history_line_current (entry); @@ -170,27 +182,24 @@ noninc_dosearch (string, dir) rl_mark = rl_end; rl_clear_message (); + return 1; } -/* Search non-interactively through the history list. DIR < 0 means to - search backwards through the history of previous commands; otherwise - the search is for commands subsequent to the current position in the - history list. PCHAR is the character to use for prompting when reading - the search string; if not specified (0), it defaults to `:'. */ -static void -noninc_search (dir, pchar) - int dir; - int pchar; +static _rl_search_cxt * +_rl_nsearch_init (dir, pchar) + int dir, pchar; { - int saved_point, saved_mark, c; + _rl_search_cxt *cxt; char *p; -#if defined (HANDLE_MULTIBYTE) - char mb[MB_LEN_MAX]; -#endif + + cxt = _rl_scxt_alloc (RL_SEARCH_NSEARCH, 0); + if (dir < 0) + cxt->sflags |= SF_REVERSE; /* not strictly needed */ + + cxt->direction = dir; + cxt->history_pos = cxt->save_line; rl_maybe_save_line (); - saved_point = rl_point; - saved_mark = rl_mark; /* Clear the undo list, since reading the search string should create its own undo list, and the whole list will end up being freed when we @@ -202,152 +211,243 @@ noninc_search (dir, pchar) rl_end = rl_point = 0; p = _rl_make_prompt_for_search (pchar ? pchar : ':'); - rl_message (p, 0, 0); + rl_message ("%s", p, 0); free (p); -#define SEARCH_RETURN rl_restore_prompt (); RL_UNSETSTATE(RL_STATE_NSEARCH); return - RL_SETSTATE(RL_STATE_NSEARCH); - /* Read the search string. */ - while (1) + + _rl_nscxt = cxt; + + return cxt; +} + +static int +_rl_nsearch_cleanup (cxt, r) + _rl_search_cxt *cxt; + int r; +{ + _rl_scxt_dispose (cxt, 0); + _rl_nscxt = 0; + + RL_UNSETSTATE(RL_STATE_NSEARCH); + + return (r != 1); +} + +static void +_rl_nsearch_abort (cxt) + _rl_search_cxt *cxt; +{ + rl_maybe_unsave_line (); + rl_clear_message (); + rl_point = cxt->save_point; + rl_mark = cxt->save_mark; + rl_restore_prompt (); + + RL_UNSETSTATE (RL_STATE_NSEARCH); +} + +/* Process just-read character C according to search context CXT. Return -1 + if the caller should abort the search, 0 if we should break out of the + loop, and 1 if we should continue to read characters. */ +static int +_rl_nsearch_dispatch (cxt, c) + _rl_search_cxt *cxt; + int c; +{ + switch (c) { - RL_SETSTATE(RL_STATE_MOREINPUT); - c = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); + case CTRL('W'): + rl_unix_word_rubout (1, c); + break; -#if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - c = _rl_read_mbstring (c, mb, MB_LEN_MAX); -#endif + case CTRL('U'): + rl_unix_line_discard (1, c); + break; - if (c == 0) - break; + case RETURN: + case NEWLINE: + return 0; - switch (c) + case CTRL('H'): + case RUBOUT: + if (rl_point == 0) { - case CTRL('H'): - case RUBOUT: - if (rl_point == 0) - { - rl_maybe_unsave_line (); - rl_clear_message (); - rl_point = saved_point; - rl_mark = saved_mark; - SEARCH_RETURN; - } - _rl_rubout_char (1, c); - break; - - case CTRL('W'): - rl_unix_word_rubout (1, c); - break; - - case CTRL('U'): - rl_unix_line_discard (1, c); - break; - - case RETURN: - case NEWLINE: - goto dosearch; - /* NOTREACHED */ - break; - - case CTRL('C'): - case CTRL('G'): - rl_maybe_unsave_line (); - rl_clear_message (); - rl_point = saved_point; - rl_mark = saved_mark; - rl_ding (); - SEARCH_RETURN; + _rl_nsearch_abort (cxt); + return -1; + } + _rl_rubout_char (1, c); + break; + + case CTRL('C'): + case CTRL('G'): + rl_ding (); + _rl_nsearch_abort (cxt); + return -1; - default: + default: #if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - rl_insert_text (mb); - else + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_insert_text (cxt->mb); + else #endif - _rl_insert_char (1, c); - break; - } - (*rl_redisplay_function) (); + _rl_insert_char (1, c); + break; } - dosearch: - rl_mark = saved_mark; + (*rl_redisplay_function) (); + return 1; +} + +/* Perform one search according to CXT, using NONINC_SEARCH_STRING. Return + -1 if the search should be aborted, any other value means to clean up + using _rl_nsearch_cleanup (). Returns 1 if the search was successful, + 0 otherwise. */ +static int +_rl_nsearch_dosearch (cxt) + _rl_search_cxt *cxt; +{ + rl_mark = cxt->save_mark; /* If rl_point == 0, we want to re-use the previous search string and start from the saved history position. If there's no previous search string, punt. */ if (rl_point == 0) { - if (!noninc_search_string) + if (noninc_search_string == 0) { rl_ding (); - SEARCH_RETURN; + rl_restore_prompt (); + RL_UNSETSTATE (RL_STATE_NSEARCH); + return -1; } } else { /* We want to start the search from the current history position. */ - noninc_history_pos = where_history (); + noninc_history_pos = cxt->save_line; FREE (noninc_search_string); noninc_search_string = savestring (rl_line_buffer); + + /* If we don't want the subsequent undo list generated by the search + matching a history line to include the contents of the search string, + we need to clear rl_line_buffer here. For now, we just clear the + undo list generated by reading the search string. (If the search + fails, the old undo list will be restored by rl_maybe_unsave_line.) */ + rl_free_undo_list (); } rl_restore_prompt (); - noninc_dosearch (noninc_search_string, dir); - RL_UNSETSTATE(RL_STATE_NSEARCH); + return (noninc_dosearch (noninc_search_string, cxt->direction)); +} + +/* Search non-interactively through the history list. DIR < 0 means to + search backwards through the history of previous commands; otherwise + the search is for commands subsequent to the current position in the + history list. PCHAR is the character to use for prompting when reading + the search string; if not specified (0), it defaults to `:'. */ +static int +noninc_search (dir, pchar) + int dir; + int pchar; +{ + _rl_search_cxt *cxt; + int c, r; + + cxt = _rl_nsearch_init (dir, pchar); + + if (RL_ISSTATE (RL_STATE_CALLBACK)) + return (0); + + /* Read the search string. */ + r = 0; + while (1) + { + c = _rl_search_getchar (cxt); + + if (c == 0) + break; + + r = _rl_nsearch_dispatch (cxt, c); + if (r < 0) + return 1; + else if (r == 0) + break; + } + + r = _rl_nsearch_dosearch (cxt); + return ((r >= 0) ? _rl_nsearch_cleanup (cxt, r) : (r != 1)); } /* Search forward through the history list for a string. If the vi-mode code calls this, KEY will be `?'. */ int -rl_noninc_forward_search (int count __attribute__((unused)), int key) +rl_noninc_forward_search (count, key) + int count, key; { - noninc_search (1, (key == '?') ? '?' : 0); - return 0; + return noninc_search (1, (key == '?') ? '?' : 0); } /* Reverse search the history list for a string. If the vi-mode code calls this, KEY will be `/'. */ int -rl_noninc_reverse_search (int count __attribute__((unused)), int key) +rl_noninc_reverse_search (count, key) + int count, key; { - noninc_search (-1, (key == '/') ? '/' : 0); - return 0; + return noninc_search (-1, (key == '/') ? '/' : 0); } /* Search forward through the history list for the last string searched for. If there is no saved search string, abort. */ int -rl_noninc_forward_search_again (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_noninc_forward_search_again (count, key) + int count, key; { + int r; + if (!noninc_search_string) { rl_ding (); return (-1); } - noninc_dosearch (noninc_search_string, 1); - return 0; + r = noninc_dosearch (noninc_search_string, 1); + return (r != 1); } /* Reverse search in the history list for the last string searched for. If there is no saved search string, abort. */ int -rl_noninc_reverse_search_again (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_noninc_reverse_search_again (count, key) + int count, key; { + int r; + if (!noninc_search_string) { rl_ding (); return (-1); } - noninc_dosearch (noninc_search_string, -1); - return 0; + r = noninc_dosearch (noninc_search_string, -1); + return (r != 1); } +#if defined (READLINE_CALLBACKS) +int +_rl_nsearch_callback (cxt) + _rl_search_cxt *cxt; +{ + int c, r; + + c = _rl_search_getchar (cxt); + r = _rl_nsearch_dispatch (cxt, c); + if (r != 0) + return 1; + + r = _rl_nsearch_dosearch (cxt); + return ((r >= 0) ? _rl_nsearch_cleanup (cxt, r) : (r != 1)); +} +#endif + static int rl_history_search_internal (count, dir) int count, dir; diff --git a/cmd-line-utils/readline/shell.c b/cmd-line-utils/readline/shell.c index 41668d70ab5..346f8113d43 100644 --- a/cmd-line-utils/readline/shell.c +++ b/cmd-line-utils/readline/shell.c @@ -22,7 +22,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> @@ -46,8 +48,12 @@ # include <limits.h> #endif +#if defined (HAVE_FCNTL_H) #include <fcntl.h> +#endif +#if defined (HAVE_PWD_H) #include <pwd.h> +#endif #include <stdio.h> @@ -55,9 +61,9 @@ #include "rlshell.h" #include "xmalloc.h" -#if !defined (HAVE_GETPW_DECLS) +#if defined (HAVE_GETPWUID) && !defined (HAVE_GETPW_DECLS) extern struct passwd *getpwuid PARAMS((uid_t)); -#endif /* !HAVE_GETPW_DECLS */ +#endif /* HAVE_GETPWUID && !HAVE_GETPW_DECLS */ #ifndef NULL # define NULL 0 @@ -120,16 +126,7 @@ sh_set_lines_and_columns (lines, cols) { char *b; -#if defined (HAVE_PUTENV) - b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1); - sprintf (b, "LINES=%d", lines); - putenv (b); - - b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("COLUMNS=") + 1); - sprintf (b, "COLUMNS=%d", cols); - putenv (b); -#else /* !HAVE_PUTENV */ -# if defined (HAVE_SETENV) +#if defined (HAVE_SETENV) b = (char *)xmalloc (INT_STRLEN_BOUND (int) + 1); sprintf (b, "%d", lines); setenv ("LINES", b, 1); @@ -139,8 +136,17 @@ sh_set_lines_and_columns (lines, cols) sprintf (b, "%d", cols); setenv ("COLUMNS", b, 1); free (b); -# endif /* HAVE_SETENV */ -#endif /* !HAVE_PUTENV */ +#else /* !HAVE_SETENV */ +# if defined (HAVE_PUTENV) + b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("LINES=") + 1); + sprintf (b, "LINES=%d", lines); + putenv (b); + + b = (char *)xmalloc (INT_STRLEN_BOUND (int) + sizeof ("COLUMNS=") + 1); + sprintf (b, "COLUMNS=%d", cols); + putenv (b); +# endif /* HAVE_PUTENV */ +#endif /* !HAVE_SETENV */ } char * @@ -157,9 +163,11 @@ sh_get_home_dir () struct passwd *entry; home_dir = (char *)NULL; +#if defined (HAVE_GETPWUID) entry = getpwuid (getuid ()); if (entry) home_dir = entry->pw_dir; +#endif return (home_dir); } @@ -173,6 +181,7 @@ int sh_unset_nodelay_mode (fd) int fd; { +#if defined (HAVE_FCNTL) int flags, bflags; if ((flags = fcntl (fd, F_GETFL, 0)) < 0) @@ -193,6 +202,7 @@ sh_unset_nodelay_mode (fd) flags &= ~bflags; return (fcntl (fd, F_SETFL, flags)); } +#endif return 0; } diff --git a/cmd-line-utils/readline/signals.c b/cmd-line-utils/readline/signals.c index be1150f6c54..54f2a642846 100644 --- a/cmd-line-utils/readline/signals.c +++ b/cmd-line-utils/readline/signals.c @@ -1,6 +1,6 @@ /* signals.c -- signal handling support for readline. */ -/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <stdio.h> /* Just for NULL. Yuck. */ #include <sys/types.h> @@ -129,7 +131,11 @@ rl_signal_handler (sig) #if !defined (HAVE_BSD_SIGNALS) && !defined (HAVE_POSIX_SIGNALS) /* Since the signal will not be blocked while we are in the signal handler, ignore it until rl_clear_signals resets the catcher. */ +# if defined (SIGALRM) if (sig == SIGINT || sig == SIGALRM) +# else + if (sig == SIGINT) +# endif rl_set_sighandler (sig, SIG_IGN, &dummy_cxt); #endif /* !HAVE_BSD_SIGNALS && !HAVE_POSIX_SIGNALS */ @@ -139,17 +145,22 @@ rl_signal_handler (sig) rl_free_line_state (); /* FALLTHROUGH */ + case SIGTERM: #if defined (SIGTSTP) case SIGTSTP: case SIGTTOU: case SIGTTIN: #endif /* SIGTSTP */ +#if defined (SIGALRM) case SIGALRM: - case SIGTERM: +#endif +#if defined (SIGQUIT) case SIGQUIT: +#endif rl_cleanup_after_signal (); #if defined (HAVE_POSIX_SIGNALS) + sigemptyset (&set); sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set); sigdelset (&set, sig); #else /* !HAVE_POSIX_SIGNALS */ @@ -162,7 +173,11 @@ rl_signal_handler (sig) signal (sig, SIG_ACK); #endif +#if defined (HAVE_KILL) kill (getpid (), sig); +#else + raise (sig); /* assume we have raise */ +#endif /* Let the signal that we just sent through. */ #if defined (HAVE_POSIX_SIGNALS) @@ -274,13 +289,51 @@ rl_set_signals () { sighandler_cxt dummy; SigHandler *oh; +#if defined (HAVE_POSIX_SIGNALS) + static int sigmask_set = 0; + static sigset_t bset, oset; +#endif + +#if defined (HAVE_POSIX_SIGNALS) + if (rl_catch_signals && sigmask_set == 0) + { + sigemptyset (&bset); + + sigaddset (&bset, SIGINT); + sigaddset (&bset, SIGINT); +#if defined (SIGQUIT) + sigaddset (&bset, SIGQUIT); +#endif +#if defined (SIGALRM) + sigaddset (&bset, SIGALRM); +#endif +#if defined (SIGTSTP) + sigaddset (&bset, SIGTSTP); +#endif +#if defined (SIGTTIN) + sigaddset (&bset, SIGTTIN); +#endif +#if defined (SIGTTOU) + sigaddset (&bset, SIGTTOU); +#endif + sigmask_set = 1; + } +#endif /* HAVE_POSIX_SIGNALS */ if (rl_catch_signals && signals_set_flag == 0) { +#if defined (HAVE_POSIX_SIGNALS) + sigemptyset (&oset); + sigprocmask (SIG_BLOCK, &bset, &oset); +#endif + rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int); rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term); +#if defined (SIGQUIT) rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit); +#endif +#if defined (SIGALRM) oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm); if (oh == (SigHandler *)SIG_IGN) rl_sigaction (SIGALRM, &old_alrm, &dummy); @@ -292,6 +345,7 @@ rl_set_signals () if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART)) rl_sigaction (SIGALRM, &old_alrm, &dummy); #endif /* HAVE_POSIX_SIGNALS */ +#endif /* SIGALRM */ #if defined (SIGTSTP) rl_maybe_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp); @@ -306,6 +360,10 @@ rl_set_signals () #endif /* SIGTTIN */ signals_set_flag = 1; + +#if defined (HAVE_POSIX_SIGNALS) + sigprocmask (SIG_SETMASK, &oset, (sigset_t *)NULL); +#endif } #if defined (SIGWINCH) @@ -330,8 +388,12 @@ rl_clear_signals () rl_sigaction (SIGINT, &old_int, &dummy); rl_sigaction (SIGTERM, &old_term, &dummy); +#if defined (SIGQUIT) rl_sigaction (SIGQUIT, &old_quit, &dummy); +#endif +#if defined (SIGALRM) rl_sigaction (SIGALRM, &old_alrm, &dummy); +#endif #if defined (SIGTSTP) rl_sigaction (SIGTSTP, &old_tstp, &dummy); @@ -366,16 +428,18 @@ void rl_cleanup_after_signal () { _rl_clean_up_for_exit (); - (*rl_deprep_term_function) (); - rl_clear_signals (); + if (rl_deprep_term_function) + (*rl_deprep_term_function) (); rl_clear_pending_input (); + rl_clear_signals (); } /* Reset the terminal and readline state after a signal handler returns. */ void rl_reset_after_signal () { - (*rl_prep_term_function) (_rl_meta_flag); + if (rl_prep_term_function) + (*rl_prep_term_function) (_rl_meta_flag); rl_set_signals (); } @@ -396,7 +460,7 @@ rl_free_line_state () _rl_kill_kbd_macro (); rl_clear_message (); - _rl_init_argument (); + _rl_reset_argument (); } #endif /* HANDLE_SIGNALS */ diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c index 4b900c5d860..547f6f5dfe5 100644 --- a/cmd-line-utils/readline/terminal.c +++ b/cmd-line-utils/readline/terminal.c @@ -1,6 +1,6 @@ /* terminal.c -- controlling the terminal with termcap. */ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996-2006 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> #include "posixstat.h" @@ -64,9 +66,25 @@ #include "rlshell.h" #include "xmalloc.h" +#if defined (__MINGW32__) +# include <windows.h> +# include <wincon.h> + +static void _win_get_screensize PARAMS((int *, int *)); +#endif + +#if defined (__EMX__) +static void _emx_get_screensize PARAMS((int *, int *)); +#endif + #define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay) #define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc) +/* If the calling application sets this to a non-zero value, readline will + use the $LINES and $COLUMNS environment variables to set its idea of the + window size before interrogating the kernel. */ +int rl_prefer_env_winsize = 0; + /* **************************************************************** */ /* */ /* Terminal and Termcap */ @@ -107,9 +125,7 @@ char *_rl_term_IC; char *_rl_term_dc; char *_rl_term_DC; -#if defined (HACK_TERMCAP_MOTION) char *_rl_term_forward_char; -#endif /* HACK_TERMCAP_MOTION */ /* How to go up a line. */ char *_rl_term_up; @@ -118,7 +134,7 @@ char *_rl_term_up; static char *_rl_visible_bell; /* Non-zero means the terminal can auto-wrap lines. */ -int _rl_term_autowrap; +int _rl_term_autowrap = -1; /* Non-zero means that this terminal has a meta key. */ static int term_has_meta; @@ -143,6 +159,9 @@ static char *_rl_term_kh; static char *_rl_term_kH; static char *_rl_term_at7; /* @7 */ +/* Delete key */ +static char *_rl_term_kD; + /* Insert key */ static char *_rl_term_kI; @@ -177,6 +196,26 @@ _emx_get_screensize (swp, shp) } #endif +#if defined (__MINGW32__) +static void +_win_get_screensize (swp, shp) + int *swp, *shp; +{ + HANDLE hConOut; + CONSOLE_SCREEN_BUFFER_INFO scr; + + hConOut = GetStdHandle (STD_OUTPUT_HANDLE); + if (hConOut != INVALID_HANDLE_VALUE) + { + if (GetConsoleScreenBufferInfo (hConOut, &scr)) + { + *swp = scr.dwSize.X; + *shp = scr.srWindow.Bottom - scr.srWindow.Top + 1; + } + } +} +#endif + /* Get readline's idea of the screen size. TTY is a file descriptor open to the terminal. If IGNORE_ENV is true, we do not pay attention to the values of $LINES and $COLUMNS. The tests for TERM_STRING_BUFFER being @@ -189,26 +228,42 @@ _rl_get_screen_size (tty, ignore_env) #if defined (TIOCGWINSZ) struct winsize window_size; #endif /* TIOCGWINSZ */ + int wr, wc; + wr = wc = -1; #if defined (TIOCGWINSZ) if (ioctl (tty, TIOCGWINSZ, &window_size) == 0) { - _rl_screenwidth = (int) window_size.ws_col; - _rl_screenheight = (int) window_size.ws_row; + wc = (int) window_size.ws_col; + wr = (int) window_size.ws_row; } #endif /* TIOCGWINSZ */ #if defined (__EMX__) - _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight); + _emx_get_screensize (&wc, &wr); +#elif defined (__MINGW32__) + _win_get_screensize (&wc, &wr); #endif + if (ignore_env || rl_prefer_env_winsize == 0) + { + _rl_screenwidth = wc; + _rl_screenheight = wr; + } + else + _rl_screenwidth = _rl_screenheight = -1; + /* Environment variable COLUMNS overrides setting of "co" if IGNORE_ENV - is unset. */ + is unset. If we prefer the environment, check it first before + assigning the value returned by the kernel. */ if (_rl_screenwidth <= 0) { if (ignore_env == 0 && (ss = sh_get_env_value ("COLUMNS"))) _rl_screenwidth = atoi (ss); + if (_rl_screenwidth <= 0) + _rl_screenwidth = wc; + #if !defined (__DJGPP__) if (_rl_screenwidth <= 0 && term_string_buffer) _rl_screenwidth = tgetnum ("co"); @@ -222,6 +277,9 @@ _rl_get_screen_size (tty, ignore_env) if (ignore_env == 0 && (ss = sh_get_env_value ("LINES"))) _rl_screenheight = atoi (ss); + if (_rl_screenheight <= 0) + _rl_screenheight = wr; + #if !defined (__DJGPP__) if (_rl_screenheight <= 0 && term_string_buffer) _rl_screenheight = tgetnum ("li"); @@ -250,16 +308,20 @@ void _rl_set_screen_size (rows, cols) int rows, cols; { - if (rows == 0 || cols == 0) - return; - - _rl_screenheight = rows; - _rl_screenwidth = cols; + if (_rl_term_autowrap == -1) + _rl_init_terminal_io (rl_terminal_name); - if (_rl_term_autowrap == 0) - _rl_screenwidth--; + if (rows > 0) + _rl_screenheight = rows; + if (cols > 0) + { + _rl_screenwidth = cols; + if (_rl_term_autowrap == 0) + _rl_screenwidth--; + } - _rl_screenchars = _rl_screenwidth * _rl_screenheight; + if (rows > 0 || cols > 0) + _rl_screenchars = _rl_screenwidth * _rl_screenheight; } void @@ -278,6 +340,12 @@ rl_get_screen_size (rows, cols) if (cols) *cols = _rl_screenwidth; } + +void +rl_reset_screen_size () +{ + _rl_get_screen_size (fileno (rl_instream), 0); +} void rl_resize_terminal () @@ -311,6 +379,7 @@ static struct _tc_string tc_strings[] = { "ei", &_rl_term_ei }, { "ic", &_rl_term_ic }, { "im", &_rl_term_im }, + { "kD", &_rl_term_kD }, /* delete */ { "kH", &_rl_term_kH }, /* home down ?? */ { "kI", &_rl_term_kI }, /* insert */ { "kd", &_rl_term_kd }, @@ -323,9 +392,7 @@ static struct _tc_string tc_strings[] = { "le", &_rl_term_backspace }, { "mm", &_rl_term_mm }, { "mo", &_rl_term_mo }, -#if defined (HACK_TERMCAP_MOTION) { "nd", &_rl_term_forward_char }, -#endif { "pc", &_rl_term_pc }, { "up", &_rl_term_up }, { "vb", &_rl_visible_bell }, @@ -344,7 +411,7 @@ get_term_capabilities (bp) #if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */ register int i; - for (i = 0; i < (int) NUM_TC_STRINGS; i++) + for (i = 0; i < NUM_TC_STRINGS; i++) *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp); #endif tcap_initialized = 1; @@ -361,7 +428,6 @@ _rl_init_terminal_io (terminal_name) term = terminal_name ? terminal_name : sh_get_env_value ("TERM"); _rl_term_clrpag = _rl_term_cr = _rl_term_clreol = (char *)NULL; tty = rl_instream ? fileno (rl_instream) : 0; - _rl_screenwidth = _rl_screenheight = 0; if (term == 0) term = "dumb"; @@ -394,12 +460,17 @@ _rl_init_terminal_io (terminal_name) _rl_term_autowrap = 0; /* used by _rl_get_screen_size */ + /* Allow calling application to set default height and width, using + rl_set_screen_size */ + if (_rl_screenwidth <= 0 || _rl_screenheight <= 0) + { #if defined (__EMX__) - _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight); - _rl_screenwidth--; + _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight); + _rl_screenwidth--; #else /* !__EMX__ */ - _rl_get_screen_size (tty, 0); + _rl_get_screen_size (tty, 0); #endif /* !__EMX__ */ + } /* Defaults. */ if (_rl_screenwidth <= 0 || _rl_screenheight <= 0) @@ -410,24 +481,22 @@ _rl_init_terminal_io (terminal_name) /* Everything below here is used by the redisplay code (tputs). */ _rl_screenchars = _rl_screenwidth * _rl_screenheight; - _rl_term_cr = (char*) "\r"; + _rl_term_cr = "\r"; _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL; _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL; _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL; - _rl_term_kh = _rl_term_kH = _rl_term_kI = (char *)NULL; + _rl_term_kh = _rl_term_kH = _rl_term_kI = _rl_term_kD = (char *)NULL; _rl_term_ks = _rl_term_ke = _rl_term_at7 = (char *)NULL; _rl_term_mm = _rl_term_mo = (char *)NULL; _rl_term_ve = _rl_term_vs = (char *)NULL; -#if defined (HACK_TERMCAP_MOTION) - term_forward_char = (char *)NULL; -#endif + _rl_term_forward_char = (char *)NULL; _rl_terminal_can_insert = term_has_meta = 0; /* Reasonable defaults for tgoto(). Readline currently only uses tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we change that later... */ PC = '\0'; - BC = _rl_term_backspace = (char*) "\b"; + BC = _rl_term_backspace = "\b"; UP = _rl_term_up; return 0; @@ -442,11 +511,14 @@ _rl_init_terminal_io (terminal_name) UP = _rl_term_up; if (!_rl_term_cr) - _rl_term_cr = (char*) "\r"; + _rl_term_cr = "\r"; _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn"); - _rl_get_screen_size (tty, 0); + /* Allow calling application to set default height and width, using + rl_set_screen_size */ + if (_rl_screenwidth <= 0 || _rl_screenheight <= 0) + _rl_get_screen_size (tty, 0); /* "An application program can assume that the terminal can do character insertion if *any one of* the capabilities `IC', @@ -491,6 +563,8 @@ bind_termcap_arrow_keys (map) rl_bind_keyseq_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */ rl_bind_keyseq_if_unbound (_rl_term_at7, rl_end_of_line); /* End */ + rl_bind_keyseq_if_unbound (_rl_term_kD, rl_delete); + _rl_keymap = xkeymap; } @@ -502,7 +576,7 @@ rl_get_termcap (cap) if (tcap_initialized == 0) return ((char *)NULL); - for (i = 0; i < (int) NUM_TC_STRINGS; i++) + for (i = 0; i < NUM_TC_STRINGS; i++) { if (tc_strings[i].tc_var[0] == cap[0] && strcmp (tc_strings[i].tc_var, cap) == 0) return *(tc_strings[i].tc_value); @@ -516,6 +590,7 @@ int rl_reset_terminal (terminal_name) const char *terminal_name; { + _rl_screenwidth = _rl_screenheight = 0; _rl_init_terminal_io (terminal_name); return 0; } diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c index cf9223df844..399a48c5f1e 100644 --- a/cmd-line-utils/readline/text.c +++ b/cmd-line-utils/readline/text.c @@ -1,6 +1,6 @@ /* text.c -- text handling commands for readline. */ -/* Copyright (C) 1987-2004 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #if defined (HAVE_UNISTD_H) # include <unistd.h> @@ -60,6 +62,11 @@ static int rl_change_case PARAMS((int, int)); static int _rl_char_search PARAMS((int, int, int)); +#if defined (READLINE_CALLBACKS) +static int _rl_insert_next_callback PARAMS((_rl_callback_generic_arg *)); +static int _rl_char_search_callback PARAMS((_rl_callback_generic_arg *)); +#endif + /* **************************************************************** */ /* */ /* Insert and Delete */ @@ -402,7 +409,8 @@ rl_backward (count, key) /* Move to the beginning of the line. */ int -rl_beg_of_line (int count __attribute__((unused)), int key __attribute__((unused))) +rl_beg_of_line (count, key) + int count, key; { rl_point = 0; return 0; @@ -410,14 +418,14 @@ rl_beg_of_line (int count __attribute__((unused)), int key __attribute__((unused /* Move to the end of the line. */ int -rl_end_of_line (int count __attribute__((unused)), int key __attribute__((unused))) +rl_end_of_line (count, key) + int count, key; { rl_point = rl_end; return 0; } -/* XXX - these might need changes for multibyte characters */ -/* Move forward a word. We do what Emacs does. */ +/* Move forward a word. We do what Emacs does. Handles multibyte chars. */ int rl_forward_word (count, key) int count, key; @@ -434,68 +442,80 @@ rl_forward_word (count, key) /* If we are not in a word, move forward until we are in one. Then, move forward until we hit a non-alphabetic character. */ - c = rl_line_buffer[rl_point]; - if (rl_alphabetic (c) == 0) + c = _rl_char_value (rl_line_buffer, rl_point); + + if (_rl_walphabetic (c) == 0) { - while (++rl_point < rl_end) + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + while (rl_point < rl_end) { - c = rl_line_buffer[rl_point]; - if (rl_alphabetic (c)) + c = _rl_char_value (rl_line_buffer, rl_point); + if (_rl_walphabetic (c)) break; + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); } } if (rl_point == rl_end) return 0; - while (++rl_point < rl_end) + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + while (rl_point < rl_end) { - c = rl_line_buffer[rl_point]; - if (rl_alphabetic (c) == 0) + c = _rl_char_value (rl_line_buffer, rl_point); + if (_rl_walphabetic (c) == 0) break; + rl_point = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); } + --count; } return 0; } -/* Move backward a word. We do what Emacs does. */ +/* Move backward a word. We do what Emacs does. Handles multibyte chars. */ int rl_backward_word (count, key) int count, key; { - int c; + int c, p; if (count < 0) return (rl_forward_word (-count, key)); while (count) { - if (!rl_point) + if (rl_point == 0) return 0; /* Like rl_forward_word (), except that we look at the characters just before point. */ - c = rl_line_buffer[rl_point - 1]; - if (rl_alphabetic (c) == 0) + p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + c = _rl_char_value (rl_line_buffer, p); + + if (_rl_walphabetic (c) == 0) { - while (--rl_point) + rl_point = p; + while (rl_point > 0) { - c = rl_line_buffer[rl_point - 1]; - if (rl_alphabetic (c)) + p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + c = _rl_char_value (rl_line_buffer, p); + if (_rl_walphabetic (c)) break; + rl_point = p; } } while (rl_point) { - c = rl_line_buffer[rl_point - 1]; - if (rl_alphabetic (c) == 0) + p = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); + c = _rl_char_value (rl_line_buffer, p); + if (_rl_walphabetic (c) == 0) break; else - --rl_point; + rl_point = p; } --count; @@ -506,7 +526,8 @@ rl_backward_word (count, key) /* Clear the current line. Numeric argument to C-l does this. */ int -rl_refresh_line (int count __attribute__((unused)), int key __attribute__((unused))) +rl_refresh_line (ignore1, ignore2) + int ignore1, ignore2; { int curr_line; @@ -544,7 +565,8 @@ rl_clear_screen (count, key) } int -rl_arrow_keys (int count, int c __attribute__((unused))) +rl_arrow_keys (count, c) + int count, c; { int ch; @@ -592,7 +614,7 @@ rl_arrow_keys (int count, int c __attribute__((unused))) #ifdef HANDLE_MULTIBYTE static char pending_bytes[MB_LEN_MAX]; static int pending_bytes_length = 0; -static mbstate_t ps; +static mbstate_t ps = {0}; #endif /* Insert the character C at the current location, moving point forward. @@ -750,10 +772,8 @@ _rl_insert_char (count, c) return 0; } -#if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX == 1 || rl_byte_oriented) { -#endif /* We are inserting a single character. If there is pending input, then make a string of all of the pending characters that are bound to rl_insert, and insert @@ -769,8 +789,8 @@ _rl_insert_char (count, c) str[0] = c; rl_insert_text (str); } -#if defined (HANDLE_MULTIBYTE) } +#if defined (HANDLE_MULTIBYTE) else { rl_insert_text (incoming); @@ -827,29 +847,67 @@ rl_insert (count, c) } /* Insert the next typed character verbatim. */ -int -rl_quoted_insert (int count, int key __attribute__((unused))) +static int +_rl_insert_next (count) + int count; { int c; -#if defined (HANDLE_SIGNALS) - _rl_disable_tty_signals (); -#endif - RL_SETSTATE(RL_STATE_MOREINPUT); c = rl_read_key (); RL_UNSETSTATE(RL_STATE_MOREINPUT); #if defined (HANDLE_SIGNALS) - _rl_restore_tty_signals (); + if (RL_ISSTATE (RL_STATE_CALLBACK) == 0) + _rl_restore_tty_signals (); #endif return (_rl_insert_char (count, c)); } +#if defined (READLINE_CALLBACKS) +static int +_rl_insert_next_callback (data) + _rl_callback_generic_arg *data; +{ + int count; + + count = data->count; + + /* Deregister function, let rl_callback_read_char deallocate data */ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return _rl_insert_next (count); +} +#endif + +int +rl_quoted_insert (count, key) + int count, key; +{ + /* Let's see...should the callback interface futz with signal handling? */ +#if defined (HANDLE_SIGNALS) + if (RL_ISSTATE (RL_STATE_CALLBACK) == 0) + _rl_disable_tty_signals (); +#endif + +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_func = _rl_insert_next_callback; + return (0); + } +#endif + + return _rl_insert_next (count); +} + /* Insert a tab character. */ int -rl_tab_insert (int count, int key __attribute__((unused))) +rl_tab_insert (count, key) + int count, key; { return (_rl_insert_char (count, '\t')); } @@ -858,7 +916,8 @@ rl_tab_insert (int count, int key __attribute__((unused))) KEY is the key that invoked this command. I guess it could have meaning in the future. */ int -rl_newline (int count __attribute__((unused)), int key __attribute__((unused))) +rl_newline (count, key) + int count, key; { rl_done = 1; @@ -891,8 +950,8 @@ rl_newline (int count __attribute__((unused)), int key __attribute__((unused))) is just a stub, you bind keys to it and the code in _rl_dispatch () is special cased. */ int -rl_do_lowercase_version (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_do_lowercase_version (ignore1, ignore2) + int ignore1, ignore2; { return 0; } @@ -979,43 +1038,17 @@ _rl_rubout_char (count, key) return -1; } + orig_point = rl_point; if (count > 1 || rl_explicit_arg) { - orig_point = rl_point; -#if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - rl_backward_char (count, key); - else -#endif - rl_backward_byte (count, key); + rl_backward_char (count, key); rl_kill_text (orig_point, rl_point); } - else + else if (MB_CUR_MAX == 1 || rl_byte_oriented) { -#if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX == 1 || rl_byte_oriented) - { -#endif - c = rl_line_buffer[--rl_point]; - rl_delete_text (rl_point, rl_point + 1); -#if defined (HANDLE_MULTIBYTE) - } - else - { - int orig_point2; - - orig_point2 = rl_point; - rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); - c = rl_line_buffer[rl_point]; - rl_delete_text (rl_point, orig_point2); - } -#endif /* HANDLE_MULTIBYTE */ - - /* I don't think that the hack for end of line is needed for - multibyte chars. */ -#if defined (HANDLE_MULTIBYTE) - if (MB_CUR_MAX == 1 || rl_byte_oriented) -#endif + c = rl_line_buffer[--rl_point]; + rl_delete_text (rl_point, orig_point); + /* The erase-at-end-of-line hack is of questionable merit now. */ if (rl_point == rl_end && ISPRINT (c) && _rl_last_c_pos) { int l; @@ -1023,6 +1056,11 @@ _rl_rubout_char (count, key) _rl_erase_at_end_of_line (l); } } + else + { + rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); + rl_delete_text (rl_point, orig_point); + } return 0; } @@ -1033,7 +1071,7 @@ int rl_delete (count, key) int count, key; { - int r; + int xpoint; if (count < 0) return (_rl_rubout_char (-count, key)); @@ -1046,28 +1084,21 @@ rl_delete (count, key) if (count > 1 || rl_explicit_arg) { - int orig_point = rl_point; -#if defined (HANDLE_MULTIBYTE) + xpoint = rl_point; if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) rl_forward_char (count, key); else -#endif rl_forward_byte (count, key); - r = rl_kill_text (orig_point, rl_point); - rl_point = orig_point; - return r; + rl_kill_text (xpoint, rl_point); + rl_point = xpoint; } else { - int new_point; - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - new_point = _rl_find_next_mbchar (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); - else - new_point = rl_point + 1; - - return (rl_delete_text (rl_point, new_point)); + xpoint = MB_NEXTCHAR (rl_line_buffer, rl_point, 1, MB_FIND_NONZERO); + rl_delete_text (rl_point, xpoint); } + return 0; } /* Delete the character under the cursor, unless the insertion @@ -1086,8 +1117,8 @@ rl_rubout_or_delete (count, key) /* Delete all spaces and tabs around point. */ int -rl_delete_horizontal_space (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_delete_horizontal_space (count, ignore) + int count, ignore; { int start = rl_point; @@ -1104,6 +1135,10 @@ rl_delete_horizontal_space (int count __attribute__((unused)), rl_delete_text (start, rl_point); rl_point = start; } + + if (rl_point < 0) + rl_point = 0; + return 0; } @@ -1127,13 +1162,14 @@ rl_delete_or_show_completions (count, key) /* Turn the current line into a comment in shell history. A K*rn shell style function. */ int -rl_insert_comment (int count __attribute__((unused)), int key) +rl_insert_comment (count, key) + int count, key; { char *rl_comment_text; int rl_comment_len; rl_beg_of_line (1, key); - rl_comment_text = _rl_comment_begin ? _rl_comment_begin : (char*) RL_COMMENT_BEGIN_DEFAULT; + rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT; if (rl_explicit_arg == 0) rl_insert_text (rl_comment_text); @@ -1165,21 +1201,24 @@ rl_insert_comment (int count __attribute__((unused)), int key) /* Uppercase the word at point. */ int -rl_upcase_word (int count, int key __attribute__((unused))) +rl_upcase_word (count, key) + int count, key; { return (rl_change_case (count, UpCase)); } /* Lowercase the word at point. */ int -rl_downcase_word (int count, int key __attribute__((unused))) +rl_downcase_word (count, key) + int count, key; { return (rl_change_case (count, DownCase)); } /* Upcase the first letter, downcase the rest. */ int -rl_capitalize_word (int count, int key __attribute__((unused))) +rl_capitalize_word (count, key) + int count, key; { return (rl_change_case (count, CapCase)); } @@ -1193,42 +1232,80 @@ static int rl_change_case (count, op) int count, op; { - register int start, end; - int inword, c; + int start, next, end; + int inword, c, nc, nop; +#if defined (HANDLE_MULTIBYTE) + wchar_t wc, nwc; + char mb[MB_LEN_MAX+1]; + int mlen; + mbstate_t mps; +#endif start = rl_point; rl_forward_word (count, 0); end = rl_point; + if (op != UpCase && op != DownCase && op != CapCase) + { + rl_ding (); + return -1; + } + if (count < 0) SWAP (start, end); +#if defined (HANDLE_MULTIBYTE) + memset (&mps, 0, sizeof (mbstate_t)); +#endif + /* We are going to modify some text, so let's prepare to undo it. */ rl_modifying (start, end); - for (inword = 0; start < end; start++) + inword = 0; + while (start < end) { - c = rl_line_buffer[start]; - switch (op) - { - case UpCase: - rl_line_buffer[start] = _rl_to_upper (c); - break; + c = _rl_char_value (rl_line_buffer, start); + /* This assumes that the upper and lower case versions are the same width. */ + next = MB_NEXTCHAR (rl_line_buffer, start, 1, MB_FIND_NONZERO); - case DownCase: - rl_line_buffer[start] = _rl_to_lower (c); - break; - - case CapCase: - rl_line_buffer[start] = (inword == 0) ? _rl_to_upper (c) : _rl_to_lower (c); - inword = rl_alphabetic (rl_line_buffer[start]); - break; + if (_rl_walphabetic (c) == 0) + { + inword = 0; + start = next; + continue; + } - default: - rl_ding (); - return -1; + if (op == CapCase) + { + nop = inword ? DownCase : UpCase; + inword = 1; + } + else + nop = op; + if (MB_CUR_MAX == 1 || rl_byte_oriented || isascii (c)) + { + nc = (nop == UpCase) ? _rl_to_upper (c) : _rl_to_lower (c); + rl_line_buffer[start] = nc; + } +#if defined (HANDLE_MULTIBYTE) + else + { + mbrtowc (&wc, rl_line_buffer + start, end - start, &mps); + nwc = (nop == UpCase) ? _rl_to_wupper (wc) : _rl_to_wlower (wc); + if (nwc != wc) /* just skip unchanged characters */ + { + mlen = wcrtomb (mb, nwc, &mps); + if (mlen > 0) + mb[mlen] = '\0'; + /* Assume the same width */ + strncpy (rl_line_buffer + start, mb, mlen); + } } +#endif + + start = next; } + rl_point = end; return 0; } @@ -1303,15 +1380,16 @@ rl_transpose_words (count, key) /* Transpose the characters at point. If point is at the end of the line, then transpose the characters before point. */ int -rl_transpose_chars (int count, int key __attribute__((unused))) +rl_transpose_chars (count, key) + int count, key; { #if defined (HANDLE_MULTIBYTE) char *dummy; - int i, prev_point; + int i; #else char dummy[2]; #endif - int char_length; + int char_length, prev_point; if (count == 0) return 0; @@ -1326,20 +1404,12 @@ rl_transpose_chars (int count, int key __attribute__((unused))) if (rl_point == rl_end) { - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); - else - --rl_point; + rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); count = 1; } -#if defined (HANDLE_MULTIBYTE) prev_point = rl_point; - if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); - else -#endif - rl_point--; + rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_NONZERO); #if defined (HANDLE_MULTIBYTE) char_length = prev_point - rl_point; @@ -1473,15 +1543,51 @@ _rl_char_search (count, fdir, bdir) } #endif /* !HANDLE_MULTIBYTE */ +#if defined (READLINE_CALLBACKS) +static int +_rl_char_search_callback (data) + _rl_callback_generic_arg *data; +{ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_char_search (data->count, data->i1, data->i2)); +} +#endif + int -rl_char_search (int count, int key __attribute__((unused))) +rl_char_search (count, key) + int count, key; { +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_data->i1 = FFIND; + _rl_callback_data->i2 = BFIND; + _rl_callback_func = _rl_char_search_callback; + return (0); + } +#endif + return (_rl_char_search (count, FFIND, BFIND)); } int -rl_backward_char_search (int count, int key __attribute__((unused))) +rl_backward_char_search (count, key) + int count, key; { +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_data->i1 = BFIND; + _rl_callback_data->i2 = FFIND; + _rl_callback_func = _rl_char_search_callback; + return (0); + } +#endif + return (_rl_char_search (count, BFIND, FFIND)); } @@ -1505,15 +1611,16 @@ _rl_set_mark_at_pos (position) /* A bindable command to set the mark. */ int -rl_set_mark (int count, int key __attribute__((unused))) +rl_set_mark (count, key) + int count, key; { return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point)); } /* Exchange the position of mark and point. */ int -rl_exchange_point_and_mark (int count __attribute__((unused)), - int key __attribute__((unused))) +rl_exchange_point_and_mark (count, key) + int count, key; { if (rl_mark > rl_end) rl_mark = -1; diff --git a/cmd-line-utils/readline/tilde.c b/cmd-line-utils/readline/tilde.c index 91eead0d9e2..1b76c9f2404 100644 --- a/cmd-line-utils/readline/tilde.c +++ b/cmd-line-utils/readline/tilde.c @@ -19,9 +19,9 @@ along with Readline; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -#define READLINE_LIBRARY - -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #if defined (HAVE_UNISTD_H) # ifdef _MINIX @@ -43,7 +43,9 @@ #endif /* HAVE_STDLIB_H */ #include <sys/types.h> +#if defined (HAVE_PWD_H) #include <pwd.h> +#endif #include "tilde.h" @@ -54,8 +56,12 @@ static void *xmalloc (), *xrealloc (); #endif /* TEST || STATIC_MALLOC */ #if !defined (HAVE_GETPW_DECLS) +# if defined (HAVE_GETPWUID) extern struct passwd *getpwuid PARAMS((uid_t)); +# endif +# if defined (HAVE_GETPWNAM) extern struct passwd *getpwnam PARAMS((const char *)); +# endif #endif /* !HAVE_GETPW_DECLS */ #if !defined (savestring) @@ -190,7 +196,7 @@ tilde_expand (string) int result_size, result_index; result_index = result_size = 0; - if ((result = strchr (string, '~'))) + if (result = strchr (string, '~')) result = (char *)xmalloc (result_size = (strlen (string) + 16)); else result = (char *)xmalloc (result_size = (strlen (string) + 1)); @@ -277,6 +283,39 @@ isolate_tilde_prefix (fname, lenp) return ret; } +#if 0 +/* Public function to scan a string (FNAME) beginning with a tilde and find + the portion of the string that should be passed to the tilde expansion + function. Right now, it just calls tilde_find_suffix and allocates new + memory, but it can be expanded to do different things later. */ +char * +tilde_find_word (fname, flags, lenp) + const char *fname; + int flags, *lenp; +{ + int x; + char *r; + + x = tilde_find_suffix (fname); + if (x == 0) + { + r = savestring (fname); + if (lenp) + *lenp = 0; + } + else + { + r = (char *)xmalloc (1 + x); + strncpy (r, fname, x); + r[x] = '\0'; + if (lenp) + *lenp = x; + } + + return r; +} +#endif + /* Return a string that is PREFIX concatenated with SUFFIX starting at SUFFIND. */ static char * @@ -347,7 +386,11 @@ tilde_expand_word (filename) /* No preexpansion hook, or the preexpansion hook failed. Look in the password database. */ dirname = (char *)NULL; +#if defined (HAVE_GETPWNAM) user_entry = getpwnam (username); +#else + user_entry = 0; +#endif if (user_entry == 0) { /* If the calling program has a special syntax for expanding tildes, @@ -361,19 +404,20 @@ tilde_expand_word (filename) free (expansion); } } - free (username); /* If we don't have a failure hook, or if the failure hook did not expand the tilde, return a copy of what we were passed. */ if (dirname == 0) dirname = savestring (filename); } +#if defined (HAVE_GETPWENT) else - { - free (username); - dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len); - } + dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len); +#endif + free (username); +#if defined (HAVE_GETPWENT) endpwent (); +#endif return (dirname); } diff --git a/cmd-line-utils/readline/tilde.h b/cmd-line-utils/readline/tilde.h index f8182c999d9..c58ce20e7a2 100644 --- a/cmd-line-utils/readline/tilde.h +++ b/cmd-line-utils/readline/tilde.h @@ -71,6 +71,9 @@ extern char *tilde_expand PARAMS((const char *)); tilde. If there is no expansion, call tilde_expansion_failure_hook. */ extern char *tilde_expand_word PARAMS((const char *)); +/* Find the portion of the string beginning with ~ that should be expanded. */ +extern char *tilde_find_word PARAMS((const char *, int, int *)); + #ifdef __cplusplus } #endif diff --git a/cmd-line-utils/readline/undo.c b/cmd-line-utils/readline/undo.c index 4d256f492b8..9d9bd25ba8f 100644 --- a/cmd-line-utils/readline/undo.c +++ b/cmd-line-utils/readline/undo.c @@ -1,7 +1,7 @@ /* readline.c -- a general facility for reading lines of input with emacs style editing and completion. */ -/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1987, 1989, 1992, 2006 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -22,7 +22,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> @@ -48,6 +50,8 @@ #include "rlprivate.h" #include "xmalloc.h" +extern void replace_history_data PARAMS((int, histdata_t *, histdata_t *)); + /* Non-zero tells rl_delete_text and rl_insert_text to not add to the undo list. */ int _rl_doing_an_undo = 0; @@ -64,19 +68,35 @@ UNDO_LIST *rl_undo_list = (UNDO_LIST *)NULL; /* */ /* **************************************************************** */ -/* Remember how to undo something. Concatenate some undos if that - seems right. */ -void -rl_add_undo (what, start, end, text) +static UNDO_LIST * +alloc_undo_entry (what, start, end, text) enum undo_code what; int start, end; char *text; { - UNDO_LIST *temp = (UNDO_LIST *)xmalloc (sizeof (UNDO_LIST)); + UNDO_LIST *temp; + + temp = (UNDO_LIST *)xmalloc (sizeof (UNDO_LIST)); temp->what = what; temp->start = start; temp->end = end; temp->text = text; + + temp->next = (UNDO_LIST *)NULL; + return temp; +} + +/* Remember how to undo something. Concatenate some undos if that + seems right. */ +void +rl_add_undo (what, start, end, text) + enum undo_code what; + int start, end; + char *text; +{ + UNDO_LIST *temp; + + temp = alloc_undo_entry (what, start, end, text); temp->next = rl_undo_list; rl_undo_list = temp; } @@ -85,9 +105,12 @@ rl_add_undo (what, start, end, text) void rl_free_undo_list () { + UNDO_LIST *release, *orig_list; + + orig_list = rl_undo_list; while (rl_undo_list) { - UNDO_LIST *release = rl_undo_list; + release = rl_undo_list; rl_undo_list = rl_undo_list->next; if (release->what == UNDO_DELETE) @@ -96,6 +119,43 @@ rl_free_undo_list () free (release); } rl_undo_list = (UNDO_LIST *)NULL; + replace_history_data (-1, (histdata_t *)orig_list, (histdata_t *)NULL); +} + +UNDO_LIST * +_rl_copy_undo_entry (entry) + UNDO_LIST *entry; +{ + UNDO_LIST *new; + + new = alloc_undo_entry (entry->what, entry->start, entry->end, (char *)NULL); + new->text = entry->text ? savestring (entry->text) : 0; + return new; +} + +UNDO_LIST * +_rl_copy_undo_list (head) + UNDO_LIST *head; +{ + UNDO_LIST *list, *new, *roving, *c; + + list = head; + new = 0; + while (list) + { + c = _rl_copy_undo_entry (list); + if (new == 0) + roving = new = c; + else + { + roving->next = c; + roving = roving->next; + } + list = list->next; + } + + roving->next = 0; + return new; } /* Undo the next thing in the list. Return 0 if there @@ -159,6 +219,8 @@ rl_do_undo () release = rl_undo_list; rl_undo_list = rl_undo_list->next; + replace_history_data (-1, (histdata_t *)release, (histdata_t *)rl_undo_list); + free (release); } while (waiting_for_begin); @@ -175,7 +237,7 @@ _rl_fix_last_undo_of_type (type, start, end) for (rl = rl_undo_list; rl; rl = rl->next) { - if (rl->what == (unsigned int) type) + if (rl->what == type) { rl->start = start; rl->end = end; @@ -226,7 +288,8 @@ rl_modifying (start, end) /* Revert the current line to its previous state. */ int -rl_revert_line (int count __attribute__((unused)), int key __attribute__((unused))) +rl_revert_line (count, key) + int count, key; { if (!rl_undo_list) rl_ding (); @@ -234,13 +297,19 @@ rl_revert_line (int count __attribute__((unused)), int key __attribute__((unuse { while (rl_undo_list) rl_do_undo (); +#if defined (VI_MODE) + if (rl_editing_mode == vi_mode) + rl_point = rl_mark = 0; /* rl_end should be set correctly */ +#endif } + return 0; } /* Do some undoing of things that were done. */ int -rl_undo_command (int count, int key __attribute__((unused))) +rl_undo_command (count, key) + int count, key; { if (count < 0) return 0; /* Nothing to do. */ diff --git a/cmd-line-utils/readline/util.c b/cmd-line-utils/readline/util.c index d5fe51a7bf2..e44ef64349d 100644 --- a/cmd-line-utils/readline/util.c +++ b/cmd-line-utils/readline/util.c @@ -1,6 +1,6 @@ /* util.c -- readline utility functions */ -/* Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -21,7 +21,9 @@ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> #include <fcntl.h> @@ -42,6 +44,7 @@ /* System-specific feature definitions and include files. */ #include "rldefs.h" +#include "rlmbutil.h" #if defined (TIOCSTAT_IN_SYS_IOCTL) # include <sys/ioctl.h> @@ -76,13 +79,29 @@ rl_alphabetic (c) strchr (pathname_alphabetic_chars, c) != NULL); } +#if defined (HANDLE_MULTIBYTE) +int +_rl_walphabetic (wc) + wchar_t wc; +{ + int c; + + if (iswalnum (wc)) + return (1); + + c = wc & 0177; + return (_rl_allow_pathname_alphabetic_chars && + strchr (pathname_alphabetic_chars, c) != NULL); +} +#endif + /* How to abort things. */ int _rl_abort_internal () { rl_ding (); rl_clear_message (); - _rl_init_argument (); + _rl_reset_argument (); rl_clear_pending_input (); RL_UNSETSTATE (RL_STATE_MACRODEF); @@ -95,13 +114,15 @@ _rl_abort_internal () } int -rl_abort (int count __attribute__((unused)), int key __attribute__((unused))) +rl_abort (count, key) + int count, key; { return (_rl_abort_internal ()); } int -rl_tty_status (int count __attribute__((unused)), int key __attribute__((unused))) +rl_tty_status (count, key) + int count, key; { #if defined (TIOCSTAT) ioctl (1, TIOCSTAT, (char *)0); @@ -150,7 +171,8 @@ rl_extend_line_buffer (len) /* A function for simple tilde expansion. */ int -rl_tilde_expand (int ignore __attribute__((unused)), int key __attribute__((unused))) +rl_tilde_expand (ignore, key) + int ignore, key; { register int start, end; char *homedir, *temp; diff --git a/cmd-line-utils/readline/vi_keymap.c b/cmd-line-utils/readline/vi_keymap.c index 53a67c674ce..4b48c75cc5d 100644 --- a/cmd-line-utils/readline/vi_keymap.c +++ b/cmd-line-utils/readline/vi_keymap.c @@ -130,7 +130,7 @@ KEYMAP_ENTRY_ARRAY vi_movement_keymap = { { ISFUNC, rl_revert_line }, /* U */ { ISFUNC, (rl_command_func_t *)0x0 }, /* V */ { ISFUNC, rl_vi_next_word }, /* W */ - { ISFUNC, rl_rubout }, /* X */ + { ISFUNC, rl_vi_rubout }, /* X */ { ISFUNC, rl_vi_yank_to }, /* Y */ { ISFUNC, (rl_command_func_t *)0x0 }, /* Z */ diff --git a/cmd-line-utils/readline/vi_mode.c b/cmd-line-utils/readline/vi_mode.c index a277fe2c237..d0b7e330adc 100644 --- a/cmd-line-utils/readline/vi_mode.c +++ b/cmd-line-utils/readline/vi_mode.c @@ -1,7 +1,7 @@ /* vi_mode.c -- A vi emulation mode for Bash. Derived from code written by Jeff Sparkes (jsparkes@bnr.ca). */ -/* Copyright (C) 1987-2004 Free Software Foundation, Inc. +/* Copyright (C) 1987-2005 Free Software Foundation, Inc. This file is part of the GNU Readline Library, a library for reading lines of text with interactive input and history editing. @@ -31,7 +31,9 @@ #if defined (VI_MODE) -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +# include <config.h> +#endif #include <sys/types.h> @@ -88,6 +90,7 @@ static int _rl_vi_last_arg_sign = 1; static int _rl_vi_last_motion; #if defined (HANDLE_MULTIBYTE) static char _rl_vi_last_search_mbchar[MB_LEN_MAX]; +static int _rl_vi_last_search_mblen; #else static int _rl_vi_last_search_char; #endif @@ -105,15 +108,35 @@ static int vi_mark_chars['z' - 'a' + 1]; static void _rl_vi_stuff_insert PARAMS((int)); static void _rl_vi_save_insert PARAMS((UNDO_LIST *)); + +static void _rl_vi_backup PARAMS((void)); + +static int _rl_vi_arg_dispatch PARAMS((int)); static int rl_digit_loop1 PARAMS((void)); +static int _rl_vi_set_mark PARAMS((void)); +static int _rl_vi_goto_mark PARAMS((void)); + +static void _rl_vi_append_forward PARAMS((int)); + +static int _rl_vi_callback_getchar PARAMS((char *, int)); + +#if defined (READLINE_CALLBACKS) +static int _rl_vi_callback_set_mark PARAMS((_rl_callback_generic_arg *)); +static int _rl_vi_callback_goto_mark PARAMS((_rl_callback_generic_arg *)); +static int _rl_vi_callback_change_char PARAMS((_rl_callback_generic_arg *)); +static int _rl_vi_callback_char_search PARAMS((_rl_callback_generic_arg *)); +#endif + void _rl_vi_initialize_line () { register int i; - for (i = 0; i < (int) (sizeof (vi_mark_chars) / sizeof (int)); i++) + for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++) vi_mark_chars[i] = -1; + + RL_UNSETSTATE(RL_STATE_VICMDONCE); } void @@ -166,7 +189,8 @@ _rl_vi_stuff_insert (count) redo a text modification command. The default for _rl_vi_last_command puts you back into insert mode. */ int -rl_vi_redo (int count, int c __attribute__((unused))) +rl_vi_redo (count, c) + int count, c; { int r; @@ -185,7 +209,16 @@ rl_vi_redo (int count, int c __attribute__((unused))) _rl_vi_stuff_insert (count); /* And back up point over the last character inserted. */ if (rl_point > 0) - rl_point--; + _rl_vi_backup (); + } + /* Ditto for redoing an insert with `a', but move forward a character first + like the `a' command does. */ + else if (_rl_vi_last_command == 'a' && vi_insert_buffer && *vi_insert_buffer) + { + _rl_vi_append_forward ('a'); + _rl_vi_stuff_insert (count); + if (rl_point > 0) + _rl_vi_backup (); } else r = _rl_dispatch (_rl_vi_last_command, _rl_keymap); @@ -204,7 +237,8 @@ rl_vi_undo (count, key) /* Yank the nth arg from the previous line into this line at point. */ int -rl_vi_yank_arg (int count, int key __attribute__((unused))) +rl_vi_yank_arg (count, key) + int count, key; { /* Readline thinks that the first word on a line is the 0th, while vi thinks the first word on a line is the 1st. Compensate. */ @@ -268,10 +302,12 @@ rl_vi_search (count, key) switch (key) { case '?': + _rl_free_saved_history_line (); rl_noninc_forward_search (count, key); break; case '/': + _rl_free_saved_history_line (); rl_noninc_reverse_search (count, key); break; @@ -284,7 +320,8 @@ rl_vi_search (count, key) /* Completion, from vi's point of view. */ int -rl_vi_complete (int ignore __attribute__((unused)), int key) +rl_vi_complete (ignore, key) + int ignore, key; { if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point]))) { @@ -310,7 +347,8 @@ rl_vi_complete (int ignore __attribute__((unused)), int key) /* Tilde expansion for vi mode. */ int -rl_vi_tilde_expand (int ignore __attribute__((unused)), int key) +rl_vi_tilde_expand (ignore, key) + int ignore, key; { rl_tilde_expand (0, key); rl_vi_start_inserting (key, 1, rl_arg_sign); @@ -380,7 +418,8 @@ rl_vi_end_word (count, key) /* Move forward a word the way that 'W' does. */ int -rl_vi_fWord (int count, int ignore __attribute__((unused))) +rl_vi_fWord (count, ignore) + int count, ignore; { while (count-- && rl_point < (rl_end - 1)) { @@ -396,7 +435,8 @@ rl_vi_fWord (int count, int ignore __attribute__((unused))) } int -rl_vi_bWord (int count, int ignore __attribute__((unused))) +rl_vi_bWord (count, ignore) + int count, ignore; { while (count-- && rl_point > 0) { @@ -419,7 +459,8 @@ rl_vi_bWord (int count, int ignore __attribute__((unused))) } int -rl_vi_eWord(int count, int ignore __attribute__((unused))) +rl_vi_eWord (count, ignore) + int count, ignore; { while (count-- && rl_point < (rl_end - 1)) { @@ -449,7 +490,8 @@ rl_vi_eWord(int count, int ignore __attribute__((unused))) } int -rl_vi_fword (int count, int ignore __attribute__((unused))) +rl_vi_fword (count, ignore) + int count, ignore; { while (count-- && rl_point < (rl_end - 1)) { @@ -474,7 +516,8 @@ rl_vi_fword (int count, int ignore __attribute__((unused))) } int -rl_vi_bword (int count, int ignore __attribute__((unused))) +rl_vi_bword (count, ignore) + int count, ignore; { while (count-- && rl_point > 0) { @@ -512,7 +555,8 @@ rl_vi_bword (int count, int ignore __attribute__((unused))) } int -rl_vi_eword (int count, int ignore __attribute__((unused))) +rl_vi_eword (count, ignore) + int count, ignore; { while (count-- && rl_point < rl_end - 1) { @@ -536,34 +580,46 @@ rl_vi_eword (int count, int ignore __attribute__((unused))) } int -rl_vi_insert_beg (int count __attribute__((unused)), int key) +rl_vi_insert_beg (count, key) + int count, key; { rl_beg_of_line (1, key); rl_vi_insertion_mode (1, key); return (0); } -int -rl_vi_append_mode (int count __attribute__((unused)), int key) +static void +_rl_vi_append_forward (key) + int key; { + int point; + if (rl_point < rl_end) { if (MB_CUR_MAX == 1 || rl_byte_oriented) rl_point++; else { - int point = rl_point; + point = rl_point; rl_forward_char (1, key); if (point == rl_point) rl_point = rl_end; } } - rl_vi_insertion_mode (1, key); +} + +int +rl_vi_append_mode (count, key) + int count, key; +{ + _rl_vi_append_forward (key); + rl_vi_start_inserting (key, 1, rl_arg_sign); return (0); } int -rl_vi_append_eol (int count __attribute__((unused)), int key) +rl_vi_append_eol (count, key) + int count, key; { rl_end_of_line (1, key); rl_vi_append_mode (1, key); @@ -572,7 +628,8 @@ rl_vi_append_eol (int count __attribute__((unused)), int key) /* What to do in the case of C-d. */ int -rl_vi_eof_maybe (int count __attribute__((unused)), int c __attribute__((unused))) +rl_vi_eof_maybe (count, c) + int count, c; { return (rl_newline (1, '\n')); } @@ -582,7 +639,8 @@ rl_vi_eof_maybe (int count __attribute__((unused)), int c __attribute__((unused) /* Switching from one mode to the other really just involves switching keymaps. */ int -rl_vi_insertion_mode (int count __attribute__((unused)), int key) +rl_vi_insertion_mode (count, key) + int count, key; { _rl_keymap = vi_insertion_keymap; _rl_vi_last_key_before_insert = key; @@ -595,7 +653,7 @@ _rl_vi_save_insert (up) { int len, start, end; - if (up == 0) + if (up == 0 || up->what != UNDO_INSERT) { if (vi_insert_buffer_size >= 1) vi_insert_buffer[0] = '\0'; @@ -644,13 +702,21 @@ _rl_vi_done_inserting () } int -rl_vi_movement_mode (int count __attribute__((unused)), int key) +rl_vi_movement_mode (count, key) + int count, key; { if (rl_point > 0) rl_backward_char (1, key); _rl_keymap = vi_movement_keymap; _rl_vi_done_inserting (); + + /* This is how POSIX.2 says `U' should behave -- everything up until the + first time you go into command mode should not be undone. */ + if (RL_ISSTATE (RL_STATE_VICMDONCE) == 0) + rl_free_undo_list (); + + RL_SETSTATE (RL_STATE_VICMDONCE); return (0); } @@ -672,7 +738,7 @@ _rl_vi_change_mbchar_case (count) { wchar_t wc; char mb[MB_LEN_MAX+1]; - int local_mblen; + int mlen, p; mbstate_t ps; memset (&ps, 0, sizeof (mbstate_t)); @@ -695,11 +761,14 @@ _rl_vi_change_mbchar_case (count) /* Vi is kind of strange here. */ if (wc) { - local_mblen = wcrtomb (mb, wc, &ps); - if (local_mblen >= 0) - mb[local_mblen] = '\0'; + p = rl_point; + mlen = wcrtomb (mb, wc, &ps); + if (mlen >= 0) + mb[mlen] = '\0'; rl_begin_undo_group (); - rl_delete (1, 0); + rl_vi_delete (1, 0); + if (rl_point < p) /* Did we retreat at EOL? */ + rl_point++; /* XXX - should we advance more than 1 for mbchar? */ rl_insert_text (mb); rl_end_undo_group (); rl_vi_check (); @@ -713,7 +782,8 @@ _rl_vi_change_mbchar_case (count) #endif int -rl_vi_change_case (int count, int ignore __attribute__((unused))) +rl_vi_change_case (count, ignore) + int count, ignore; { int c, p; @@ -772,6 +842,15 @@ rl_vi_put (count, key) return (0); } +static void +_rl_vi_backup () +{ + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); + else + rl_point--; +} + int rl_vi_check () { @@ -816,7 +895,9 @@ rl_vi_domove (key, nextkey) save = rl_numeric_arg; rl_numeric_arg = _rl_digit_value (c); rl_explicit_arg = 1; + RL_SETSTATE (RL_STATE_NUMERICARG|RL_STATE_VIMOTION); rl_digit_loop1 (); + RL_UNSETSTATE (RL_STATE_VIMOTION); rl_numeric_arg *= save; RL_SETSTATE(RL_STATE_MOREINPUT); c = rl_read_key (); /* real command */ @@ -889,52 +970,59 @@ rl_vi_domove (key, nextkey) return (0); } +/* Process C as part of the current numeric argument. Return -1 if the + argument should be aborted, 0 if we should not read any more chars, and + 1 if we should continue to read chars. */ +static int +_rl_vi_arg_dispatch (c) + int c; +{ + int key; + + key = c; + if (c >= 0 && _rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument) + { + rl_numeric_arg *= 4; + return 1; + } + + c = UNMETA (c); + + if (_rl_digit_p (c)) + { + if (rl_explicit_arg) + rl_numeric_arg = (rl_numeric_arg * 10) + _rl_digit_value (c); + else + rl_numeric_arg = _rl_digit_value (c); + rl_explicit_arg = 1; + return 1; + } + else + { + rl_clear_message (); + rl_stuff_char (key); + return 0; + } +} + /* A simplified loop for vi. Don't dispatch key at end. Don't recognize minus sign? Should this do rl_save_prompt/rl_restore_prompt? */ static int rl_digit_loop1 () { - int key, c; + int c, r; - RL_SETSTATE(RL_STATE_NUMERICARG); while (1) { - if (rl_numeric_arg > 1000000) - { - rl_explicit_arg = rl_numeric_arg = 0; - rl_ding (); - rl_clear_message (); - RL_UNSETSTATE(RL_STATE_NUMERICARG); - return 1; - } - rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg); - RL_SETSTATE(RL_STATE_MOREINPUT); - key = c = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); + if (_rl_arg_overflow ()) + return 1; - if (c >= 0 && _rl_keymap[c].type == ISFUNC && - _rl_keymap[c].function == rl_universal_argument) - { - rl_numeric_arg *= 4; - continue; - } + c = _rl_arg_getchar (); - c = UNMETA (c); - if (_rl_digit_p (c)) - { - if (rl_explicit_arg) - rl_numeric_arg = (rl_numeric_arg * 10) + _rl_digit_value (c); - else - rl_numeric_arg = _rl_digit_value (c); - rl_explicit_arg = 1; - } - else - { - rl_clear_message (); - rl_stuff_char (key); - break; - } + r = _rl_vi_arg_dispatch (c); + if (r <= 0) + break; } RL_UNSETSTATE(RL_STATE_NUMERICARG); @@ -942,7 +1030,8 @@ rl_digit_loop1 () } int -rl_vi_delete_to (int count __attribute__((unused)), int key) +rl_vi_delete_to (count, key) + int count, key; { int c; @@ -967,7 +1056,8 @@ rl_vi_delete_to (int count __attribute__((unused)), int key) } int -rl_vi_change_to (int count __attribute__((unused)), int key) +rl_vi_change_to (count, key) + int count, key; { int c, start_pos; @@ -1019,10 +1109,12 @@ rl_vi_change_to (int count __attribute__((unused)), int key) } int -rl_vi_yank_to (int count __attribute__((unused)), int key) +rl_vi_yank_to (count, key) + int count, key; { - int c, save = rl_point; + int c, save; + save = rl_point; if (_rl_uppercase_p (key)) rl_stuff_char ('$'); @@ -1047,11 +1139,45 @@ rl_vi_yank_to (int count __attribute__((unused)), int key) } int +rl_vi_rubout (count, key) + int count, key; +{ + int opoint; + + if (count < 0) + return (rl_vi_delete (-count, key)); + + if (rl_point == 0) + { + rl_ding (); + return -1; + } + + opoint = rl_point; + if (count > 1 && MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_backward_char (count, key); + else if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO); + else + rl_point -= count; + + if (rl_point < 0) + rl_point = 0; + + rl_kill_text (rl_point, opoint); + + return (0); +} + +int rl_vi_delete (count, key) int count, key; { int end; + if (count < 0) + return (rl_vi_rubout (-count, key)); + if (rl_end == 0) { rl_ding (); @@ -1070,11 +1196,13 @@ rl_vi_delete (count, key) if (rl_point > 0 && rl_point == rl_end) rl_backward_char (1, key); + return (0); } int -rl_vi_back_to_indent (int count __attribute__((unused)), int key) +rl_vi_back_to_indent (count, key) + int count, key; { rl_beg_of_line (1, key); while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) @@ -1083,75 +1211,115 @@ rl_vi_back_to_indent (int count __attribute__((unused)), int key) } int -rl_vi_first_print (int count __attribute__((unused)), int key) +rl_vi_first_print (count, key) + int count, key; { return (rl_vi_back_to_indent (1, key)); } +static int _rl_cs_dir, _rl_cs_orig_dir; + +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_char_search (data) + _rl_callback_generic_arg *data; +{ +#if defined (HANDLE_MULTIBYTE) + _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX); +#else + RL_SETSTATE(RL_STATE_MOREINPUT); + _rl_vi_last_search_char = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); +#endif + + _rl_callback_func = 0; + _rl_want_redisplay = 1; + +#if defined (HANDLE_MULTIBYTE) + return (_rl_char_search_internal (data->count, _rl_cs_dir, _rl_vi_last_search_mbchar, _rl_vi_last_search_mblen)); +#else + return (_rl_char_search_internal (data->count, _rl_cs_dir, _rl_vi_last_search_char)); +#endif +} +#endif + int rl_vi_char_search (count, key) int count, key; { #if defined (HANDLE_MULTIBYTE) static char *target; - static int mb_len; + static int tlen; #else static char target; #endif - static int orig_dir, dir; if (key == ';' || key == ',') - dir = key == ';' ? orig_dir : -orig_dir; + _rl_cs_dir = (key == ';') ? _rl_cs_orig_dir : -_rl_cs_orig_dir; else { - if (vi_redoing) -#if defined (HANDLE_MULTIBYTE) - target = _rl_vi_last_search_mbchar; -#else - target = _rl_vi_last_search_char; -#endif - else - { -#if defined (HANDLE_MULTIBYTE) - mb_len = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX); - target = _rl_vi_last_search_mbchar; -#else - RL_SETSTATE(RL_STATE_MOREINPUT); - _rl_vi_last_search_char = target = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); -#endif - } - switch (key) { case 't': - orig_dir = dir = FTO; + _rl_cs_orig_dir = _rl_cs_dir = FTO; break; case 'T': - orig_dir = dir = BTO; + _rl_cs_orig_dir = _rl_cs_dir = BTO; break; case 'f': - orig_dir = dir = FFIND; + _rl_cs_orig_dir = _rl_cs_dir = FFIND; break; case 'F': - orig_dir = dir = BFIND; + _rl_cs_orig_dir = _rl_cs_dir = BFIND; break; } + + if (vi_redoing) + { + /* set target and tlen below */ + } +#if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_data->i1 = _rl_cs_dir; + _rl_callback_func = _rl_vi_callback_char_search; + return (0); + } +#endif + else + { +#if defined (HANDLE_MULTIBYTE) + _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX); +#else + RL_SETSTATE(RL_STATE_MOREINPUT); + _rl_vi_last_search_char = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); +#endif + } } #if defined (HANDLE_MULTIBYTE) - return (_rl_char_search_internal (count, dir, target, mb_len)); + target = _rl_vi_last_search_mbchar; + tlen = _rl_vi_last_search_mblen; +#else + target = _rl_vi_last_search_char; +#endif + +#if defined (HANDLE_MULTIBYTE) + return (_rl_char_search_internal (count, _rl_cs_dir, target, tlen)); #else - return (_rl_char_search_internal (count, dir, target)); + return (_rl_char_search_internal (count, _rl_cs_dir, target)); #endif } /* Match brackets */ int -rl_vi_match (int ignore __attribute__((unused)), int key) +rl_vi_match (ignore, key) + int ignore, key; { int count = 1, brack, pos, tmp, pre; @@ -1255,24 +1423,12 @@ rl_vi_bracktype (c) } } -/* XXX - think about reading an entire mbchar with _rl_read_mbchar and - inserting it in one bunch instead of the loop below (like in - rl_vi_char_search or _rl_vi_change_mbchar_case). Set c to mbchar[0] - for test against 033 or ^C. Make sure that _rl_read_mbchar does - this right. */ -int -rl_vi_change_char (int count, int key __attribute__((unused))) +static int +_rl_vi_change_char (count, c, mb) + int count, c; + char *mb; { - int c, p; - - if (vi_redoing) - c = _rl_vi_last_replacement; - else - { - RL_SETSTATE(RL_STATE_MOREINPUT); - _rl_vi_last_replacement = c = rl_read_key (); - RL_UNSETSTATE(RL_STATE_MOREINPUT); - } + int p; if (c == '\033' || c == CTRL ('C')) return -1; @@ -1282,27 +1438,87 @@ rl_vi_change_char (int count, int key __attribute__((unused))) { p = rl_point; rl_vi_delete (1, c); + if (rl_point < p) /* Did we retreat at EOL? */ + rl_point++; #if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) - while (_rl_insert_char (1, c)) - { - RL_SETSTATE (RL_STATE_MOREINPUT); - c = rl_read_key (); - RL_UNSETSTATE (RL_STATE_MOREINPUT); - } + rl_insert_text (mb); else #endif - { - if (rl_point < p) /* Did we retreat at EOL? */ - rl_point++; - _rl_insert_char (1, c); - } + _rl_insert_char (1, c); } + + /* The cursor shall be left on the last character changed. */ + rl_backward_char (1, c); + rl_end_undo_group (); return (0); } +static int +_rl_vi_callback_getchar (mb, mlen) + char *mb; + int mlen; +{ + int c; + + RL_SETSTATE(RL_STATE_MOREINPUT); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_MOREINPUT); + +#if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) + c = _rl_read_mbstring (c, mb, mlen); +#endif + + return c; +} + +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_change_char (data) + _rl_callback_generic_arg *data; +{ + int c; + char mb[MB_LEN_MAX]; + + _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX); + + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_vi_change_char (data->count, c, mb)); +} +#endif + +int +rl_vi_change_char (count, key) + int count, key; +{ + int c; + char mb[MB_LEN_MAX]; + + if (vi_redoing) + { + c = _rl_vi_last_replacement; + mb[0] = c; + mb[1] = '\0'; + } +#if defined (READLINE_CALLBACKS) + else if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = _rl_callback_data_alloc (count); + _rl_callback_func = _rl_vi_callback_change_char; + return (0); + } +#endif + else + _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX); + + return (_rl_vi_change_char (count, c, mb)); +} + int rl_vi_subst (count, key) int count, key; @@ -1365,7 +1581,8 @@ rl_vi_overstrike_delete (count, key) } int -rl_vi_replace (int count __attribute__((unused)), int key __attribute__((unused))) +rl_vi_replace (count, key) + int count, key; { int i; @@ -1424,8 +1641,8 @@ rl_vi_possible_completions() #endif /* Functions to save and restore marks. */ -int -rl_vi_set_mark (int count __attribute__((unused)), int key __attribute__((unused))) +static int +_rl_vi_set_mark () { int ch; @@ -1443,8 +1660,36 @@ rl_vi_set_mark (int count __attribute__((unused)), int key __attribute__((unused return 0; } +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_set_mark (data) + _rl_callback_generic_arg *data; +{ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_vi_set_mark ()); +} +#endif + int -rl_vi_goto_mark (int count __attribute__((unused)), int key __attribute__((unused))) +rl_vi_set_mark (count, key) + int count, key; +{ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = 0; + _rl_callback_func = _rl_vi_callback_set_mark; + return (0); + } +#endif + + return (_rl_vi_set_mark ()); +} + +static int +_rl_vi_goto_mark () { int ch; @@ -1473,4 +1718,31 @@ rl_vi_goto_mark (int count __attribute__((unused)), int key __attribute__((unuse return 0; } +#if defined (READLINE_CALLBACKS) +static int +_rl_vi_callback_goto_mark (data) + _rl_callback_generic_arg *data; +{ + _rl_callback_func = 0; + _rl_want_redisplay = 1; + + return (_rl_vi_goto_mark ()); +} +#endif + +int +rl_vi_goto_mark (count, key) + int count, key; +{ +#if defined (READLINE_CALLBACKS) + if (RL_ISSTATE (RL_STATE_CALLBACK)) + { + _rl_callback_data = 0; + _rl_callback_func = _rl_vi_callback_goto_mark; + return (0); + } +#endif + + return (_rl_vi_goto_mark ()); +} #endif /* VI_MODE */ diff --git a/cmd-line-utils/readline/xmalloc.c b/cmd-line-utils/readline/xmalloc.c index 497936d3b43..8985d340d39 100644 --- a/cmd-line-utils/readline/xmalloc.c +++ b/cmd-line-utils/readline/xmalloc.c @@ -20,7 +20,9 @@ Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #define READLINE_LIBRARY -#include "config_readline.h" +#if defined (HAVE_CONFIG_H) +#include <config.h> +#endif #include <stdio.h> @@ -39,7 +41,8 @@ /* **************************************************************** */ static void -memory_error_and_abort(const char *fname) +memory_error_and_abort (fname) + char *fname; { fprintf (stderr, "%s: out of virtual memory\n", fname); exit (2); @@ -56,7 +59,7 @@ xmalloc (bytes) temp = malloc (bytes); if (temp == 0) - memory_error_and_abort("xmalloc"); + memory_error_and_abort ("xmalloc"); return (temp); } @@ -70,7 +73,7 @@ xrealloc (pointer, bytes) temp = pointer ? realloc (pointer, bytes) : malloc (bytes); if (temp == 0) - memory_error_and_abort("xrealloc"); + memory_error_and_abort ("xrealloc"); return (temp); } diff --git a/configure.in b/configure.in index 161a70dae5f..1ad79c398fb 100644 --- a/configure.in +++ b/configure.in @@ -20,6 +20,7 @@ SHARED_LIB_MAJOR_VERSION=16 SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0 NDB_SHARED_LIB_MAJOR_VERSION=3 NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 + # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` @@ -789,7 +790,6 @@ AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity)) AC_CHECK_LIB(nsl_r, gethostbyname_r, [], AC_CHECK_LIB(nsl, gethostbyname_r)) AC_CHECK_FUNC(gethostbyname_r) -AC_CHECK_LIB(mtmalloc, malloc) AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) AC_CHECK_FUNC(yp_get_default_domain, , @@ -2379,10 +2379,15 @@ AC_ARG_WITH(docs, if test "$with_docs" = "yes" then docs_dirs="Docs" + if test -f "$srcdir/Docs/manual.chm" ; then + extra_docs="manual.chm" + fi else docs_dirs="" + extra_docs="" fi AC_SUBST(docs_dirs) +AC_SUBST(extra_docs) # Shall we build the man pages? AC_ARG_WITH(man, diff --git a/include/my_base.h b/include/my_base.h index 339554979a8..947f7695215 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -187,7 +187,13 @@ enum ha_extra_function { Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY. */ - HA_EXTRA_INSERT_WITH_UPDATE + HA_EXTRA_INSERT_WITH_UPDATE, + /* + Orders MERGE handler to attach or detach its child tables. Used at + begin and end of a statement. + */ + HA_EXTRA_ATTACH_CHILDREN, + HA_EXTRA_DETACH_CHILDREN }; /* The following is parameter to ha_panic() */ @@ -244,6 +250,8 @@ enum ha_base_keytype { HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) +#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */ + /* Automatic bits in key-flag */ #define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */ @@ -407,9 +415,11 @@ enum ha_base_keytype { #define HA_ERR_RECORD_IS_THE_SAME 169 /* row not actually updated : new values same as the old values */ -#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this - statement */ -#define HA_ERR_LAST 170 /*Copy last error nr.*/ +#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this + statement */ +#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to + illegal data being read */ +#define HA_ERR_LAST 171 /*Copy last error nr.*/ /* Add error numbers before HA_ERR_LAST and change it accordingly. */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) diff --git a/include/my_global.h b/include/my_global.h index ce76aeaec20..4b0786aa826 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -116,36 +116,31 @@ The macros below are used to allow build of Universal/fat binaries of MySQL and MySQL applications under darwin. */ -#ifdef TARGET_FAT_BINARY -# undef SIZEOF_CHARP -# undef SIZEOF_INT -# undef SIZEOF_LONG -# undef SIZEOF_LONG_LONG -# undef SIZEOF_OFF_T -# undef SIZEOF_SHORT - -#if defined(__i386__) -# undef WORDS_BIGENDIAN -# define SIZEOF_CHARP 4 -# define SIZEOF_INT 4 -# define SIZEOF_LONG 4 -# define SIZEOF_LONG_LONG 8 -# define SIZEOF_OFF_T 8 -# define SIZEOF_SHORT 2 - -#elif defined(__ppc__) -# define WORDS_BIGENDIAN -# define SIZEOF_CHARP 4 -# define SIZEOF_INT 4 -# define SIZEOF_LONG 4 -# define SIZEOF_LONG_LONG 8 -# define SIZEOF_OFF_T 8 -# define SIZEOF_SHORT 2 - -#else -# error Building FAT binary for an unknown architecture. -#endif -#endif /* TARGET_FAT_BINARY */ +#if defined(__APPLE__) && defined(__MACH__) +# undef SIZEOF_CHARP +# undef SIZEOF_SHORT +# undef SIZEOF_INT +# undef SIZEOF_LONG +# undef SIZEOF_LONG_LONG +# undef SIZEOF_OFF_T +# undef WORDS_BIGENDIAN +# define SIZEOF_SHORT 2 +# define SIZEOF_INT 4 +# define SIZEOF_LONG_LONG 8 +# define SIZEOF_OFF_T 8 +# if defined(__i386__) || defined(__ppc__) +# define SIZEOF_CHARP 4 +# define SIZEOF_LONG 4 +# elif defined(__x86_64__) || defined(__ppc64__) +# define SIZEOF_CHARP 8 +# define SIZEOF_LONG 8 +# else +# error Building FAT binary for an unknown architecture. +# endif +# if defined(__ppc__) || defined(__ppc64__) +# define WORDS_BIGENDIAN +# endif +#endif /* defined(__APPLE__) && defined(__MACH__) */ /* diff --git a/include/my_sys.h b/include/my_sys.h index 2ce36760032..e13c4cde78b 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -691,6 +691,8 @@ extern WF_PACK *wf_comp(char * str); extern int wf_test(struct wild_file_pack *wf_pack,const char *name); extern void wf_end(struct wild_file_pack *buffer); extern size_t strip_sp(char * str); +extern my_bool array_append_string_unique(const char *str, + const char **array, size_t size); extern void get_date(char * to,int timeflag,time_t use_time); extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr, pbool remove_garbage); @@ -710,8 +712,10 @@ extern sig_handler my_set_alarm_variable(int signo); extern void my_string_ptr_sort(uchar *base, uint items, size_t size); extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, size_t size_of_element,uchar *buffer[]); -extern qsort_t qsort2(void *base_ptr, size_t total_elems, size_t size, - qsort2_cmp cmp, void *cmp_argument); +extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size, + qsort_cmp cmp); +extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size, + qsort2_cmp cmp, void *cmp_argument); extern qsort2_cmp get_ptr_compare(size_t); void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos); my_off_t my_get_ptr(uchar *ptr, size_t pack_length); @@ -782,7 +786,7 @@ extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element); #define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index)) #define push_dynamic(A,B) insert_dynamic((A),(B)) #define reset_dynamic(array) ((array)->elements= 0) -#define sort_dynamic(A,cmp) qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp)) +#define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp)) extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, size_t init_alloc,size_t alloc_increment); diff --git a/include/myisammrg.h b/include/myisammrg.h index eed50bebaee..cc6e6aac6cd 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -69,9 +69,12 @@ typedef struct st_myrg_info uint merge_insert_method; uint tables,options,reclength,keys; my_bool cache_in_use; + /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */ + my_bool children_attached; LIST open_list; QUEUE by_key; ulong *rec_per_key_part; /* for sql optimizing */ + pthread_mutex_t mutex; } MYRG_INFO; @@ -80,6 +83,13 @@ typedef struct st_myrg_info extern int myrg_close(MYRG_INFO *file); extern int myrg_delete(MYRG_INFO *file,const uchar *buff); extern MYRG_INFO *myrg_open(const char *name,int mode,int wait_if_locked); +extern MYRG_INFO *myrg_parent_open(const char *parent_name, + int (*callback)(void*, const char*), + void *callback_param); +extern int myrg_attach_children(MYRG_INFO *m_info, int handle_locking, + MI_INFO *(*callback)(void*), + void *callback_param); +extern int myrg_detach_children(MYRG_INFO *m_info); extern int myrg_panic(enum ha_panic_function function); extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx); extern int myrg_rlast(MYRG_INFO *file,uchar *buf,int inx); diff --git a/include/mysql.h b/include/mysql.h index 68cce3196a0..d114afb6c93 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -557,16 +557,6 @@ unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, unsigned long length); void STDCALL mysql_debug(const char *debug); -char * STDCALL mysql_odbc_escape_string(MYSQL *mysql, - char *to, - unsigned long to_length, - const char *from, - unsigned long from_length, - void *param, - char * - (*extend_buffer) - (void *, char *to, - unsigned long *length)); void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); unsigned int STDCALL mysql_thread_safe(void); my_bool STDCALL mysql_embedded(void); diff --git a/include/mysql_h.ic b/include/mysql_h.ic index 12e16df878a..4bedb9e8050 100644 --- a/include/mysql_h.ic +++ b/include/mysql_h.ic @@ -54,7 +54,7 @@ typedef struct st_list LIST; typedef struct st_mem_root MEM_ROOT; # 258 "mysql.h" typedef struct st_mysql MYSQL; -# 664 "mysql.h" +# 654 "mysql.h" typedef struct st_mysql_bind MYSQL_BIND; # 95 "mysql.h" typedef struct st_mysql_field MYSQL_FIELD; @@ -72,17 +72,17 @@ typedef struct st_mysql_res MYSQL_RES; typedef char * * MYSQL_ROW; # 145 "mysql.h" typedef MYSQL_ROWS * MYSQL_ROW_OFFSET; -# 693 "mysql.h" +# 683 "mysql.h" typedef struct st_mysql_stmt MYSQL_STMT; # 52 "mysql/plugin.h" typedef struct st_mysql_xid MYSQL_XID; # 243 "mysql.h" typedef struct character_set MY_CHARSET_INFO; -# 187 "mysql_com.h" +# 188 "mysql_com.h" typedef struct st_net NET; # 22 "typelib.h" typedef struct st_typelib TYPELIB; -# 177 "mysql_com.h" +# 178 "mysql_com.h" typedef struct st_vio Vio; # 28 "my_list.h" typedef int (* list_walk_action)(void *, void *); @@ -92,7 +92,7 @@ typedef char my_bool; typedef int my_socket; # 128 "mysql.h" typedef unsigned long long int my_ulonglong; -# 214 "/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h" +# 214 "/usr/lib/gcc/i486-linux-gnu/4.1.3/include/stddef.h" typedef unsigned int size_t; # 149 "mysql.h" typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; @@ -102,13 +102,13 @@ typedef struct st_mysql_data MYSQL_DATA; typedef struct st_mysql_ftparser_boolean_info MYSQL_FTPARSER_BOOLEAN_INFO; # 557 "mysql/plugin.h" typedef struct st_mysql_ftparser_param MYSQL_FTPARSER_PARAM; -# 763 "mysql.h" +# 753 "mysql.h" typedef struct st_mysql_methods MYSQL_METHODS; # 47 "mysql_time.h" typedef struct st_mysql_time MYSQL_TIME; -# 383 "mysql_com.h" +# 384 "mysql_com.h" typedef struct st_udf_args UDF_ARGS; -# 397 "mysql_com.h" +# 398 "mysql_com.h" typedef struct st_udf_init UDF_INIT; # 26 "my_alloc.h" typedef struct st_used_mem USED_MEM; @@ -130,7 +130,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo unsigned int mbminlen; unsigned int mbmaxlen; }; -# 369 "mysql_com.h" +# 370 "mysql_com.h" struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct { unsigned long int seed1; @@ -203,7 +203,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned char * info_buffer; void * extension; }; -# 664 "mysql.h" +# 654 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_bind { unsigned long int * length; @@ -328,7 +328,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned char last_error[256]; void * extension; }; -# 763 "mysql.h" +# 753 "mysql.h" struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods { my_bool (* read_query_result)(MYSQL * mysql); @@ -448,7 +448,7 @@ struct __attribute__((aligned(__alignof__(void *)))) st_mysql_show_var char * value; enum enum_mysql_show_type type; }; -# 693 "mysql.h" +# 683 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_stmt { MEM_ROOT mem_root; @@ -513,7 +513,7 @@ struct __attribute__((aligned(__alignof__(long int)))) st_mysql_xid long int bqual_length; char data[128]; }; -# 187 "mysql_com.h" +# 188 "mysql_com.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_net { Vio * vio; @@ -558,7 +558,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo char const * * type_names; unsigned int * type_lengths; }; -# 383 "mysql_com.h" +# 384 "mysql_com.h" struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args { unsigned int arg_count; @@ -570,7 +570,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo unsigned long int * attribute_lengths; void * extension; }; -# 397 "mysql_com.h" +# 398 "mysql_com.h" struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init { my_bool maybe_null; @@ -587,7 +587,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned unsigned int left; unsigned int size; }; -# 380 "mysql_com.h" +# 381 "mysql_com.h" enum Item_result { STRING_RESULT = 0, @@ -596,7 +596,7 @@ enum Item_result ROW_RESULT = 3, DECIMAL_RESULT = 4, }; -# 321 "mysql_com.h" +# 322 "mysql_com.h" enum enum_cursor_type { CURSOR_TYPE_NO_CURSOR = 0, @@ -604,7 +604,7 @@ enum enum_cursor_type CURSOR_TYPE_FOR_UPDATE = 2, CURSOR_TYPE_SCROLLABLE = 4, }; -# 234 "mysql_com.h" +# 235 "mysql_com.h" enum enum_field_types { MYSQL_TYPE_DECIMAL = 0, @@ -651,7 +651,7 @@ enum enum_ftparser_mode MYSQL_FTPARSER_WITH_STOPWORDS = 1, MYSQL_FTPARSER_FULL_BOOLEAN_INFO = 2, }; -# 331 "mysql_com.h" +# 332 "mysql_com.h" enum enum_mysql_set_option { MYSQL_OPTION_MULTI_STATEMENTS_ON = 0, @@ -671,7 +671,7 @@ enum enum_mysql_show_type SHOW_FUNC = 8, SHOW_DOUBLE = 9, }; -# 594 "mysql.h" +# 584 "mysql.h" enum enum_mysql_stmt_state { MYSQL_STMT_INIT_DONE = 1, @@ -723,14 +723,14 @@ enum enum_server_command COM_DAEMON = 29, COM_END = 30, }; -# 740 "mysql.h" +# 730 "mysql.h" enum enum_stmt_attr_type { STMT_ATTR_UPDATE_MAX_LENGTH = 0, STMT_ATTR_CURSOR_TYPE = 1, STMT_ATTR_PREFETCH_ROWS = 2, }; -# 296 "mysql_com.h" +# 297 "mysql_com.h" enum mysql_enum_shutdown_level { SHUTDOWN_DEFAULT = 0, @@ -790,13 +790,13 @@ enum mysql_status MYSQL_STATUS_GET_RESULT = 1, MYSQL_STATUS_USE_RESULT = 2, }; -# 438 "mysql_com.h" +# 439 "mysql_com.h" extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2); -# 431 "mysql_com.h" +# 432 "mysql_com.h" extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt); # 35 "typelib.h" extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from); -# 426 "mysql_com.h" +# 427 "mysql_com.h" extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st); # 32 "typelib.h" extern int find_type(char * x, TYPELIB const * typelib, unsigned int); @@ -804,15 +804,15 @@ extern int find_type(char * x, TYPELIB const * typelib, unsigned int); extern int find_type_or_exit(char const * x, TYPELIB * typelib, char const * option); # 29 "typelib.h" extern my_ulonglong find_typeset(char * x, TYPELIB * typelib, int * error_position); -# 440 "mysql_com.h" +# 441 "mysql_com.h" extern void get_salt_from_password(unsigned char * res, char const * password); -# 433 "mysql_com.h" +# 434 "mysql_com.h" extern void get_salt_from_password_323(unsigned long int * res, char const * password); -# 446 "mysql_com.h" +# 447 "mysql_com.h" extern char * get_tty_password(char const * opt_message); # 34 "typelib.h" extern char const * get_type(TYPELIB * typelib, unsigned int); -# 428 "mysql_com.h" +# 429 "mysql_com.h" extern void hash_password(unsigned long int * to, char const * password, unsigned int); # 30 "my_list.h" extern LIST * list_add(LIST * root, LIST * element); @@ -828,47 +828,47 @@ extern unsigned int list_length(LIST *); extern LIST * list_reverse(LIST * root); # 36 "my_list.h" extern int list_walk(LIST *, list_walk_action, unsigned char * argument); -# 441 "mysql_com.h" +# 442 "mysql_com.h" extern void make_password_from_salt(char * to, unsigned char const * hash_stage2); -# 434 "mysql_com.h" +# 435 "mysql_com.h" extern void make_password_from_salt_323(char * to, unsigned long int const * salt); -# 436 "mysql_com.h" +# 437 "mysql_com.h" extern void make_scrambled_password(char * to, char const * password); -# 429 "mysql_com.h" +# 430 "mysql_com.h" extern void make_scrambled_password_323(char * to, char const * password); # 33 "typelib.h" extern void make_type(char * to, unsigned int, TYPELIB * typelib); -# 366 "mysql_com.h" +# 367 "mysql_com.h" extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int); -# 343 "mysql_com.h" -extern my_bool my_net_init(NET * net, Vio * vio); # 344 "mysql_com.h" +extern my_bool my_net_init(NET * net, Vio * vio); +# 345 "mysql_com.h" extern void my_net_local_init(NET * net); -# 354 "mysql_com.h" +# 355 "mysql_com.h" extern unsigned long int my_net_read(NET * net); -# 349 "mysql_com.h" +# 350 "mysql_com.h" extern my_bool my_net_write(NET * net, unsigned char const * packet, size_t); -# 425 "mysql_com.h" +# 426 "mysql_com.h" extern double my_rnd(struct rand_struct *); -# 452 "mysql_com.h" +# 453 "mysql_com.h" extern void my_thread_end(void); -# 451 "mysql_com.h" +# 452 "mysql_com.h" extern my_bool my_thread_init(void); -# 570 "mysql.h" +# 560 "mysql.h" extern void myodbc_remove_escape(MYSQL * mysql, char * name); # 512 "mysql.h" extern int mysql_add_slave(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd); # 421 "mysql.h" extern my_ulonglong mysql_affected_rows(MYSQL * mysql); -# 836 "mysql.h" +# 826 "mysql.h" extern my_bool mysql_autocommit(MYSQL * mysql, my_bool); # 437 "mysql.h" extern my_bool mysql_change_user(MYSQL * mysql, char const * user, char const * passwd, char const * db); # 429 "mysql.h" extern char const * mysql_character_set_name(MYSQL * mysql); -# 839 "mysql.h" +# 829 "mysql.h" extern void mysql_close(MYSQL * sock); -# 834 "mysql.h" +# 824 "mysql.h" extern my_bool mysql_commit(MYSQL * mysql); # 541 "mysql.h" extern void mysql_data_seek(MYSQL_RES * result, my_ulonglong); @@ -880,7 +880,7 @@ extern void mysql_disable_reads_from_master(MYSQL * mysql); extern void mysql_disable_rpl_parse(MYSQL * mysql); # 520 "mysql.h" extern int mysql_dump_debug_info(MYSQL * mysql); -# 572 "mysql.h" +# 562 "mysql.h" extern my_bool mysql_embedded(void); # 497 "mysql.h" extern void mysql_enable_reads_from_master(MYSQL * mysql); @@ -890,7 +890,7 @@ extern void mysql_enable_rpl_parse(MYSQL * mysql); extern my_bool mysql_eof(MYSQL_RES * res); # 423 "mysql.h" extern unsigned int mysql_errno(MYSQL * mysql); -# 447 "mysql_com.h" +# 448 "mysql_com.h" extern char const * mysql_errno_to_sqlstate(unsigned int); # 424 "mysql.h" extern char const * mysql_error(MYSQL * mysql); @@ -950,30 +950,28 @@ extern MYSQL_RES * mysql_list_fields(MYSQL * mysql, char const * table, char con extern MYSQL_RES * mysql_list_processes(MYSQL * mysql); # 536 "mysql.h" extern MYSQL_RES * mysql_list_tables(MYSQL * mysql, char const * wild); -# 579 "mysql.h" +# 569 "mysql.h" extern void mysql_manager_close(MYSQL_MANAGER * con); -# 580 "mysql.h" +# 570 "mysql.h" extern int mysql_manager_command(MYSQL_MANAGER * con, char const * cmd, int); -# 574 "mysql.h" +# 564 "mysql.h" extern MYSQL_MANAGER * mysql_manager_connect(MYSQL_MANAGER * con, char const * host, char const * user, char const * passwd, unsigned int); -# 582 "mysql.h" +# 572 "mysql.h" extern int mysql_manager_fetch_line(MYSQL_MANAGER * con, char * res_buf, int); -# 573 "mysql.h" +# 563 "mysql.h" extern MYSQL_MANAGER * mysql_manager_init(MYSQL_MANAGER * con); # 456 "mysql.h" extern my_bool mysql_master_query(MYSQL * mysql, char const * q, unsigned long int); # 458 "mysql.h" extern my_bool mysql_master_send_query(MYSQL * mysql, char const * q, unsigned long int); -# 837 "mysql.h" +# 827 "mysql.h" extern my_bool mysql_more_results(MYSQL * mysql); -# 838 "mysql.h" +# 828 "mysql.h" extern int mysql_next_result(MYSQL * mysql); # 412 "mysql.h" extern unsigned int mysql_num_fields(MYSQL_RES * res); # 411 "mysql.h" extern my_ulonglong mysql_num_rows(MYSQL_RES * res); -# 560 "mysql.h" -extern char * mysql_odbc_escape_string(MYSQL * mysql, char * to, unsigned long int, char const * from, unsigned long int, void * param, char * (* extend_buffer)(void *, char * to, unsigned long int * length)); # 538 "mysql.h" extern int mysql_options(MYSQL * mysql, enum mysql_option, void const * arg); # 527 "mysql.h" @@ -984,7 +982,7 @@ extern unsigned int mysql_port; extern int mysql_query(MYSQL * mysql, char const * q); # 780 "mysql/plugin.h" extern void mysql_query_cache_invalidate4(void * thd, char const * key, unsigned int, int); -# 585 "mysql.h" +# 575 "mysql.h" extern my_bool mysql_read_query_result(MYSQL * mysql); # 500 "mysql.h" extern my_bool mysql_reads_from_master_enabled(MYSQL * mysql); @@ -996,7 +994,7 @@ extern unsigned long int mysql_real_escape_string(MYSQL * mysql, char * to, char extern int mysql_real_query(MYSQL * mysql, char const * q, unsigned long int); # 521 "mysql.h" extern int mysql_refresh(MYSQL * mysql, unsigned int); -# 835 "mysql.h" +# 825 "mysql.h" extern my_bool mysql_rollback(MYSQL * mysql); # 543 "mysql.h" extern MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES * result, MYSQL_ROW_OFFSET); @@ -1038,59 +1036,59 @@ extern char const * mysql_sqlstate(MYSQL * mysql); extern my_bool mysql_ssl_set(MYSQL * mysql, char const * key, char const * cert, char const * ca, char const * capath, char const * cipher); # 528 "mysql.h" extern char const * mysql_stat(MYSQL * mysql); -# 830 "mysql.h" +# 820 "mysql.h" extern my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt); -# 808 "mysql.h" +# 798 "mysql.h" extern my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void * attr); -# 805 "mysql.h" +# 795 "mysql.h" extern my_bool mysql_stmt_attr_set(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void const * attr); -# 811 "mysql.h" +# 801 "mysql.h" extern my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -# 812 "mysql.h" +# 802 "mysql.h" extern my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -# 813 "mysql.h" +# 803 "mysql.h" extern my_bool mysql_stmt_close(MYSQL_STMT * stmt); -# 828 "mysql.h" +# 818 "mysql.h" extern void mysql_stmt_data_seek(MYSQL_STMT * stmt, my_ulonglong); -# 822 "mysql.h" +# 812 "mysql.h" extern unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); -# 823 "mysql.h" +# 813 "mysql.h" extern char const * mysql_stmt_error(MYSQL_STMT * stmt); -# 798 "mysql.h" +# 788 "mysql.h" extern int mysql_stmt_execute(MYSQL_STMT * stmt); -# 799 "mysql.h" +# 789 "mysql.h" extern int mysql_stmt_fetch(MYSQL_STMT * stmt); -# 800 "mysql.h" +# 790 "mysql.h" extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind_arg, unsigned int, unsigned long int); -# 832 "mysql.h" +# 822 "mysql.h" extern unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt); -# 815 "mysql.h" +# 805 "mysql.h" extern my_bool mysql_stmt_free_result(MYSQL_STMT * stmt); -# 795 "mysql.h" +# 785 "mysql.h" extern MYSQL_STMT * mysql_stmt_init(MYSQL * mysql); -# 831 "mysql.h" +# 821 "mysql.h" extern my_ulonglong mysql_stmt_insert_id(MYSQL_STMT * stmt); -# 829 "mysql.h" +# 819 "mysql.h" extern my_ulonglong mysql_stmt_num_rows(MYSQL_STMT * stmt); -# 804 "mysql.h" +# 794 "mysql.h" extern unsigned long int mysql_stmt_param_count(MYSQL_STMT * stmt); -# 821 "mysql.h" +# 811 "mysql.h" extern MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT * stmt); -# 796 "mysql.h" +# 786 "mysql.h" extern int mysql_stmt_prepare(MYSQL_STMT * stmt, char const * query, unsigned long int); -# 814 "mysql.h" +# 804 "mysql.h" extern my_bool mysql_stmt_reset(MYSQL_STMT * stmt); -# 820 "mysql.h" +# 810 "mysql.h" extern MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT * stmt); -# 825 "mysql.h" +# 815 "mysql.h" extern MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT * stmt, MYSQL_ROW_OFFSET); -# 827 "mysql.h" +# 817 "mysql.h" extern MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT * stmt); -# 816 "mysql.h" +# 806 "mysql.h" extern my_bool mysql_stmt_send_long_data(MYSQL_STMT * stmt, unsigned int, char const * data, unsigned long int); -# 824 "mysql.h" +# 814 "mysql.h" extern char const * mysql_stmt_sqlstate(MYSQL_STMT * stmt); -# 803 "mysql.h" +# 793 "mysql.h" extern int mysql_stmt_store_result(MYSQL_STMT * stmt); # 452 "mysql.h" extern MYSQL_RES * mysql_store_result(MYSQL * mysql); @@ -1100,7 +1098,7 @@ extern void mysql_thread_end(void); extern unsigned long int mysql_thread_id(MYSQL * mysql); # 403 "mysql.h" extern my_bool mysql_thread_init(void); -# 571 "mysql.h" +# 561 "mysql.h" extern unsigned int mysql_thread_safe(void); # 699 "mysql/plugin.h" extern int mysql_tmpfile(char const * prefix); @@ -1110,25 +1108,25 @@ extern char * mysql_unix_port; extern MYSQL_RES * mysql_use_result(MYSQL * mysql); # 426 "mysql.h" extern unsigned int mysql_warning_count(MYSQL * mysql); -# 346 "mysql_com.h" +# 347 "mysql_com.h" extern void net_clear(NET * net, my_bool); -# 345 "mysql_com.h" +# 346 "mysql_com.h" extern void net_end(NET * net); -# 348 "mysql_com.h" +# 349 "mysql_com.h" extern my_bool net_flush(NET * net); -# 353 "mysql_com.h" +# 354 "mysql_com.h" extern int net_real_write(NET * net, unsigned char const * packet, size_t); -# 347 "mysql_com.h" +# 348 "mysql_com.h" extern my_bool net_realloc(NET * net, size_t); -# 350 "mysql_com.h" +# 351 "mysql_com.h" extern my_bool net_write_command(NET * net, unsigned char, unsigned char const * header, size_t, unsigned char const * packet, size_t); -# 442 "mysql_com.h" +# 443 "mysql_com.h" extern char * octet2hex(char * to, char const * str, unsigned int); -# 423 "mysql_com.h" +# 424 "mysql_com.h" extern void randominit(struct rand_struct *, unsigned long int, unsigned long int); -# 437 "mysql_com.h" +# 438 "mysql_com.h" extern void scramble(char * to, char const * message, char const * password); -# 430 "mysql_com.h" +# 431 "mysql_com.h" extern void scramble_323(char * to, char const * message, char const * password); # 37 "typelib.h" extern TYPELIB sql_protocol_typelib; diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index de5d3df103c..b761907ec9d 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -75,7 +75,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c get_password.c ../strings/int2str.c ../strings/is_prefix.c libmysql.c ../mysys/list.c ../strings/llstr.c - ../strings/longlong2str.c manager.c ../mysys/mf_cache.c + ../strings/longlong2str.c manager.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c ../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c ../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c ../mysys/mf_pack.c ../mysys/mf_path.c ../mysys/mf_tempfile.c ../mysys/mf_unixpath.c @@ -97,7 +97,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c ../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c - ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c + ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c ../mysys/my_getsystime.c ${LIB_SOURCES}) # Need to set USE_TLS for building the DLL, since __declspec(thread) diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index 3a2559921f9..53b24c4fb42 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -59,7 +59,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ mf_pack.lo my_messnc.lo mf_dirname.lo mf_fn_ext.lo\ mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \ mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \ - my_symlink.lo my_fstream.lo \ + my_symlink.lo my_fstream.lo mf_arr_appstr.lo \ mf_loadpath.lo my_pthread.lo my_thr_init.lo \ thr_mutex.lo mulalloc.lo string.lo \ default.lo default_modify.lo \ @@ -73,7 +73,7 @@ sqlobjects = net.lo sql_cmn_objects = pack.lo client.lo my_time.lo # Not needed in the minimum library -mysysobjects2 = my_lib.lo +mysysobjects2 = my_lib.lo mf_qsort.lo mysysobjects = $(mysysobjects1) $(mysysobjects2) target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \ $(sql_cmn_objects) $(vio_objects) $(sqlobjects) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index cb326fa4685..bf5dd7d63eb 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1629,78 +1629,6 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, return escape_string_for_mysql(mysql->charset, to, 0, from, length); } - -char * STDCALL -mysql_odbc_escape_string(MYSQL *mysql, - char *to, ulong to_length, - const char *from, ulong from_length, - void *param, - char * (*extend_buffer) - (void *, char *, ulong *)) -{ - char *to_end=to+to_length-5; - const char *end; -#ifdef USE_MB - my_bool use_mb_flag=use_mb(mysql->charset); -#endif - - for (end=from+from_length; from != end ; from++) - { - if (to >= to_end) - { - to_length = (ulong) (end-from)+512; /* We want this much more */ - if (!(to=(*extend_buffer)(param, to, &to_length))) - return to; - to_end=to+to_length-5; - } -#ifdef USE_MB - { - int l; - if (use_mb_flag && (l = my_ismbchar(mysql->charset, from, end))) - { - while (l--) - *to++ = *from++; - from--; - continue; - } - } -#endif - switch (*from) { - case 0: /* Must be escaped for 'mysql' */ - *to++= '\\'; - *to++= '0'; - break; - case '\n': /* Must be escaped for logs */ - *to++= '\\'; - *to++= 'n'; - break; - case '\r': - *to++= '\\'; - *to++= 'r'; - break; - case '\\': - *to++= '\\'; - *to++= '\\'; - break; - case '\'': - *to++= '\\'; - *to++= '\''; - break; - case '"': /* Better safe than sorry */ - *to++= '\\'; - *to++= '"'; - break; - case '\032': /* This gives problems on Win32 */ - *to++= '\\'; - *to++= 'Z'; - break; - default: - *to++= *from; - } - } - return to; -} - void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name) { diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index 8c6b71d9553..81f86dc8726 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -78,7 +78,6 @@ EXPORTS mysql_next_result mysql_num_fields mysql_num_rows - mysql_odbc_escape_string mysql_options mysql_stmt_param_count mysql_stmt_param_metadata diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am index 2ff4082b014..4a37dcfdec9 100644 --- a/libmysql_r/Makefile.am +++ b/libmysql_r/Makefile.am @@ -41,6 +41,7 @@ link_sources: @LN_CP_F@ $$d/$$f $$f; \ done; \ done + echo timestamp > link_sources # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index 78ff08e510a..2aa75c0b23c 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -78,7 +78,6 @@ EXPORTS mysql_next_result mysql_num_fields mysql_num_rows - mysql_odbc_escape_string mysql_options mysql_ping mysql_query diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 900ee14bd4e..79d11c857ab 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -44,6 +44,7 @@ dist-hook: $(distdir)/std_data/ndb_backup51 \ $(distdir)/std_data/ndb_backup51_data_be \ $(distdir)/std_data/ndb_backup51_data_le \ + $(distdir)/std_data/parts \ $(distdir)/lib -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t @@ -71,6 +72,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51 $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(distdir)/std_data/ndb_backup51_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le + $(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(distdir)/std_data/parts $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib -rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock @@ -86,6 +88,7 @@ install-data-local: $(DESTDIR)$(testdir)/std_data/ndb_backup51 \ $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be \ $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \ + $(DESTDIR)$(testdir)/std_data/parts \ $(DESTDIR)$(testdir)/lib $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir) -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t @@ -118,6 +121,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51 $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le + $(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(DESTDIR)$(testdir)/std_data/parts $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \ do \ diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test index 1ca59955d76..df2295af4ff 100644 --- a/mysql-test/extra/binlog_tests/blackhole.test +++ b/mysql-test/extra/binlog_tests/blackhole.test @@ -134,6 +134,15 @@ drop table t1,t2,t3; # table # CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; +# NOTE: After exchanging open_ltable() by open_and_lock_tables() in +# handle_delayed_insert() to fix problems with MERGE tables (Bug#26379), +# problems with INSERT DELAYED and BLACKHOLE popped up. open_ltable() +# does not check if the binlogging capabilities of the statement and the +# table match. So the below used to succeed. But since INSERT DELAYED +# switches to row-based logging in mixed-mode and BLACKHOLE cannot do +# row-based logging, it could not really work. Until this problem is +# correctly fixed, we have that error here. +--error ER_BINLOG_LOGGING_IMPOSSIBLE INSERT DELAYED INTO t1 VALUES(1); DROP TABLE t1; diff --git a/mysql-test/extra/binlog_tests/ctype_cp932.test b/mysql-test/extra/binlog_tests/ctype_cp932.test index 0839f5d43aa..3deeea13997 100644 --- a/mysql-test/extra/binlog_tests/ctype_cp932.test +++ b/mysql-test/extra/binlog_tests/ctype_cp932.test @@ -8,6 +8,10 @@ drop table if exists t3; drop table if exists t4; --enable_warnings +SET @test_character_set= 'cp932'; +SET @test_collation= 'cp932_japanese_ci'; +-- source include/ctype_common.inc + set names cp932; set character_set_database = cp932; diff --git a/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test new file mode 100644 index 00000000000..11a8f53a6d7 --- /dev/null +++ b/mysql-test/extra/binlog_tests/database.test @@ -0,0 +1,15 @@ +source include/have_log_bin.inc; +source include/not_embedded.inc; + +# Checking that the drop of a database does not replicate anything in +# addition to the drop of the database + +reset master; +create database testing_1; +use testing_1; +create table t1 (a int); +create function sf1 (a int) returns int return a+1; +create trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a); +create procedure sp1 (a int) insert into t1 values(a); +drop database testing_1; +source include/show_binlog_events.inc; diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test new file mode 100644 index 00000000000..03514bfdb55 --- /dev/null +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test @@ -0,0 +1,298 @@ +# the file to be sourced from binlog.binlog_mix_innodb_myisam + +# +# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack +# bug #28960 non-trans temp table changes with insert .. select +# not binlogged after rollback +# +# testing appearence of insert into temp_table in binlog. +# There are two branches of execution that require different setup. + +# checking binlog content filled with row-based events due to +# a used stored function modifies non-transactional table + +## send_eof() branch + +# prepare + +create temporary table tt (a int unique); +create table ti (a int) engine=innodb; +reset master; +show master status; + +# action + +begin; +insert into ti values (1); +insert into ti values (2) ; +insert into tt select * from ti; +rollback; + +# check + +select count(*) from tt /* 2 */; +show master status; +source include/show_binlog_events.inc; +select count(*) from ti /* zero */; +insert into ti select * from tt; +select * from ti /* that is what slave would miss - bug#28960 */; + + +## send_error() branch +delete from ti; +delete from tt where a=1; +reset master; +show master status; + +# action + +begin; +insert into ti values (1); +insert into ti values (2) /* to make the dup error in the following */; +--error ER_DUP_ENTRY +insert into tt select * from ti /* one affected and error */; +rollback; + +# check + +show master status; +source include/show_binlog_events.inc; # nothing in binlog with row bilog format +select count(*) from ti /* zero */; +insert into ti select * from tt; +select * from tt /* that is what otherwise slave missed - the bug */; + +drop table ti; + + +# +# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack +# +# Testing asserts: if there is a side effect of modifying non-transactional +# table thd->no_trans_update.stmt must be TRUE; +# the assert is active with debug build +# + +--disable_warnings +drop function if exists bug27417; +drop table if exists t1,t2; +--enable_warnings +# side effect table +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM; +# target tables +CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a)); + +delimiter |; +create function bug27417(n int) +RETURNS int(11) +begin + insert into t1 values (null); + return n; +end| +delimiter ;| + +reset master; + +# execute + +insert into t2 values (bug27417(1)); +insert into t2 select bug27417(2); +reset master; + +--error ER_DUP_ENTRY +insert into t2 values (bug27417(2)); +source include/show_binlog_events.inc; #only (!) with fixes for #23333 will show there is the query +select count(*) from t1 /* must be 3 */; + +reset master; +select count(*) from t2; +delete from t2 where a=bug27417(3); +select count(*) from t2 /* nothing got deleted */; +source include/show_binlog_events.inc; # the query must be in regardless of #23333 +select count(*) from t1 /* must be 5 */; + +--enable_info +delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */; +--disable_info +select count(*) from t1 /* must be 7 */; + +# function bug27417 remains for the following testing of bug#23333 +drop table t1,t2; + +# +# Bug#23333 using the patch (and the test) for bug#27471 +# throughout the bug tests +# t1 - non-trans side effects gatherer; +# t2 - transactional table; +# +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM; +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM; +CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb; +CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; + + +# +# INSERT +# + +# prepare + + insert into t2 values (1); + reset master; + +# execute + + --error ER_DUP_ENTRY + insert into t2 values (bug27417(1)); + +# check + + source include/show_binlog_events.inc; # must be event of the query + select count(*) from t1 /* must be 1 */; + +# +# INSERT SELECT +# + +# prepare + delete from t1; + delete from t2; + insert into t2 values (2); + reset master; + +# execute + + --error ER_DUP_ENTRY + insert into t2 select bug27417(1) union select bug27417(2); + +# check + + source include/show_binlog_events.inc; # must be events of the query + select count(*) from t1 /* must be 2 */; + +# +# UPDATE inc multi-update +# + +# prepare + delete from t1; + insert into t3 values (1,1),(2,3),(3,4); + reset master; + +# execute + --error ER_DUP_ENTRY + update t3 set b=b+bug27417(1); + +# check + source include/show_binlog_events.inc; # must be events of the query + select count(*) from t1 /* must be 2 */; + +## multi_update::send_eof() branch + +# prepare + delete from t3; + delete from t4; + insert into t3 values (1,1); + insert into t4 values (1,1),(2,2); + + reset master; + +# execute + --error ER_DUP_ENTRY + UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; + +# check + source include/show_binlog_events.inc; # the offset must denote there is the query + select count(*) from t1 /* must be 4 */; + +## send_error() branch of multi_update + +# prepare + delete from t1; + delete from t3; + delete from t4; + insert into t3 values (1,1),(2,2); + insert into t4 values (1,1),(2,2); + + reset master; + +# execute + --error ER_DUP_ENTRY + UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); + +# check + select count(*) from t1 /* must be 1 */; + +# cleanup + drop table t4; + + +# +# DELETE incl multi-delete +# + +# prepare + delete from t1; + delete from t2; + delete from t3; + insert into t2 values (1); + insert into t3 values (1,1); + create trigger trg_del before delete on t2 for each row + insert into t3 values (bug27417(1), 2); + reset master; + +# execute + --error ER_DUP_ENTRY + delete from t2; +# check + source include/show_binlog_events.inc; # the offset must denote there is the query + select count(*) from t1 /* must be 1 */; + +# cleanup + drop trigger trg_del; + +# prepare + delete from t1; + delete from t2; + delete from t5; + create trigger trg_del_t2 after delete on t2 for each row + insert into t1 values (1); + insert into t2 values (2),(3); + insert into t5 values (1),(2); + reset master; + +# execute + --error ER_DUP_ENTRY + delete t2.* from t2,t5 where t2.a=t5.a + 1; + +# check + source include/show_binlog_events.inc; # must be events of the query + select count(*) from t1 /* must be 1 */; + + +# +# LOAD DATA +# + +# prepare + delete from t1; + create table t4 (a int default 0, b int primary key) engine=innodb; + insert into t4 values (0, 17); + reset master; + +# execute + --error ER_DUP_ENTRY + load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); +# check + select * from t4; + select count(*) from t1 /* must be 2 */; + source include/show_binlog_events.inc; # must be events of the query + +# +# bug#23333 cleanup +# + + +drop trigger trg_del_t2; +drop table t1,t2,t3,t4,t5; +drop function bug27417; diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test index d3959d10306..cdd828305dc 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test @@ -410,7 +410,7 @@ binary data'; select * from t2 order by f1; select * from t3 order by f1; select * from t4 order by f1; - select * from t31 order by f1; + select * from t31 order by f3; connection master; --echo diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index a4ac55cc2e8..6fa2c9ac1b5 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -10,7 +10,7 @@ ########### Clean up ################ --disable_warnings --disable_query_log -DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17; +DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17; --enable_query_log --enable_warnings @@ -662,6 +662,68 @@ sync_slave_with_master; --replace_column 7 CURRENT_TIMESTAMP SELECT * FROM t14 ORDER BY c1; +#################################################### +# - Alter Master drop column at end of table # +# Expect: column dropped # +#################################################### + +--echo *** Create t14a on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +--echo *** Create t14a on Master *** +connection master; +eval CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; +RESET MASTER; + +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14a () VALUES(1,@b1,'Kyle'), + (2,@b1,'JOE'), + (3,@b1,'QA'); + +SELECT * FROM t14a ORDER BY c1; +--echo *** Select on Slave **** +sync_slave_with_master; +--replace_column 5 CURRENT_TIMESTAMP +SELECT * FROM t14a ORDER BY c1; +STOP SLAVE; +RESET SLAVE; + +--echo *** Master Drop c5 *** +connection master; +ALTER TABLE t14a DROP COLUMN c5; +RESET MASTER; + +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); + +INSERT INTO t14a () VALUES(4,@b1), + (5,@b1), + (6,@b1); +SELECT * FROM t14a ORDER BY c1; + +--echo *** Select on Slave **** +sync_slave_with_master; +--replace_column 5 CURRENT_TIMESTAMP +SELECT * FROM t14a ORDER BY c1; #################################################### # - Alter Master Dropping columns from the middle. # @@ -736,7 +798,7 @@ connection slave; --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # --query_vertical SHOW SLAVE STATUS -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; --echo *** Try to insert in master **** @@ -744,6 +806,8 @@ connection master; INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); SELECT * FROM t15 ORDER BY c1; +#SHOW BINLOG EVENTS; + --echo *** Try to select from slave **** sync_slave_with_master; --replace_column 7 CURRENT_TIMESTAMP @@ -856,7 +920,10 @@ sync_slave_with_master; #### Clean Up #### --disable_warnings --disable_query_log -DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17; +connection master; +DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17; +sync_slave_with_master; +connection master; --enable_query_log --enable_warnings diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 6de254d9931..c35a53f15bc 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -215,11 +215,36 @@ sync_slave_with_master; --echo --- on slave --- SELECT * FROM t8 ORDER BY a; -# -# Test conflicting operations when changing in a table referenced by a -# foreign key. We'll reuse the above table and just add a table that -# references it. -# +# BUG#31552: Replication breaks when deleting rows from out-of-sync +# table without PK + +--echo **** Test for BUG#31552 **** + +--echo **** On Master **** +# Clean up t1 so that we can use it. +connection master; +DELETE FROM t1; +sync_slave_with_master; + +# Just to get a clean binary log +source include/reset_master_and_slave.inc; + +--echo **** On Master **** +connection master; +INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); +--echo **** On Master **** +sync_slave_with_master; +DELETE FROM t1 WHERE C1 = 'L'; + +connection master; +DELETE FROM t1; +query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +sync_slave_with_master; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; +query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; # # cleanup @@ -227,3 +252,4 @@ SELECT * FROM t8 ORDER BY a; connection master; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test index 64a8de7c6a0..76db74acfa1 100644 --- a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test +++ b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test @@ -1,17 +1,16 @@ - ---disable_query_log ---disable_warnings connection slave; STOP SLAVE; +source include/wait_for_slave_to_stop.inc; connection master; +--disable_warnings DROP TABLE IF EXISTS t1; -RESET MASTER; +--enable_warnings connection slave; +--disable_warnings DROP TABLE IF EXISTS t1; +--enable_warnings RESET SLAVE; START SLAVE; ---enable_warnings ---enable_query_log --echo **** On Master **** connection master; @@ -38,3 +37,6 @@ connection master; DROP TABLE t1; let $SERVER_VERSION=`select version()`; source include/show_binlog_events.inc; + +connection master; +RESET MASTER; diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc index 9ee0a40c8ce..89b7ceb0c72 100644 --- a/mysql-test/include/ctype_common.inc +++ b/mysql-test/include/ctype_common.inc @@ -53,11 +53,13 @@ DROP TABLE t1; # # Bug #31070: crash during conversion of charsets +# Bug #32726: crash with cast in order by clause and cp932 charset # create table t1 (a set('a') not null); insert into t1 values (),(); select cast(a as char(1)) from t1; select a sounds like a from t1; +select 1 from t1 order by cast(a as char(1)); drop table t1; DROP DATABASE d1; diff --git a/mysql-test/include/ctype_regex.inc b/mysql-test/include/ctype_regex.inc new file mode 100644 index 00000000000..0e6b4c41607 --- /dev/null +++ b/mysql-test/include/ctype_regex.inc @@ -0,0 +1,42 @@ +# +# To test a desired collation, set session.collation_connection to +# this collation before including this file +# + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Create a table with two varchar(64) null-able column, +# using current values of +# @@character_set_connection and @@collation_connection. +# + +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +delete from t1; + +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); + +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); + +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +insert into t1 values('ghi','ghi['); + +select HIGH_PRIORITY s1 regexp s2 from t1; + +drop table t1; diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc index 79e21382d4c..485b2e881d3 100644 --- a/mysql-test/include/handler.inc +++ b/mysql-test/include/handler.inc @@ -598,3 +598,97 @@ handler a2 read a last; handler a2 read a prev; handler a2 close; drop table t1; + +# +# Bug#31397 Inconsistent drop table behavior of handler tables. +# + +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +create table t1 (a int); +handler t1 open as t1_alias; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +flush tables; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias close; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias read first; +drop table t1; +--error ER_UNKNOWN_TABLE +handler t1_alias read next; + +# Test that temporary tables associated with handlers are properly dropped. + +create table t1 (a int); +create temporary table t2 (a int, key(a)); +handler t1 open as a1; +handler t2 open as a2; +handler a2 read a first; +drop table t1, t2; +--error ER_UNKNOWN_TABLE +handler a2 read a next; +--error ER_UNKNOWN_TABLE +handler a1 close; + +# Alter table drop handlers + +create table t1 (a int, key(a)); +create table t2 like t1; +handler t1 open as a1; +handler t2 open as a2; +handler a1 read a first; +handler a2 read a first; +alter table t1 add b int; +--error ER_UNKNOWN_TABLE +handler a1 close; +handler a2 close; +drop table t1, t2; + +# Rename table drop handlers + +create table t1 (a int, key(a)); +handler t1 open as a1; +handler a1 read a first; +rename table t1 to t2; +--error ER_UNKNOWN_TABLE +handler a1 read a first; +drop table t2; + +# Optimize table drop handlers + +create table t1 (a int, key(a)); +create table t2 like t1; +handler t1 open as a1; +handler t2 open as a2; +handler a1 read a first; +handler a2 read a first; +optimize table t1; +--error ER_UNKNOWN_TABLE +handler a1 close; +handler a2 close; +drop table t1, t2; + +# Flush tables causes handlers reopen + +create table t1 (a int, b char(1), key a(a), key b(a,b)); +insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"), + (5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"); +handler t1 open; +handler t1 read a first; +handler t1 read a next; +flush tables; +handler t1 read a next; +handler t1 read a next; +flush tables with read lock; +handler t1 read a next; +unlock tables; +drop table t1; +--error ER_UNKNOWN_TABLE +handler t1 read a next; diff --git a/mysql-test/include/innodb_rollback_on_timeout.inc b/mysql-test/include/innodb_rollback_on_timeout.inc index 73c7374c79e..6be47397e4b 100644 --- a/mysql-test/include/innodb_rollback_on_timeout.inc +++ b/mysql-test/include/innodb_rollback_on_timeout.inc @@ -2,6 +2,10 @@ # Bug #24200: Provide backwards compatibility mode for 4.x "rollback on # transaction timeout" # +--disable_warnings +drop table if exists t1; +--enable_warnings + show variables like 'innodb_rollback_on_timeout'; create table t1 (a int unsigned not null primary key) engine = innodb; insert into t1 values (1); diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index 7998baa6ccf..e695e7d5570 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -1069,6 +1069,15 @@ DROP TABLE t1; ########################################################################### +# +# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0 +# +create table t1(a char(10) not null, unique key aa(a(1)), + b char(4) not null, unique key bb(b(4))) engine=innodb; +desc t1; +show create table t1; +drop table t1; + --echo End of 5.0 tests # Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY @@ -1353,4 +1362,12 @@ if ($test_foreign_keys) DROP TABLE t1; } +# +# Bug #26447: "ALTER TABLE .. ORDER" does not work with InnoDB and +# auto_increment keys +# +create table t1 (a int auto_increment primary key) engine=innodb; +alter table t1 order by a; +drop table t1; + --echo End of 5.1 tests diff --git a/mysql-test/include/partition_1.inc b/mysql-test/include/partition_1.inc deleted file mode 100644 index b0094db2efe..00000000000 --- a/mysql-test/include/partition_1.inc +++ /dev/null @@ -1,750 +0,0 @@ --- source include/have_partition.inc - -# include/partition_1.inc -# -# Partitionong tests -# -# Attention: The variable -# $engine -- Storage engine to be tested. -# must be set within the script sourcing this file. -# ---disable_abort_on_error -SET AUTOCOMMIT= 1; - -##### Disabled testcases, because of open bugs ##### ---echo ---echo #------------------------------------------------------------------------ ---echo # There are several testcases disabled because ouf the open bugs ---echo # #15407 , #15408 , #15890 , #15961 , #13447 , #15966 , #15968, #16370 ---echo #------------------------------------------------------------------------ -# Bug#15407 Partitions: crash if subpartition -let $fixed_bug15407= 0; -# Bug#15408 Partitions: subpartition names are not unique -let $fixed_bug15408= 0; -# Bug#15890 Partitions: Strange interpretation of partition number -let $fixed_bug15890= 0; -# Bug#15961 Partitions: Creation of subpart. table without subpart. rule not rejected -let $fixed_bug15961= 0; -# Bug#13447 Partitions: crash with alter table -let $fixed_bug13447= 0; -# Bug#15966 Partitions: crash if session default engine <> engine used in create table -let $fixed_bug15966= 0; -# Bug#15968 Partitions: crash when INSERT with f1 = -1 into PARTITION BY HASH(f1) -let $fixed_bug15968= 0; -# Bug #16370 Partitions: subpartitions names not mentioned in SHOW CREATE TABLE output -let $fixed_bug16370= 0; - -##### Option, for displaying files ##### -# -# Attention: Displaying the directory content via "ls $MYSQLTEST_VARDIR/master-data/test/t*" -# is probably not portable. -# let $ls= 0; disables the execution of "ls ....." -let $ls= 0; - -################################################################################ -# Partitioning syntax -# -# CREATE TABLE .... (column-list ..) -# PARTITION BY -# KEY '(' ( column-list ) ')' -# | RANGE '(' ( expr ) ')' -# | LIST '(' ( expr ) ')' -# | HASH '(' ( expr ) ')' -# [PARTITIONS num ] -# [SUBPARTITION BY -# KEY '(' ( column-list ) ')' -# | HASH '(' ( expr ) ')' -# [SUBPARTITIONS num ] -# ] -# [ '(' -# ( PARTITION logical-name -# [ VALUES LESS THAN '(' ( expr | MAX_VALUE ) ')' ] -# [ VALUES IN '(' (expr)+ ')' ] -# [ TABLESPACE tablespace-name ] -# [ [ STORAGE ] ENGINE [ '=' ] storage-engine-name ] -# [ NODEGROUP nodegroup-id ] -# [ '(' -# ( SUBPARTITION logical-name -# [ TABLESPACE tablespace-name ] -# [ STORAGE ENGINE = storage-engine-name ] -# [ NODEGROUP nodegroup-id ] -# )+ -# ')' -# )+ -# ')' -# ] -################################################################################ - ---echo ---echo #------------------------------------------------------------------------ ---echo # 0. Setting of auxiliary variables + Creation of an auxiliary table ---echo # needed in all testcases ---echo #------------------------------------------------------------------------ -let $max_row= `SELECT @max_row`; -let $max_row_div2= `SELECT @max_row DIV 2`; -let $max_row_div3= `SELECT @max_row DIV 3`; -let $max_row_div4= `SELECT @max_row DIV 4`; -let $max_int_4= 2147483647; ---disable_warnings -DROP TABLE IF EXISTS t0_template; ---enable_warnings -CREATE TABLE t0_template ( f1 INTEGER, f2 char(20), PRIMARY KEY(f1)) -ENGINE = MEMORY; ---echo # Logging of <max_row> INSERTs into t0_template suppressed ---disable_query_log -let $num= $max_row; -while ($num) -{ - eval INSERT INTO t0_template SET f1 = $num, f2 = '---$num---'; - - dec $num; -} ---enable_query_log - ---echo ---echo #------------------------------------------------------------------------ ---echo # 1. Some syntax checks ---echo #------------------------------------------------------------------------ ---echo # 1.1 Subpartioned table without subpartitioning rule must be rejected ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -if ($fixed_bug15961) -{ -# Bug#15961 Partitions: Creation of subpart. table without subpart. rule not rejected ---error 9999 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -( PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11)); -} ---echo # FIXME Implement testcases, where it is checked that all create and ---echo # alter table statements ---echo # - with missing mandatory parameters are rejected ---echo # - with optional parameters are accepted ---echo # - with wrong combinations of optional parameters are rejected ---echo # - ............ - ---echo ---echo #------------------------------------------------------------------------ ---echo # 2. Checks where the engine is assigned on all supported (CREATE TABLE ---echo # statement) positions + basic operations on the tables ---echo # Storage engine mixups are currently (2005-12-23) not supported ---echo #------------------------------------------------------------------------ ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - ---echo # 2.1 non partitioned table (for comparison) -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = $engine; -# MLML Full size (as check of check routine) ---source include/partition_10.inc -DROP TABLE t1; -# ---echo # 2.2 Assignment of storage engine just after column list only -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = $engine - PARTITION BY HASH(f1) PARTITIONS 2; ---source include/partition_10.inc -DROP TABLE t1; -# ---echo # 2.3 Assignment of storage engine just after partition or subpartition ---echo # name only -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY HASH(f1) - ( PARTITION part1 STORAGE ENGINE = $engine, - PARTITION part2 STORAGE ENGINE = $engine - ); ---source include/partition_10.inc -DROP TABLE t1; -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN ($max_row_div2) - (SUBPARTITION subpart11 STORAGE ENGINE = $engine, - SUBPARTITION subpart12 STORAGE ENGINE = $engine), - PARTITION part2 VALUES LESS THAN ($max_int_4) - (SUBPARTITION subpart21 STORAGE ENGINE = $engine, - SUBPARTITION subpart22 STORAGE ENGINE = $engine) - ); ---source include/partition_10.inc -DROP TABLE t1; -# ---echo # 2.4 Some but not all named partitions or subpartitions get a storage ---echo # engine assigned -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY HASH(f1) - ( PARTITION part1 STORAGE ENGINE = $engine, - PARTITION part2 - ); ---source include/partition_10.inc -DROP TABLE t1; -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY HASH(f1) - ( PARTITION part1 , - PARTITION part2 STORAGE ENGINE = $engine - ); ---source include/partition_10.inc -DROP TABLE t1; -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN ($max_row_div2) - (SUBPARTITION subpart11, - SUBPARTITION subpart12 STORAGE ENGINE = $engine), - PARTITION part2 VALUES LESS THAN ($max_int_4) - (SUBPARTITION subpart21 STORAGE ENGINE = $engine, - SUBPARTITION subpart22 STORAGE ENGINE = $engine) - ); ---source include/partition_10.inc -DROP TABLE t1; -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN ($max_row_div2) - (SUBPARTITION subpart11 STORAGE ENGINE = $engine, - SUBPARTITION subpart12 STORAGE ENGINE = $engine), - PARTITION part2 VALUES LESS THAN ($max_int_4) - (SUBPARTITION subpart21, - SUBPARTITION subpart22 ) - ); ---source include/partition_10.inc -DROP TABLE t1; -# ---echo # 2.5 Storage engine assignment after partition name + after name of ---echo # subpartitions belonging to another partition -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN ($max_row_div2) ENGINE = $engine - (SUBPARTITION subpart11, - SUBPARTITION subpart12), - PARTITION part2 VALUES LESS THAN ($max_int_4) - (SUBPARTITION subpart21 STORAGE ENGINE = $engine, - SUBPARTITION subpart22 STORAGE ENGINE = $engine) - ); ---source include/partition_10.inc -DROP TABLE t1; -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN ($max_row_div2) - (SUBPARTITION subpart11 STORAGE ENGINE = $engine, - SUBPARTITION subpart12 STORAGE ENGINE = $engine), - PARTITION part2 VALUES LESS THAN ($max_int_4) ENGINE = $engine - (SUBPARTITION subpart21, - SUBPARTITION subpart22) - ); ---source include/partition_10.inc -DROP TABLE t1; -# ---echo # 2.6 Precedence of storage engine assignments ---echo # 2.6.1 Storage engine assignment after column list + after partition ---echo # or subpartition name -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = $engine - PARTITION BY HASH(f1) - ( PARTITION part1 STORAGE ENGINE = $engine, - PARTITION part2 STORAGE ENGINE = $engine - ); ---source include/partition_10.inc -DROP TABLE t1; -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = $engine - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN ($max_row_div2) - (SUBPARTITION subpart11 STORAGE ENGINE = $engine, - SUBPARTITION subpart12 STORAGE ENGINE = $engine), - PARTITION part2 VALUES LESS THAN ($max_int_4) - (SUBPARTITION subpart21 STORAGE ENGINE = $engine, - SUBPARTITION subpart22 STORAGE ENGINE = $engine) - ); ---source include/partition_10.inc -DROP TABLE t1; ---echo # 2.6.2 Storage engine assignment after partition name + after ---echo # subpartition name -# in partition part + in sub partition part -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN ($max_row_div2) STORAGE ENGINE = $engine - (SUBPARTITION subpart11 STORAGE ENGINE = $engine, - SUBPARTITION subpart12 STORAGE ENGINE = $engine), - PARTITION part2 VALUES LESS THAN ($max_int_4) - (SUBPARTITION subpart21 STORAGE ENGINE = $engine, - SUBPARTITION subpart22 STORAGE ENGINE = $engine) - ); ---source include/partition_10.inc -DROP TABLE t1; - ---echo # 2.7 Session default engine differs from engine used within create table -eval SET SESSION storage_engine=$engine_other; -if ($fixed_bug15966) -{ -# Bug#15966 Partitions: crash if session default engine <> engine used in create table -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) ( PARTITION part1 ENGINE = $engine); ---source include/partition_10.inc -DROP TABLE t1; -# Bug#15966 Partitions: crash if session default engine <> engine used in create table -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) - PARTITION BY RANGE(f1) - SUBPARTITION BY HASH(f1) - ( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11 STORAGE ENGINE = $engine, - SUBPARTITION subpart12 STORAGE ENGINE = $engine)); ---source include/partition_10.inc -DROP TABLE t1; -} -eval SET SESSION storage_engine=$engine; - - ---echo ---echo #------------------------------------------------------------------------ ---echo # 3. Check assigning the number of partitions and subpartitions ---echo # with and without named partitions/subpartitions ---echo #------------------------------------------------------------------------ ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings ---echo # 3.1 (positive) without partition/subpartition number assignment ---echo # 3.1.1 no partition number, no named partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1); ---source include/partition_10.inc -DROP TABLE t1; ---echo # 3.1.2 no partition number, named partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part2); ---source include/partition_10.inc -DROP TABLE t1; -# Attention: Several combinations are impossible -# If subpartitioning exists -# - partitioning algorithm must be RANGE or LIST -# This implies the assignment of named partitions. -# - subpartitioning algorithm must be HASH or KEY ---echo # 3.1.3 variations on no partition/subpartition number, named partitions, ---echo # different subpartitions are/are not named -# -# Partition name -- "properties" -# part1 -- first/non last -# part2 -- non first/non last -# part3 -- non first/ last -# -# Testpattern: -# named subpartitions in -# Partition part1 part2 part3 -# N N N -# N N Y -# N Y N -# N Y Y -# Y N N -# Y N Y -# Y Y N -# Y Y Y ---disable_query_log -let $part0= CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1); -# -eval SET @aux = '(PARTITION part1 VALUES LESS THAN ($max_row_div2),'; -let $part1_N= `SELECT @AUX`; -eval SET @aux = '(PARTITION part1 VALUES LESS THAN ($max_row_div2) -(SUBPARTITION subpart11 , SUBPARTITION subpart12 ),'; -let $part1_Y= `SELECT @AUX`; -# -eval SET @aux = 'PARTITION part2 VALUES LESS THAN ($max_row),'; -let $part2_N= `SELECT @AUX`; -eval SET @aux = 'PARTITION part2 VALUES LESS THAN ($max_row) -(SUBPARTITION subpart21 , SUBPARTITION subpart22 ),'; -let $part2_Y= `SELECT @AUX`; -# -eval SET @aux = 'PARTITION part3 VALUES LESS THAN ($max_int_4))'; -let $part3_N= `SELECT @AUX`; -eval SET @aux = 'PARTITION part3 VALUES LESS THAN ($max_int_4) -(SUBPARTITION subpart31 , SUBPARTITION subpart32 ))'; -let $part3_Y= `SELECT @AUX`; ---enable_query_log - -eval $part0 $part1_N $part2_N $part3_N ; -DROP TABLE t1; -# Bug#15407 Partitions: crash if subpartition -if ($fixed_bug15407) -{ -eval $part0 $part1_N $part2_N $part3_Y ; ---source include/partition_10.inc -DROP TABLE t1; -eval $part0 $part1_N $part2_Y $part3_N ; ---source include/partition_10.inc -DROP TABLE t1; -eval $part0 $part1_N $part2_Y $part3_Y ; ---source include/partition_10.inc -DROP TABLE t1; -eval $part0 $part1_Y $part2_N $part3_N ; ---source include/partition_10.inc -DROP TABLE t1; -eval $part0 $part1_Y $part2_N $part3_Y ; ---source include/partition_10.inc -DROP TABLE t1; -eval $part0 $part1_Y $part2_Y $part3_N ; ---source include/partition_10.inc -DROP TABLE t1; -} -eval $part0 $part1_Y $part2_Y $part3_Y ; ---source include/partition_10.inc -DROP TABLE t1; - ---echo # 3.2 partition/subpartition numbers good and bad values and notations ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings ---echo # 3.2.1 partition/subpartition numbers INTEGER notation -# ML: "positive/negative" is my private judgement. It need no to correspond -# with the server response. -# (positive) number = 2 -let $part_number= 2; ---source include/partition_11.inc -# (positive) special case number = 1 -let $part_number= 1; ---source include/partition_11.inc -# (negative) 0 is non sense -let $part_number= 0; ---source include/partition_11.inc -# (negative) -1 is non sense -let $part_number= -1; ---source include/partition_11.inc -# (negative) 1000000 is too huge -let $part_number= 1000000; ---source include/partition_11.inc - -if ($fixed_bug15890) -{ ---echo # 3.2.2 partition/subpartition numbers DECIMAL notation -# (positive) number = 2.0 -let $part_number= 2.0; ---source include/partition_11.inc -# (negative) -2.0 is non sense -let $part_number= -2.0; ---source include/partition_11.inc -# (negative) case number = 0.0 is non sense -let $part_number= 0.0; ---source include/partition_11.inc -# Bug#15890 Partitions: Strange interpretation of partition number -# (negative) number = 1.5 is non sense -let $part_number= 1.5; ---source include/partition_11.inc -# (negative) number is too huge -let $part_number= 999999999999999999999999999999.999999999999999999999999999999; ---source include/partition_11.inc -# (negative) number is nearly zero -let $part_number= 0.000000000000000000000000000001; ---source include/partition_11.inc - ---echo # 3.2.3 partition/subpartition numbers FLOAT notation -##### FLOAT notation -# (positive) number = 2.0E+0 -let $part_number= 2.0E+0; ---source include/partition_11.inc -# Bug#15890 Partitions: Strange interpretation of partition number -# (positive) number = 0.2E+1 -let $part_number= 0.2E+1; ---source include/partition_11.inc -# (negative) -2.0E+0 is non sense -let $part_number= -2.0E+0; ---source include/partition_11.inc -# (negative) 0.15E+1 is non sense -let $part_number= 0.15E+1; ---source include/partition_11.inc -# (negative) 0.0E+300 is zero -let $part_number= 0.0E+300; ---source include/partition_11.inc -# Bug#15890 Partitions: Strange interpretation of partition number -# (negative) 1E+300 is too huge -let $part_number= 1E+300; ---source include/partition_11.inc -# (negative) 1E-300 is nearly zero -let $part_number= 1E-300; ---source include/partition_11.inc -} - ---echo # 3.2.4 partition/subpartition numbers STRING notation -##### STRING notation -# (negative?) case number = '2' -let $part_number= '2'; ---source include/partition_11.inc -# (negative?) case number = '2.0' -let $part_number= '2.0'; ---source include/partition_11.inc -# (negative?) case number = '0.2E+1' -let $part_number= '0.2E+1'; ---source include/partition_11.inc -# (negative) Strings starts with digit, but 'A' follows -let $part_number= '2A'; ---source include/partition_11.inc -# (negative) Strings starts with 'A', but digit follows -let $part_number= 'A2'; ---source include/partition_11.inc -# (negative) empty string -let $part_number= ''; ---source include/partition_11.inc -# (negative) string without any digits -let $part_number= 'GARBAGE'; ---source include/partition_11.inc - ---echo # 3.2.5 partition/subpartition numbers other notations -# (negative) Strings starts with digit, but 'A' follows -let $part_number= 2A; ---source include/partition_11.inc -# (negative) Strings starts with 'A', but digit follows -let $part_number= A2; ---source include/partition_11.inc -# (negative) string without any digits -let $part_number= GARBAGE; ---source include/partition_11.inc - -# (negative?) double quotes -let $part_number= "2"; ---source include/partition_11.inc -# (negative) Strings starts with digit, but 'A' follows -let $part_number= "2A"; ---source include/partition_11.inc -# (negative) Strings starts with 'A', but digit follows -let $part_number= "A2"; ---source include/partition_11.inc -# (negative) string without any digits -let $part_number= "GARBAGE"; ---source include/partition_11.inc - ---echo # 3.3 Mixups of assigned partition/subpartition numbers and names ---echo # 3.3.1 (positive) number of partition/subpartition ---echo # = number of named partition/subpartition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2 ( PARTITION part1, PARTITION part2 ) ; -SHOW CREATE TABLE t1; -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) PARTITIONS 2 -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11, SUBPARTITION subpart12), - PARTITION part2 VALUES LESS THAN (2147483647) - (SUBPARTITION subpart21, SUBPARTITION subpart22) -); ---source include/partition_layout.inc -DROP TABLE t1; ---echo # 3.3.2 (positive) number of partition/subpartition , ---echo # 0 (= no) named partition/subpartition ---echo # already checked above ---echo # 3.3.3 (negative) number of partitions/subpartitions ---echo # > number of named partitions/subpartitions ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2 ( PARTITION part1 ) ; -# Wrong number of named subpartitions in first partition ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11 ), - PARTITION part2 VALUES LESS THAN (2147483647) - (SUBPARTITION subpart21, SUBPARTITION subpart22) -); -# Wrong number of named subpartitions in non first/non last partition ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11, SUBPARTITION subpart12), - PARTITION part2 VALUES LESS THAN (2000) - (SUBPARTITION subpart21 ), - PARTITION part3 VALUES LESS THAN (2147483647) - (SUBPARTITION subpart31, SUBPARTITION subpart32) -); -# Wrong number of named subpartitions in last partition ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) PARTITIONS 2 -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11, SUBPARTITION subpart12), - PARTITION part2 VALUES LESS THAN (2147483647) - (SUBPARTITION subpart21 ) -); ---echo # 3.3.4 (negative) number of partitions < number of named partitions ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 1 ( PARTITION part1, PARTITION part2 ) ; -# Wrong number of named subpartitions in first partition ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 1 -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11, SUBPARTITION subpart12), - PARTITION part2 VALUES LESS THAN (2147483647) - (SUBPARTITION subpart21, SUBPARTITION subpart22) -); -# Wrong number of named subpartitions in non first/non last partition ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 1 -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11, SUBPARTITION subpart12), - PARTITION part2 VALUES LESS THAN (2000) - (SUBPARTITION subpart21 ), - PARTITION part3 VALUES LESS THAN (2147483647) - (SUBPARTITION subpart31, SUBPARTITION subpart32) -); -# Wrong number of named subpartitions in last partition ---error 1064 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 1 -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11, SUBPARTITION subpart12), - PARTITION part2 VALUES LESS THAN (2147483647) - (SUBPARTITION subpart21, SUBPARTITION subpart22) -); - - ---echo ---echo #------------------------------------------------------------------------ ---echo # 4. Checks of logical partition/subpartition name ---echo # file name clashes during CREATE TABLE ---echo #------------------------------------------------------------------------ ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - ---echo # 4.1 (negative) A partition name used more than once ---error ER_SAME_NAME_PARTITION -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part1); -# -if ($fixed_bug15408) -{ -# Bug#15408 Partitions: subpartition names are not unique ---error ER_SAME_NAME_PARTITION -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) - (SUBPARTITION subpart11, SUBPARTITION subpart11) -); -} ---echo # FIXME Implement testcases with filename problems ---echo # existing file of other table --- partition/subpartition file name ---echo # partition/subpartition file name --- file of the same table - ---echo ---echo #------------------------------------------------------------------------ ---echo # 5. Alter table experiments ---echo #------------------------------------------------------------------------ ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings ---echo # 5.1 alter table add partition ---echo # 5.1.1 (negative) add partition to non partitioned table -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)); ---source include/partition_layout.inc -# MyISAM gets ER_PARTITION_MGMT_ON_NONPARTITIONED and NDB 1005 -# The error code of NDB differs, because all NDB tables are partitioned even -# if the CREATE TABLE does not contain a partitioning clause. ---error ER_PARTITION_MGMT_ON_NONPARTITIONED,1005 -ALTER TABLE t1 ADD PARTITION (PARTITION part1); ---source include/partition_layout.inc -DROP TABLE t1; - ---echo # 5.1.2 Add one partition to a table with one partition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1); ---source include/partition_layout.inc -eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND $max_row_div2 - 1; ---disable_query_log -eval SELECT $engine = 'NDB' INTO @aux; -let $my_exit= `SELECT @aux`; -if ($my_exit) -{ - exit; -} ---enable_query_log -ALTER TABLE t1 ADD PARTITION (PARTITION part1); ---source include/partition_12.inc -DROP TABLE t1; - ---echo # 5.1.3 Several times add one partition to a table with some partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part3); ---source include/partition_layout.inc -eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND $max_row_div2 - 1; -# Partition name before first existing partition name -ALTER TABLE t1 ADD PARTITION (PARTITION part0); ---source include/partition_12.inc -DELETE FROM t1; -eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND $max_row_div2 - 1; -# Partition name between existing partition names -ALTER TABLE t1 ADD PARTITION (PARTITION part2); ---source include/partition_12.inc -DELETE FROM t1; -eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND $max_row_div2 - 1; -if ($fixed_bug13447) -{ -# Partition name after all existing partition names -# Bug#13447 Partitions: crash with alter table -ALTER TABLE t1 ADD PARTITION (PARTITION part4); -} ---source include/partition_12.inc -DROP TABLE t1; - ---echo # 5.1.4 Add several partitions to a table with some partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part3); ---source include/partition_layout.inc -eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND $max_row_div2 - 1; -if ($fixed_bug13447) -{ -# Bug#13447 Partitions: crash with alter table -ALTER TABLE t1 ADD PARTITION (PARTITION part0, PARTITION part2, PARTITION part4); -} ---source include/partition_12.inc -DROP TABLE t1; - ---echo # 5.1.5 (negative) Add partitions to a table with some partitions ---echo # clash on new and already existing partition names -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part2, PARTITION part3); -# Clash on first/non last partition name ---error ER_SAME_NAME_PARTITION -ALTER TABLE t1 ADD PARTITION (PARTITION part1); -# Clash on non first/non last partition name ---error ER_SAME_NAME_PARTITION -ALTER TABLE t1 ADD PARTITION (PARTITION part2); -# Clash on non first/last partition name ---error ER_SAME_NAME_PARTITION -ALTER TABLE t1 ADD PARTITION (PARTITION part3); -# Clash on all partition names ---error ER_SAME_NAME_PARTITION -ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part2, PARTITION part3); -DROP TABLE t1; - -# FIXME Is there any way to add a subpartition to an already existing partition - ---echo # 5.2 alter table add subpartition ---echo # 5.2.1 Add one subpartition to a table with subpartitioning rule and ---echo # no explicit defined subpartitions -eval CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -(PARTITION part1 VALUES LESS THAN ($max_row_div2)); -if ($fixed_bug16370) -{ ---source include/partition_layout.inc -} -eval INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND $max_row_div2 - 1; -eval ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN ($max_int_4) - (SUBPARTITION subpart21)); -if ($fixed_bug16370) -{ ---source include/partition_12.inc -} -DROP TABLE t1; -DROP TABLE if exists t0_template; diff --git a/mysql-test/include/reset_master_and_slave.inc b/mysql-test/include/reset_master_and_slave.inc new file mode 100644 index 00000000000..c2d4120ddc9 --- /dev/null +++ b/mysql-test/include/reset_master_and_slave.inc @@ -0,0 +1,10 @@ +--echo **** Resetting master and slave **** +connection slave; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; +RESET SLAVE; +connection master; +RESET MASTER; +connection slave; +START SLAVE; +source include/wait_for_slave_to_start.inc; diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc new file mode 100644 index 00000000000..6780edbe2f0 --- /dev/null +++ b/mysql-test/include/wait_for_slave_sql_error.inc @@ -0,0 +1,33 @@ +################################################### +#Author: Sven +#Date: 2007-10-09 +#Purpose: Wait until the slave has an error in the +# sql thread, as indicated by +# "SHOW SLAVE STATUS", or at most 30 +# seconds. +#Details: +# 1) Fill in and setup variables +# 2) loop, looking for sql error on slave +# 3) If it loops too long, die. +#################################################### +connection slave; +let $row_number= 1; +let $run= 1; +let $counter= 300; + +while ($run) +{ + let $sql_result= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, $row_number); + let $run= `SELECT '$sql_result' = '0'`; + if ($run) { + real_sleep 0.1; + if (!$counter){ + --echo "Failed while waiting for slave to produce an error in its sql thread" + --replace_result $MASTER_MYPORT MASTER_PORT + --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # + query_vertical SHOW SLAVE STATUS; + exit; + } + dec $counter; + } +} diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 3d5752b4ec8..0d705104303 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -33,16 +33,14 @@ my $skip_test; sub init_pattern { my ($from, $what)= @_; - if ( $from =~ /[a-z0-9]/ ) { + if ( $from =~ /^[a-z0-9]$/ ) { # Does not contain any regex, make the pattern match # beginning of string $from= "^$from"; } - else { - # Check that pattern is a valid regex - eval { "" =~/$from/; 1 } or - mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); - } + # Check that pattern is a valid regex + eval { "" =~/$from/; 1 } or + mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); return $from; } @@ -214,17 +212,44 @@ sub collect_one_suite($$) mtr_verbose("Collecting: $suite"); + my $combination_file= "combinations"; + my $combinations = []; + my $suitedir= "$::glob_mysql_test_dir"; # Default + my $combination_file= "$::glob_mysql_test_dir/$combination_file"; if ( $suite ne "main" ) { $suitedir= mtr_path_exists("$suitedir/suite/$suite", "$suitedir/$suite"); mtr_verbose("suitedir: $suitedir"); + $combination_file= "$suitedir/$combination_file"; } my $testdir= "$suitedir/t"; my $resdir= "$suitedir/r"; + if (!@::opt_combination) + { + # Read combinations file + if ( open(COMB,$combination_file) ) + { + while (<COMB>) + { + chomp; + s/\ +/ /g; + push (@$combinations, $_) unless ($_ eq ''); + } + close COMB; + } + } + else + { + # take the combination from command-line + @$combinations = @::opt_combination; + } + # Remember last element position + my $begin_index = $#{@$cases} + 1; + # ---------------------------------------------------------------------- # Build a hash of disabled testcases for this suite # ---------------------------------------------------------------------- @@ -335,6 +360,78 @@ sub collect_one_suite($$) closedir TESTDIR; } + # ---------------------------------------------------------------------- + # Proccess combinations only if new tests were added + # ---------------------------------------------------------------------- + if (0 and $combinations && $begin_index <= $#{@$cases}) + { + my $end_index = $#{@$cases}; + my $is_copy; + # Keep original master/slave options + my @orig_opts; + for (my $idx = $begin_index; $idx <= $end_index; $idx++) + { + foreach my $param (('master_opt','slave_opt','slave_mi')) + { + @{$orig_opts[$idx]{$param}} = @{$cases->[$idx]->{$param}}; + } + } + my $comb_index = 1; + # Copy original test cases + foreach my $comb_set (@$combinations) + { + for (my $idx = $begin_index; $idx <= $end_index; $idx++) + { + my $test = $cases->[$idx]; + my $copied_test = {}; + foreach my $param (keys %{$test}) + { + # Scalar. Copy as is. + $copied_test->{$param} = $test->{$param}; + # Array. Copy reference instead itself + if ($param =~ /(master_opt|slave_opt|slave_mi)/) + { + my $new_arr = []; + @$new_arr = @{$orig_opts[$idx]{$param}}; + $copied_test->{$param} = $new_arr; + } + elsif ($param =~ /(comment|combinations)/) + { + $copied_test->{$param} = ''; + } + } + if ($is_copy) + { + push(@$cases, $copied_test); + $test = $cases->[$#{@$cases}]; + } + foreach my $comb_opt (split(/ /,$comb_set)) + { + push(@{$test->{'master_opt'}},$comb_opt); + push(@{$test->{'slave_opt'}},$comb_opt); + # Enable rpl if added option is --binlog-format and test case supports that + if ($comb_opt =~ /^--binlog-format=.+$/) + { + my @opt_pairs = split(/=/, $comb_opt); + if ($test->{'binlog_format'} =~ /^$opt_pairs[1]$/ || $test->{'binlog_format'} eq '') + { + $test->{'skip'} = 0; + $test->{'comment'} = ''; + } + else + { + $test->{'skip'} = 1; + $test->{'comment'} = "Requiring binlog format '$test->{'binlog_format'}'";; + } + } + } + $test->{'combination'} = $comb_set; + } + $is_copy = 1; + $comb_index++; + } + } + return $cases; } diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 3c50756b893..bd6dd4cf6cf 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -234,6 +234,7 @@ sub mtr_report_stats ($) { "\\[ERROR\\]", "^Error:", "^==.* at 0x", "InnoDB: Warning", + "InnoDB: Error", "^safe_mutex:", "missing DBUG_RETURN", "mysqld: Warning", @@ -335,21 +336,33 @@ sub mtr_report_stats ($) { /\QError in Log_event::read_log_event(): 'Sanity check failed', data_len: 258, event_type: 49\E/ or /Statement is not safe to log in statement format/ or + # test case for Bug#bug29807 copies a stray frm into database + /InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal/ or + /Cannot find or open table test\/bug29807 from/ or + + # innodb foreign key tests that fail in ALTER or RENAME produce this + /InnoDB: Error: in ALTER TABLE `test`.`t[12]`/ or + /InnoDB: Error: in RENAME TABLE table `test`.`t1`/ or + /InnoDB: Error: table `test`.`t[12]` does not exist in the InnoDB internal/ or + # Test case for Bug#14233 produces the following warnings: /Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc/ or /Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc/ or /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ or - # BUG#29807 - innodb_mysql.test: Cannot find table test/t2 - # from the internal data dictionary - /Cannot find table test\/bug29807 from the internal data dictionary/ or - # BUG#29839 - lowercase_table3.test: Cannot find table test/T1 # from the internal data dictiona /Cannot find table test\/BUG29839 from the internal data dictionary/ or # BUG#32080 - Excessive warnings on Solaris: setrlimit could not # change the size of core files - /setrlimit could not change the size of core files to 'infinity'/ + /setrlimit could not change the size of core files to 'infinity'/ or + + # rpl_extrColmaster_*.test, the slave thread produces warnings + # when it get updates to a table that has more columns on the + # master + /Slave: Unknown column 'c7' in 't15' Error_code: 1054/ or + /Slave: Can't DROP 'c7'.* 1091/ or + /Slave: Key column 'c6'.* 1072/ ) { next; # Skip these lines diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f6ea5550007..1a8c18f7d27 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -164,6 +164,8 @@ our $opt_bench= 0; our $opt_small_bench= 0; our $opt_big_test= 0; +our @opt_combination; + our @opt_extra_mysqld_opt; our $opt_compress; @@ -255,13 +257,13 @@ our $opt_timer= 1; our $opt_user; -our $opt_valgrind= 0; -our $opt_valgrind_mysqld= 0; -our $opt_valgrind_mysqltest= 0; -our $default_valgrind_options= "--show-reachable=yes"; -our $opt_valgrind_options; -our $opt_valgrind_path; -our $opt_callgrind; +my $opt_valgrind= 0; +my $opt_valgrind_mysqld= 0; +my $opt_valgrind_mysqltest= 0; +my @default_valgrind_args= ("--show-reachable=yes"); +my @valgrind_args; +my $opt_valgrind_path; +my $opt_callgrind; our $opt_stress= ""; our $opt_stress_suite= "main"; @@ -461,6 +463,19 @@ sub main () { # ############################################################################## +# +# When an option is no longer used by this program, it must be explicitly +# ignored or else it will be passed through to mysqld. GetOptions will call +# this subroutine once for each such option on the command line. See +# Getopt::Long documentation. +# + +sub warn_about_removed_option { + my ($option, $value, $hash_value) = @_; + + warn "WARNING: This option is no longer used, and is ignored: --$option\n"; +} + sub command_line_setup () { # These are defaults for things that are set on the command line @@ -497,6 +512,15 @@ sub command_line_setup () { # Read the command line # Note: Keep list, and the order, in sync with usage at end of this file + # Options that are no longer used must still be processed, because all + # unprocessed options are passed directly to mysqld. The user will be + # warned that the option is being ignored. + # + # Put the complete option string here. For example, to remove the --suite + # option, remove it from GetOptions() below and put 'suite|suites=s' here. + my @removed_options = ( + ); + Getopt::Long::Configure("pass_through"); GetOptions( # Control what engine/variation to run @@ -529,6 +553,7 @@ sub command_line_setup () { 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, 'big-test' => \$opt_big_test, + 'combination=s' => \@opt_combination, # Specify ports 'master_port=i' => \$opt_master_myport, @@ -574,7 +599,18 @@ sub command_line_setup () { 'valgrind|valgrind-all' => \$opt_valgrind, 'valgrind-mysqltest' => \$opt_valgrind_mysqltest, 'valgrind-mysqld' => \$opt_valgrind_mysqld, - 'valgrind-options=s' => \$opt_valgrind_options, + 'valgrind-options=s' => sub { + my ($opt, $value)= @_; + # Deprecated option unless it's what we know pushbuild uses + if ($value eq "--gen-suppressions=all --show-reachable=yes") { + push(@valgrind_args, $_) for (split(' ', $value)); + return; + } + die("--valgrind-options=s is deprecated. Use ", + "--valgrind-option=s, to be specified several", + " times if necessary"); + }, + 'valgrind-option=s' => \@valgrind_args, 'valgrind-path=s' => \$opt_valgrind_path, 'callgrind' => \$opt_callgrind, @@ -614,6 +650,9 @@ sub command_line_setup () { 'suite-timeout=i' => \$opt_suite_timeout, 'warnings|log-warnings' => \$opt_warnings, + # Options which are no longer used + (map { $_ => \&warn_about_removed_option } @removed_options), + 'help|h' => \$opt_usage, ) or usage("Can't read options"); @@ -977,7 +1016,7 @@ sub command_line_setup () { # -------------------------------------------------------------------------- # Check valgrind arguments # -------------------------------------------------------------------------- - if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options) + if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args) { mtr_report("Turning on valgrind for all executables"); $opt_valgrind= 1; @@ -1002,17 +1041,18 @@ sub command_line_setup () { $opt_valgrind_mysqld= 1; # Set special valgrind options unless options passed on command line - $opt_valgrind_options="--trace-children=yes" - unless defined $opt_valgrind_options; + push(@valgrind_args, "--trace-children=yes") + unless @valgrind_args; } if ( $opt_valgrind ) { # Set valgrind_options to default unless already defined - $opt_valgrind_options=$default_valgrind_options - unless defined $opt_valgrind_options; + push(@valgrind_args, @default_valgrind_args) + unless @valgrind_args; - mtr_report("Running valgrind with options \"$opt_valgrind_options\""); + mtr_report("Running valgrind with options \"", + join(" ", @valgrind_args), "\""); } if ( ! $opt_testcase_timeout ) @@ -2093,6 +2133,22 @@ sub environment_setup () { ($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : ""); # ---------------------------------------------------- + # Setup env so childs can execute myisampack and myisamchk + # ---------------------------------------------------- + $ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists( + vs_config_dirs('storage/myisam', 'myisamchk'), + vs_config_dirs('myisam', 'myisamchk'), + "$path_client_bindir/myisamchk", + "$glob_basedir/storage/myisam/myisamchk", + "$glob_basedir/myisam/myisamchk")); + $ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists( + vs_config_dirs('storage/myisam', 'myisampack'), + vs_config_dirs('myisam', 'myisampack'), + "$path_client_bindir/myisampack", + "$glob_basedir/storage/myisam/myisampack", + "$glob_basedir/myisam/myisampack")); + + # ---------------------------------------------------- # We are nice and report a bit about our settings # ---------------------------------------------------- if (!$opt_extern) @@ -3751,6 +3807,7 @@ sub mysqld_arguments ($$$$) { # see BUG#28359 mtr_add_arg($args, "%s--connect-timeout=60", $prefix); + # When mysqld is run by a root user(euid is 0), it will fail # to start unless we specify what user to run as. If not running # as root it will be ignored, see BUG#30630 @@ -5056,7 +5113,7 @@ sub valgrind_arguments { } # Add valgrind options, can be overriden by user - mtr_add_arg($args, '%s', $opt_valgrind_options); + mtr_add_arg($args, '%s', $_) for (@valgrind_args); mtr_add_arg($args, $$exe); @@ -5143,6 +5200,8 @@ Options to control what test suites or cases to run skip-im Don't start IM, and skip the IM test cases big-test Set the environment variable BIG_TEST, which can be checked from test cases. + combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one + combination. Options that specify ports @@ -5198,12 +5257,14 @@ Options for coverage, profiling etc gcov FIXME gprof FIXME valgrind Run the "mysqltest" and "mysqld" executables using - valgrind with options($default_valgrind_options) + valgrind with default options valgrind-all Synonym for --valgrind valgrind-mysqltest Run the "mysqltest" and "mysql_client_test" executable with valgrind valgrind-mysqld Run the "mysqld" executable with valgrind - valgrind-options=ARGS Options to give valgrind, replaces default options + valgrind-options=ARGS Deprecated, use --valgrind-option + valgrind-option=ARGS Option to give valgrind, replaces default option(s), + can be specified more then once valgrind-path=[EXE] Path to the valgrind executable callgrind Instruct valgrind to use callgrind diff --git a/mysql-test/r/analyze.result b/mysql-test/r/analyze.result index 7b476c3cca2..c3dbb846402 100644 --- a/mysql-test/r/analyze.result +++ b/mysql-test/r/analyze.result @@ -56,3 +56,11 @@ show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 a 1 a A 5 NULL NULL YES BTREE drop table t1; +End of 4.1 tests +create table t1(a int); +analyze table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +optimize table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 5782941fd68..e9eb50fc805 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -2619,7 +2619,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6 INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W'); INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring',''); INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); -OPTIMIZE TABLE t2 EXTENDED; +OPTIMIZE TABLE t2; Table Op Msg_type Msg_text test.t2 optimize status OK SELECT * FROM t2; @@ -12687,3 +12687,10 @@ CREATE TABLE t1(a VARCHAR(510)) ENGINE = ARCHIVE; INSERT INTO t1(a) VALUES (''); SELECT * FROM t1 ORDER BY a; DROP TABLE t1; +CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive; +INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL); +FLUSH TABLE t1; +SELECT * FROM t1 ORDER BY a; +a b +1 NULL +2 NULL diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 0d6cf8e7d30..4a5b8fcf4aa 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -170,6 +170,12 @@ t2.value64=t1.value64; value64 value32 value64 value32 9223372036854775807 2 9223372036854775807 4 drop table t1, t2; +create table t1 (sint64 bigint not null); +insert into t1 values (-9223372036854775808); +select * from t1; +sint64 +-9223372036854775808 +drop table t1; create table t1 select 1 as 'a'; show create table t1; Table Create Table diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 9ee64ee6dbd..d408a0b6153 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2; +drop table if exists t1, t2; select CASE "b" when "a" then 1 when "b" then 2 END; CASE "b" when "a" then 1 when "b" then 2 END 2 @@ -200,3 +200,21 @@ CEMPNUM EMPMUM1 EMPNUM2 0.00 0 0.00 2.00 2 NULL DROP TABLE t1,t2; +End of 4.1 tests +create table t1 (a int, b bigint unsigned); +create table t2 (c int); +insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997), +(3,11120436154190595086); +insert into t2 (c) values (1), (2), (3); +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 +join t2 on t1.a=t2.c order by d; +a d +1 4572794622775114594 +3 11120436154190595086 +2 18196094287899841997 +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 +join t2 on t1.a=t2.c where b=11120436154190595086 order by d; +a d +3 11120436154190595086 +drop table t1, t2; +End of 5.0 tests diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 9e7fef5e3f1..0613c9ba488 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -594,7 +594,7 @@ create table t1 (a int); create table t1 select * from t1; ERROR HY000: You can't specify target table 't1' for update in FROM clause create table t2 union = (t1) select * from t1; -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: 'test.t2' is not BASE TABLE flush tables with read lock; unlock tables; drop table t1; diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 69f77dc3cd8..b0033383f00 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -5364,13 +5364,19 @@ BIN(a) 0 drop table t1; create table t1(a enum('foo','bar') default null) engine=csv; -ERROR HY000: Can't create table 'test.t1' (errno: -1) +ERROR 42000: The storage engine for the table doesn't support nullable columns create table t1(a enum('foo','bar') default 'foo') engine=csv; -ERROR HY000: Can't create table 'test.t1' (errno: -1) +ERROR 42000: The storage engine for the table doesn't support nullable columns create table t1(a enum('foo','bar') default 'foo' not null) engine=csv; insert into t1 values(); select * from t1; a foo drop table t1; +CREATE TABLE t1(a INT) ENGINE=CSV; +ERROR 42000: The storage engine for the table doesn't support nullable columns +SHOW WARNINGS; +Level Code Message +Error 1178 The storage engine for the table doesn't support nullable columns +Error 1005 Can't create table 'test.t1' (errno: 138) End of 5.1 tests diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index b190273cc64..8103e9b856f 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -64,6 +64,10 @@ select a sounds like a from t1; a sounds like a 1 1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 drop table t1; DROP DATABASE d1; USE test; diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result index b9619370d4c..bb1b3f5995b 100644 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@ -64,6 +64,10 @@ select a sounds like a from t1; a sounds like a 1 1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 drop table t1; DROP DATABASE d1; USE test; @@ -178,3 +182,44 @@ hex(a) A2E6 FEF7 DROP TABLE t1; +create table t1 (s1 varchar(5) character set euckr); +insert into t1 values (0xA141); +insert into t1 values (0xA15A); +insert into t1 values (0xA161); +insert into t1 values (0xA17A); +insert into t1 values (0xA181); +insert into t1 values (0xA1FE); +insert into t1 values (0xA140); +Warnings: +Warning 1366 Incorrect string value: '\xA1@' for column 's1' at row 1 +insert into t1 values (0xA15B); +Warnings: +Warning 1366 Incorrect string value: '\xA1[' for column 's1' at row 1 +insert into t1 values (0xA160); +Warnings: +Warning 1366 Incorrect string value: '\xA1`' for column 's1' at row 1 +insert into t1 values (0xA17B); +Warnings: +Warning 1366 Incorrect string value: '\xA1{' for column 's1' at row 1 +insert into t1 values (0xA180); +Warnings: +Warning 1366 Incorrect string value: '\xA1\x80' for column 's1' at row 1 +insert into t1 values (0xA1FF); +Warnings: +Warning 1366 Incorrect string value: '\xA1\xFF' for column 's1' at row 1 +select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1; +hex(s1) hex(convert(s1 using utf8)) + + + + + + +A141 ECA2A5 +A15A ECA381 +A161 ECA382 +A17A ECA3A5 +A181 ECA3A6 +A1FE EFBFA2 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result index 90c94c3b299..95246525368 100644 --- a/mysql-test/r/ctype_gb2312.result +++ b/mysql-test/r/ctype_gb2312.result @@ -64,6 +64,10 @@ select a sounds like a from t1; a sounds like a 1 1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 drop table t1; DROP DATABASE d1; USE test; diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result index fe90c7bff29..8437e34be1e 100644 --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@ -64,6 +64,10 @@ select a sounds like a from t1; a sounds like a 1 1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 drop table t1; DROP DATABASE d1; USE test; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index e676d5a5ca0..92b76802d0b 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2599,6 +2599,10 @@ select a sounds like a from t1; a sounds like a 1 1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 drop table t1; DROP DATABASE d1; USE test; @@ -2767,4 +2771,49 @@ a c ch drop table t1; +set collation_connection=ucs2_unicode_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci DEFAULT NULL, + `s2` varchar(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +insert into t1 values('ghi','ghi['); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +NULL +drop table t1; +set names utf8; End for 5.0 tests diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 59b1bfa183d..bd76f2a859f 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -811,6 +811,14 @@ quote(name) ???????? ???????????????? drop table bug20536; +set names ucs2; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' +set names ucs2 collate ucs2_bin; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' +set character_set_client= ucs2; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' +set character_set_client= concat('ucs', substr('2', 1)); +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci); INSERT INTO t1 VALUES('abcd'); SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE); @@ -928,6 +936,51 @@ ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_gen select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0); ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '=' drop table t1; +set collation_connection=ucs2_general_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET ucs2 DEFAULT NULL, + `s2` varchar(64) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +insert into t1 values('ghi','ghi['); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +NULL +drop table t1; +set names latin1; select hex(char(0x41 using ucs2)); hex(char(0x41 using ucs2)) 0041 diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 8243b2bc015..5c90c3b5e0b 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -267,6 +267,51 @@ b select * from t1 where a = 'b' and a != 'b'; a drop table t1; +set collation_connection=utf8_general_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET utf8 DEFAULT NULL, + `s2` varchar(64) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +insert into t1 values('ghi','ghi['); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +NULL +drop table t1; +set names utf8; set names utf8; select 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]' diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 214f2d32df4..f6dde6b4060 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -73,13 +73,13 @@ a 13 DROP TABLE t1; SET @bug20627_old_auto_increment_offset= -@@auto_increment_offset= 2; +@@auto_increment_offset; SET @bug20627_old_auto_increment_increment= -@@auto_increment_increment= 3; +@@auto_increment_increment; SET @bug20627_old_session_auto_increment_offset= -@@session.auto_increment_offset= 4; +@@session.auto_increment_offset; SET @bug20627_old_session_auto_increment_increment= -@@session.auto_increment_increment= 5; +@@session.auto_increment_increment; SET @@auto_increment_offset= 2; SET @@auto_increment_increment= 3; SET @@session.auto_increment_offset= 4; @@ -124,13 +124,13 @@ SET @@session.auto_increment_increment= Warnings: Warning 1292 Truncated incorrect auto-increment-increment value: '0' SET @bug20830_old_auto_increment_offset= -@@auto_increment_offset= 2; +@@auto_increment_offset; SET @bug20830_old_auto_increment_increment= -@@auto_increment_increment= 3; +@@auto_increment_increment; SET @bug20830_old_session_auto_increment_offset= -@@session.auto_increment_offset= 4; +@@session.auto_increment_offset; SET @bug20830_old_session_auto_increment_increment= -@@session.auto_increment_increment= 5; +@@session.auto_increment_increment; SET @@auto_increment_offset= 2; SET @@auto_increment_increment= 3; SET @@session.auto_increment_offset= 4; @@ -266,11 +266,11 @@ SELECT HEX(a) FROM t1; HEX(a) 1 DROP TABLE t1; -CREATE TABLE t1(c1 INT) ENGINE=MyISAM; -CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); -INSERT DELAYED INTO t2 VALUES(1); -ERROR HY000: Table storage engine for 't2' doesn't have this option -DROP TABLE t1, t2; +CREATE TABLE t1 (a INT); +INSERT DELAYED INTO t1 SET b= b(); +ERROR 42S22: Unknown column 'b' in 'field list' +DROP TABLE t1; +End of 5.0 tests DROP TABLE IF EXISTS t1,t2; SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; CREATE TABLE `t1` ( @@ -300,3 +300,4 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1 INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1 DROP TABLE t1,t2; +End of 5.1 tests diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 83609856393..b91e7e88d64 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -3,6 +3,10 @@ drop database if exists mysqltest_db1; drop database if exists mysqltest_db2; create database events_test; use events_test; +select * from information_schema.global_variables where variable_name like 'event_scheduler'; +VARIABLE_NAME VARIABLE_VALUE +EVENT_SCHEDULER ON +SET GLOBAL event_scheduler = 'OFF'; CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1; CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2; ERROR HY000: Event 'Lower_case' already exists diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result index d45bffcd7ff..033136ba354 100644 --- a/mysql-test/r/events_scheduling.result +++ b/mysql-test/r/events_scheduling.result @@ -78,10 +78,10 @@ FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') OK -SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') +SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; -IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') +IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR') OK "Already dropped because ended. Therefore an error." DROP EVENT event_3; diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index dcbffd6f7c8..f1b6c471943 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -55,6 +55,23 @@ flush tables with read lock; insert into t2 values(1); unlock tables; drop table t1, t2; +drop table if exists t1, t2; +set session low_priority_updates=1; +create table t1 (a int); +create table t2 (b int); +lock tables t1 write; +flush tables with read lock; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; +lock tables t1 read, t2 write; +flush tables with read lock; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; +lock tables t1 read; +flush tables with read lock; +unlock tables; +drop table t1, t2; +set session low_priority_updates=default; End of 5.0 tests set @old_general_log= @@general_log; set @old_read_only= @@read_only; diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 7da7b3c0cf4..eb0f2553cb0 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -212,6 +212,19 @@ test SELECT NAME_CONST('test', 'test'); test test +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (), (), (); +SELECT NAME_CONST(a, '1') FROM t1; +ERROR HY000: Incorrect arguments to NAME_CONST +SET INSERT_ID= NAME_CONST(a, a); +ERROR HY000: Incorrect arguments to NAME_CONST +DROP TABLE t1; +create table t1 (a int not null); +insert into t1 values (-1), (-2); +select min(a) from t1 group by inet_ntoa(a); +min(a) +-2 +drop table t1; End of 5.0 tests select connection_id() > 0; connection_id() > 0 diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result index 05e56f05457..9d85b1d3e7f 100644 --- a/mysql-test/r/func_regexp.result +++ b/mysql-test/r/func_regexp.result @@ -1,5 +1,17 @@ drop table if exists t1; -create table t1 (s1 char(64),s2 char(64)); +set names latin1; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) DEFAULT NULL, + `s2` varchar(64) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +delete from t1; insert into t1 values('aaa','aaa'); insert into t1 values('aaa|qqq','qqq'); insert into t1 values('gheis','^[^a-dXYZ]+$'); diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 5f6ddb020f2..4dd11cafdcd 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -73,3 +73,33 @@ find_in_set(binary 'a', 'A,B,C') select find_in_set('1','3,1,'); find_in_set('1','3,1,') 2 +End of 4.1 tests +SELECT INTERVAL(0.0, NULL); +INTERVAL(0.0, NULL) +1 +SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL)); +INTERVAL(0.0, CAST(NULL AS DECIMAL)) +1 +SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL)); +INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL)) +1 +SELECT INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) +8 +SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), +CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), +CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL)); +INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), +CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), +CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL)) +8 +SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), +CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), +CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), +CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL)); +INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), +CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), +CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), +CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL)) +8 +End of 5.0 tests diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 4d402d7d0e9..c46f29b787f 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1194,6 +1194,7 @@ ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table ' DROP DATABASE mysqltest1; DROP DATABASE mysqltest2; DROP USER mysqltest_1@localhost; +DROP USER mysqltest_2@localhost; use test; CREATE TABLE t1 (f1 int, f2 int); INSERT INTO t1 VALUES(1,1), (2,2); @@ -1213,6 +1214,7 @@ f1 f2 REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; +DROP USER mysqltest_1@localhost; DROP DATABASE db27878; use test; DROP TABLE t1; @@ -1226,3 +1228,61 @@ drop user юзер_юзер@localhost; grant select on test.* to очень_длинный_юзер@localhost; ERROR HY000: String 'очень_длинный_юзер' is too long for user name (should be no longer than 16) set names default; +create database mysqltest; +use mysqltest; +grant create on mysqltest.* to mysqltest@localhost; +create table t1 (i INT); +insert into t1 values (1); +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1' +create table t2 (i INT); +create table t4 (i INT); +grant select, insert on mysqltest.t2 to mysqltest@localhost; +grant insert on mysqltest.t4 to mysqltest@localhost; +grant create, insert on mysqltest.t5 to mysqltest@localhost; +grant create, insert on mysqltest.t6 to mysqltest@localhost; +flush privileges; +insert into t2 values (1); +create table if not exists t1 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1' +create table if not exists t3 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't3' +create table if not exists t4 select * from t2; +Warnings: +Note 1050 Table 't4' already exists +create table if not exists t5 select * from t2; +create table t6 select * from t2; +create table t7 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't7' +create table t4 select * from t2; +ERROR 42S01: Table 't4' already exists +create table t1 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1' +drop table t1,t2,t4,t5,t6; +revoke create on mysqltest.* from mysqltest@localhost; +revoke select, insert on mysqltest.t2 from mysqltest@localhost; +revoke insert on mysqltest.t4 from mysqltest@localhost; +revoke create, insert on mysqltest.t5 from mysqltest@localhost; +revoke create, insert on mysqltest.t6 from mysqltest@localhost; +drop user mysqltest@localhost; +drop database mysqltest; +use test; +FLUSH PRIVILEGES without procs_priv table. +RENAME TABLE mysql.procs_priv TO mysql.procs_gone; +FLUSH PRIVILEGES; +Warnings: +Error 1146 Table 'mysql.procs_priv' doesn't exist +Error 1548 Cannot load from mysql.mysql.procs_priv. The table is probably corrupted +Assigning privileges without procs_priv table. +CREATE DATABASE mysqltest1; +CREATE PROCEDURE mysqltest1.test() SQL SECURITY DEFINER +SELECT 1; +GRANT EXECUTE ON FUNCTION mysqltest1.test TO mysqltest_1@localhost; +ERROR 42S02: Table 'mysql.procs_priv' doesn't exist +GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost; +CALL mysqltest1.test(); +1 +1 +DROP DATABASE mysqltest1; +RENAME TABLE mysql.procs_gone TO mysql.procs_priv; +FLUSH PRIVILEGES; +End of 5.1 tests diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result index d9a1a0aa12b..9d269f78d10 100644 --- a/mysql-test/r/handler_innodb.result +++ b/mysql-test/r/handler_innodb.result @@ -637,3 +637,94 @@ a b 8 i handler a2 close; drop table t1; +drop table if exists t1,t2; +create table t1 (a int); +handler t1 open as t1_alias; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +flush tables; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias close; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias read first; +a +drop table t1; +handler t1_alias read next; +ERROR 42S02: Unknown table 't1_alias' in HANDLER +create table t1 (a int); +create temporary table t2 (a int, key(a)); +handler t1 open as a1; +handler t2 open as a2; +handler a2 read a first; +a +drop table t1, t2; +handler a2 read a next; +ERROR 42S02: Unknown table 'a2' in HANDLER +handler a1 close; +ERROR 42S02: Unknown table 'a1' in HANDLER +create table t1 (a int, key(a)); +create table t2 like t1; +handler t1 open as a1; +handler t2 open as a2; +handler a1 read a first; +a +handler a2 read a first; +a +alter table t1 add b int; +handler a1 close; +ERROR 42S02: Unknown table 'a1' in HANDLER +handler a2 close; +drop table t1, t2; +create table t1 (a int, key(a)); +handler t1 open as a1; +handler a1 read a first; +a +rename table t1 to t2; +handler a1 read a first; +ERROR 42S02: Unknown table 'a1' in HANDLER +drop table t2; +create table t1 (a int, key(a)); +create table t2 like t1; +handler t1 open as a1; +handler t2 open as a2; +handler a1 read a first; +a +handler a2 read a first; +a +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +handler a1 close; +ERROR 42S02: Unknown table 'a1' in HANDLER +handler a2 close; +drop table t1, t2; +create table t1 (a int, b char(1), key a(a), key b(a,b)); +insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"), +(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"); +handler t1 open; +handler t1 read a first; +a b +0 a +handler t1 read a next; +a b +1 b +flush tables; +handler t1 read a next; +a b +0 a +handler t1 read a next; +a b +1 b +flush tables with read lock; +handler t1 read a next; +a b +0 a +unlock tables; +drop table t1; +handler t1 read a next; +ERROR 42S02: Unknown table 't1' in HANDLER diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index b42fdc864fe..0b27b07c4d2 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -637,3 +637,94 @@ a b 8 i handler a2 close; drop table t1; +drop table if exists t1,t2; +create table t1 (a int); +handler t1 open as t1_alias; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +flush tables; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias close; +drop table t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias read first; +a +drop table t1; +handler t1_alias read next; +ERROR 42S02: Unknown table 't1_alias' in HANDLER +create table t1 (a int); +create temporary table t2 (a int, key(a)); +handler t1 open as a1; +handler t2 open as a2; +handler a2 read a first; +a +drop table t1, t2; +handler a2 read a next; +ERROR 42S02: Unknown table 'a2' in HANDLER +handler a1 close; +ERROR 42S02: Unknown table 'a1' in HANDLER +create table t1 (a int, key(a)); +create table t2 like t1; +handler t1 open as a1; +handler t2 open as a2; +handler a1 read a first; +a +handler a2 read a first; +a +alter table t1 add b int; +handler a1 close; +ERROR 42S02: Unknown table 'a1' in HANDLER +handler a2 close; +drop table t1, t2; +create table t1 (a int, key(a)); +handler t1 open as a1; +handler a1 read a first; +a +rename table t1 to t2; +handler a1 read a first; +ERROR 42S02: Unknown table 'a1' in HANDLER +drop table t2; +create table t1 (a int, key(a)); +create table t2 like t1; +handler t1 open as a1; +handler t2 open as a2; +handler a1 read a first; +a +handler a2 read a first; +a +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +handler a1 close; +ERROR 42S02: Unknown table 'a1' in HANDLER +handler a2 close; +drop table t1, t2; +create table t1 (a int, b char(1), key a(a), key b(a,b)); +insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"), +(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"); +handler t1 open; +handler t1 read a first; +a b +0 a +handler t1 read a next; +a b +1 b +flush tables; +handler t1 read a next; +a b +0 a +handler t1 read a next; +a b +1 b +flush tables with read lock; +handler t1 read a next; +a b +0 a +unlock tables; +drop table t1; +handler t1 read a next; +ERROR 42S02: Unknown table 't1' in HANDLER diff --git a/mysql-test/r/innodb-semi-consistent.result b/mysql-test/r/innodb-semi-consistent.result new file mode 100644 index 00000000000..f1139390f20 --- /dev/null +++ b/mysql-test/r/innodb-semi-consistent.result @@ -0,0 +1,37 @@ +drop table if exists t1; +set session transaction isolation level read committed; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2),(3),(4),(5),(6),(7); +set autocommit=0; +select * from t1 where a=3 lock in share mode; +a +3 +set session transaction isolation level read committed; +set autocommit=0; +update t1 set a=10 where a=5; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +commit; +update t1 set a=10 where a=5; +select * from t1 where a=2 for update; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +select * from t1 where a=2 limit 1 for update; +a +2 +update t1 set a=11 where a=6; +update t1 set a=12 where a=2; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +update t1 set a=13 where a=1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +commit; +update t1 set a=14 where a=1; +commit; +select * from t1; +a +14 +2 +3 +4 +10 +11 +7 +drop table t1; diff --git a/mysql-test/r/innodb-ucs2.result b/mysql-test/r/innodb-ucs2.result index a1c73c912b2..b6bff7d5f42 100644 --- a/mysql-test/r/innodb-ucs2.result +++ b/mysql-test/r/innodb-ucs2.result @@ -1,3 +1,4 @@ +drop table if exists t1, t2; create table t1 ( a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2)) ) character set utf8 engine = innodb; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 2a3ef37d7a9..d0c586de8d4 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -472,43 +472,6 @@ a b 3 3 drop table t1,t2; CREATE TABLE t1 ( -id int(11) NOT NULL auto_increment, -ggid varchar(32) binary DEFAULT '' NOT NULL, -email varchar(64) DEFAULT '' NOT NULL, -passwd varchar(32) binary DEFAULT '' NOT NULL, -PRIMARY KEY (id), -UNIQUE ggid (ggid) -) ENGINE=innodb; -insert into t1 (ggid,passwd) values ('test1','xxx'); -insert into t1 (ggid,passwd) values ('test2','yyy'); -insert into t1 (ggid,passwd) values ('test2','this will fail'); -ERROR 23000: Duplicate entry 'test2' for key 'ggid' -insert into t1 (ggid,id) values ('this will fail',1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -select * from t1 where ggid='test1'; -id ggid email passwd -1 test1 xxx -select * from t1 where passwd='xxx'; -id ggid email passwd -1 test1 xxx -select * from t1 where id=2; -id ggid email passwd -2 test2 yyy -replace into t1 (ggid,id) values ('this will work',1); -replace into t1 (ggid,passwd) values ('test2','this will work'); -update t1 set id=100,ggid='test2' where id=1; -ERROR 23000: Duplicate entry 'test2' for key 'ggid' -select * from t1; -id ggid email passwd -1 this will work -4 test2 this will work -select * from t1 where id=1; -id ggid email passwd -1 this will work -select * from t1 where id=999; -id ggid email passwd -drop table t1; -CREATE TABLE t1 ( user_name varchar(12), password text, subscribed char(1), @@ -962,7 +925,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL b 4 NULL # Using index explain select a,b from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL b 4 NULL # Using index +1 SIMPLE t1 index NULL PRIMARY 4 NULL # explain select a,b,c from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # @@ -1086,6 +1049,19 @@ n d 1 30 2 20 drop table t1,t2; +drop table if exists t1, t2; +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +create trigger trg_del_t2 after delete on t2 for each row +insert into t1 values (1); +insert into t1 values (1); +insert into t2 values (1),(2); +delete t2 from t2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select count(*) from t2 /* must be 2 as restored after rollback caused by the error */; +count(*) +2 +drop table t1, t2; create table t1 (a int, b int) engine=innodb; insert into t1 values(20,null); select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on @@ -1177,14 +1153,14 @@ UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; SELECT * from t1; a b 1 1 -102 2 -103 3 4 4 5 5 6 6 7 7 8 8 9 9 +102 2 +103 3 drop table t1; CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; @@ -1208,7 +1184,6 @@ a b update t1,t2 set t1.a=t1.a+100 where t1.a=101; select * from t1; a b -201 1 102 2 103 3 104 4 @@ -1220,10 +1195,11 @@ a b 110 10 111 11 112 12 +201 1 update t1,t2 set t1.b=t1.b+10 where t1.b=2; select * from t1; a b -201 1 +102 12 103 3 104 4 105 5 @@ -1233,34 +1209,34 @@ a b 109 9 110 10 111 11 -102 12 112 12 +201 1 update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; select * from t1; a b -201 1 +102 12 103 5 104 6 -106 6 105 7 +106 6 107 7 108 8 109 9 110 10 111 11 -102 12 112 12 +201 1 select * from t2; a b 1 1 2 2 +3 13 +4 14 +5 15 6 6 7 7 8 8 9 9 -3 13 -4 14 -5 15 drop table t1,t2; CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; @@ -1311,11 +1287,11 @@ insert into t1 (id) values (null),(null),(null),(null),(null); update t1 set fk=69 where fk is null order by id limit 1; SELECT * from t1; id fk +1 69 2 NULL 3 NULL 4 NULL 5 NULL -1 69 drop table t1; create table t1 (a int not null, b int not null, key (a)); insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3); @@ -1754,10 +1730,10 @@ Variable_name Value Innodb_rows_deleted 70 show status like "Innodb_rows_inserted"; Variable_name Value -Innodb_rows_inserted 1083 +Innodb_rows_inserted 1082 show status like "Innodb_rows_updated"; Variable_name Value -Innodb_rows_updated 886 +Innodb_rows_updated 885 show status like "Innodb_row_lock_waits"; Variable_name Value Innodb_row_lock_waits 0 @@ -2448,8 +2424,8 @@ insert into t1 (b) values (1); replace into t1 (b) values (2), (1), (3); select * from t1; a b -3 1 2 2 +3 1 4 3 truncate table t1; insert into t1 (b) values (1); @@ -2458,8 +2434,8 @@ replace into t1 (b) values (1); replace into t1 (b) values (3); select * from t1; a b -3 1 2 2 +3 1 4 3 drop table t1; create table t1 (rowid int not null auto_increment, val int not null,primary @@ -3193,3 +3169,52 @@ c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) ) ENGINE = InnoDB; ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1( +id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY +) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-10); +SELECT * FROM t1; +id +-10 +INSERT INTO t1 VALUES(NULL); +SELECT * FROM t1; +id +-10 +1 +DROP TABLE t1; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +DROP TABLE IF EXISTS t1, t2; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +SELECT * FROM t2; +a +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +COMMIT; +SELECT * FROM t1 WHERE a=1; +a +1 +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +SELECT * FROM t2; +a +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (2); +COMMIT; +SELECT * FROM t1 WHERE a=2; +a +2 +SELECT * FROM t1 WHERE a=2; +a +2 +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/r/innodb_autoinc_lock_mode_zero.result b/mysql-test/r/innodb_autoinc_lock_mode_zero.result new file mode 100644 index 00000000000..3d016684338 --- /dev/null +++ b/mysql-test/r/innodb_autoinc_lock_mode_zero.result @@ -0,0 +1,39 @@ +drop table if exists t1; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +ggid varchar(32) binary DEFAULT '' NOT NULL, +email varchar(64) DEFAULT '' NOT NULL, +passwd varchar(32) binary DEFAULT '' NOT NULL, +PRIMARY KEY (id), +UNIQUE ggid (ggid) +) ENGINE=innodb; +insert into t1 (ggid,passwd) values ('test1','xxx'); +insert into t1 (ggid,passwd) values ('test2','yyy'); +insert into t1 (ggid,passwd) values ('test2','this will fail'); +ERROR 23000: Duplicate entry 'test2' for key 'ggid' +insert into t1 (ggid,id) values ('this will fail',1); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select * from t1 where ggid='test1'; +id ggid email passwd +1 test1 xxx +select * from t1 where passwd='xxx'; +id ggid email passwd +1 test1 xxx +select * from t1 where id=2; +id ggid email passwd +2 test2 yyy +replace into t1 (ggid,id) values ('this will work',1); +replace into t1 (ggid,passwd) values ('test2','this will work'); +update t1 set id=100,ggid='test2' where id=1; +ERROR 23000: Duplicate entry 'test2' for key 'ggid' +select * from t1; +id ggid email passwd +1 this will work +3 test2 this will work +select * from t1 where id=1; +id ggid email passwd +1 this will work +select * from t1 where id=999; +id ggid email passwd +drop table t1; +End of tests diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 3d439ba8612..469c030596b 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1,3 +1,5 @@ +set global innodb_support_xa=default; +set session innodb_support_xa=default; SET SESSION STORAGE_ENGINE = InnoDB; drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4; drop procedure if exists p1; @@ -353,13 +355,13 @@ EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index +1 SIMPLE t1 index PRIMARY,name PRIMARY 4 NULL 3 Using where 1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%' OR FALSE; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index +1 SIMPLE t2 index NULL PRIMARY 4 NULL 5 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where DROP TABLE t1,t2; CREATE TABLE t1 ( @@ -389,6 +391,7 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5'; name dept DROP TABLE t1; +drop table if exists t1; show variables like 'innodb_rollback_on_timeout'; Variable_name Value innodb_rollback_on_timeout OFF @@ -451,6 +454,7 @@ tes 1234 drop table test; set global query_cache_type=@save_qcache_type; set global query_cache_size=@save_qcache_size; +drop table if exists t1; show variables like 'innodb_rollback_on_timeout'; Variable_name Value innodb_rollback_on_timeout OFF @@ -777,6 +781,7 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort DROP TABLE t1; +drop table if exists t1; show variables like 'innodb_rollback_on_timeout'; Variable_name Value innodb_rollback_on_timeout OFF @@ -1263,11 +1268,11 @@ select_type SIMPLE table t1 type index possible_keys NULL -key b -key_len 5 +key PRIMARY +key_len 4 ref NULL rows 3 -Extra Using index; Using filesort +Extra Using filesort SELECT * FROM t1 ORDER BY b ASC, a DESC; a b 1 1 @@ -1279,11 +1284,11 @@ select_type SIMPLE table t1 type index possible_keys NULL -key b -key_len 5 +key PRIMARY +key_len 4 ref NULL rows 3 -Extra Using index; Using filesort +Extra Using filesort SELECT * FROM t1 ORDER BY b DESC, a ASC; a b 2 2 @@ -1324,6 +1329,21 @@ test t1 Redundant # - that's it, cleanup. DROP TABLE t1; +create table t1(a char(10) not null, unique key aa(a(1)), +b char(4) not null, unique key bb(b(4))) engine=innodb; +desc t1; +Field Type Null Key Default Extra +a char(10) NO UNI NULL +b char(4) NO PRI NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) NOT NULL, + `b` char(4) NOT NULL, + UNIQUE KEY `bb` (`b`), + UNIQUE KEY `aa` (`a`(1)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; End of 5.0 tests CREATE TABLE `t2` ( `k` int(11) NOT NULL auto_increment, @@ -1572,4 +1592,9 @@ t2 CREATE TABLE `t2` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; +create table t1 (a int auto_increment primary key) engine=innodb; +alter table t1 order by a; +Warnings: +Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1' +drop table t1; End of 5.1 tests diff --git a/mysql-test/r/innodb_timeout_rollback.result b/mysql-test/r/innodb_timeout_rollback.result index b25a2bbd815..e2da6ba8af7 100644 --- a/mysql-test/r/innodb_timeout_rollback.result +++ b/mysql-test/r/innodb_timeout_rollback.result @@ -1,3 +1,4 @@ +drop table if exists t1; show variables like 'innodb_rollback_on_timeout'; Variable_name Value innodb_rollback_on_timeout ON diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 8dbba4d454a..919aff4bfb7 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -499,4 +499,138 @@ i 2 2 DROP TABLE t1, t2; +CREATE TABLE t1 ( +a char(20) NOT NULL, +b char(7) DEFAULT NULL, +c char(4) DEFAULT NULL +); +INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0); +INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04); +INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01); +INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01); +INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01); +INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01); +INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05); +INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10); +INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15); +INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0); +INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78); +INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94); +INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203); +INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175); +INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0); +INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); +INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); +INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c +9.999999 10 10 +1.225e-05 1.2e-05 1e-0 +0.0001225 0.00012 NULL +0.1225 0.1225 NULL +0.1225877 0.12259 NULL +12.25 12.25 NULL +12.25 12.25 12.2 +122500 122500 NULL +12250000000 1.2e+10 NULL +1.225e+15 1.2e+15 NULL +5000000 5000000 NULL +1.25e+78 1.2e+78 NULL +1.25e-94 1.2e-94 NULL +1.25e+203 1e+203 NULL +1.25e-175 1e-175 NULL +1.225 NULL 1.23 +1.37 NULL 1.37 +-1.37 NULL -1.3 +0.00187 NULL 0.00 +-0.0187 NULL -0.0 +5000 NULL 5000 +-5000 NULL -500 +DROP TABLE t1; +CREATE TABLE t1 ( +a char(20) NOT NULL, +b char(7) DEFAULT NULL, +c char(5) +); +INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0); +INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05); +INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04); +INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01); +INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01); +INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01); +INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01); +INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05); +INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10); +INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15); +INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0); +INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78); +INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94); +INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203); +INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175); +INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0); +INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); +INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); +INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); +INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); +INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); +SELECT * FROM t1; +a b c +9.999999 10 9.999 +1.225e-05 1.2e-05 1e-05 +0.0001225 0.00012 NULL +0.1225 0.1225 NULL +0.1225877 0.12259 NULL +12.25 12.25 NULL +12.25 12.25 12.25 +122500 122500 NULL +12250000000 1.2e+10 NULL +1.225e+15 1.2e+15 NULL +5000000 5000000 NULL +1.25e+78 1.2e+78 NULL +1.25e-94 1.2e-94 NULL +1.25e+203 1e+203 NULL +1.25e-175 1e-175 NULL +1.225 NULL 1.225 +1.37 NULL 1.37 +-1.37 NULL -1.37 +0.00187 NULL 0.002 +-0.0187 NULL -0.01 +5000 NULL 5000 +-5000 NULL -5000 +DROP TABLE t1; +CREATE TABLE t (a CHAR(10),b INT); +INSERT INTO t VALUES (),(),(); +INSERT INTO t(a) SELECT rand() FROM t; +DROP TABLE t; +CREATE TABLE t1 (c1 INT NOT NULL); +INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500), +('4188.32999999999992724042385816574096679687500'), (4188); +SELECT * FROM t1; +c1 +4188 +4188 +4188 +CREATE TABLE t2 (c1 BIGINT); +INSERT INTO t2 VALUES('15449237462.0000000000'); +SELECT * FROM t2; +c1 +15449237462 +DROP TABLE t1, t2; End of 5.0 tests. diff --git a/mysql-test/r/join_outer_innodb.result b/mysql-test/r/join_outer_innodb.result index e8a2d6f668b..24a11b12b03 100644 --- a/mysql-test/r/join_outer_innodb.result +++ b/mysql-test/r/join_outer_innodb.result @@ -8,12 +8,12 @@ EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index +1 SIMPLE t1 index PRIMARY,name PRIMARY 4 NULL 3 Using where 1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%' OR FALSE; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index +1 SIMPLE t2 index NULL PRIMARY 4 NULL 5 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where DROP TABLE t1,t2; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 3db5e926d30..fcc09a0244d 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -530,6 +530,51 @@ ORDER BY c.b, c.d a b c d e f g h i j a b c d 2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL DROP TABLE t1, t2; +create table t1(a int not null, key aa(a), +b char(10) not null, unique key bb(b(1)), +c char(4) not null, unique key cc(c)); +desc t1; +Field Type Null Key Default Extra +a int(11) NO MUL NULL +b char(10) NO UNI NULL +c char(4) NO PRI NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` char(10) NOT NULL, + `c` char(4) NOT NULL, + UNIQUE KEY `cc` (`c`), + UNIQUE KEY `bb` (`b`(1)), + KEY `aa` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1(a int not null, key aa(a), +b char(10) not null, unique key bb(b(1)), +c char(4) not null); +desc t1; +Field Type Null Key Default Extra +a int(11) NO MUL NULL +b char(10) NO UNI NULL +c char(4) NO NULL +alter table t1 add unique key cc(c); +desc t1; +Field Type Null Key Default Extra +a int(11) NO MUL NULL +b char(10) NO UNI NULL +c char(4) NO PRI NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` char(10) NOT NULL, + `c` char(4) NOT NULL, + UNIQUE KEY `cc` (`c`), + UNIQUE KEY `bb` (`b`(1)), + KEY `aa` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +End of 5.0 tests DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO t1 VALUES (), (), (); diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index a08be429a83..3ea5bbd20bc 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -125,3 +125,14 @@ drop function bug27563; drop procedure proc27563; PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 '; EXECUTE stmt; +# +# Bug#19723: kill of active connection yields different error code +# depending on platform. +# + +# Connection: con2. +KILL CONNECTION_ID(); +# CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing +# of close of the connection socket +SELECT 1; +Got one of the listed errors diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result index b0ec0d25935..8ecfe3b2094 100644 --- a/mysql-test/r/log_state.result +++ b/mysql-test/r/log_state.result @@ -237,4 +237,16 @@ SELECT @@slow_query_log, @@log_slow_queries; 1 1 SET GLOBAL general_log = @old_general_log_state; SET GLOBAL slow_query_log = @old_slow_log_state; +set @old_general_log_file= @@global.general_log_file; +set @old_slow_query_log_file= @@global.slow_query_log_file; +set global general_log_file= concat('/not exiting path/log.maste', 'r'); +ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master' +set global general_log_file= NULL; +ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL' +set global slow_query_log_file= concat('/not exiting path/log.maste', 'r'); +ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master' +set global slow_query_log_file= NULL; +ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL' +set global general_log_file= @old_general_log_file; +set global slow_query_log_file= @old_slow_query_log_file; End of 5.1 tests diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index a31f2047670..0a7634df85a 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -605,6 +605,7 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`; DROP DATABASE IF EXISTS `db_17876`; SET GLOBAL general_log = @old_general_log_state; SET GLOBAL slow_query_log = @old_slow_log_state; +select CONNECTION_ID() into @thread_id; truncate table mysql.general_log; set @old_general_log_state = @@global.general_log; set global general_log = on; @@ -711,7 +712,7 @@ set @lparam = "000 001 002 003 004 005 006 007 008 009" prepare long_query from "select ? as long_query"; execute long_query using @lparam; set global general_log = off; -select command_type, argument from mysql.general_log; +select command_type, argument from mysql.general_log where thread_id = @thread_id; command_type argument Query set @lparam = "000 001 002 003 004 005 006 007 008 009" "010 011 012 013 014 015 016 017 018 019" diff --git a/mysql-test/r/merge-big.result b/mysql-test/r/merge-big.result new file mode 100644 index 00000000000..82fedc1df73 --- /dev/null +++ b/mysql-test/r/merge-big.result @@ -0,0 +1,77 @@ +drop table if exists t1,t2,t3,t4,t5,t6; +# +# Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE +# corrupts a MERGE table +# Problem #3 +# +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +LOCK TABLE t1 WRITE; +# connection con1 +SET SESSION debug="+d,sleep_open_and_lock_after_open"; +INSERT INTO t1 VALUES (1); +# connection default +# Let INSERT go into thr_multi_lock(). +# Kick INSERT out of thr_multi_lock(). +FLUSH TABLES; +# Let INSERT go through open_tables() where it sleeps. +# Unlock and close table and wait for con1 to close too. +FLUSH TABLES; +# This should give no result. +SELECT * FROM t1; +c1 +UNLOCK TABLES; +# connection con1 +SET SESSION debug="-d,sleep_open_and_lock_after_open"; +# connection default +DROP TABLE t1; +# +# Extra tests for Bug#26379 - Combination of FLUSH TABLE and +# REPAIR TABLE corrupts a MERGE table +# +CREATE TABLE t1 (c1 INT); +CREATE TABLE t2 (c1 INT); +CREATE TABLE t3 (c1 INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +# +# CREATE ... SELECT +# try to access parent from another thread. +# +# connection con1 +SET SESSION debug="+d,sleep_create_select_before_lock"; +CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) +INSERT_METHOD=FIRST SELECT * FROM t3; +# connection default +# Now try to access the parent. +# If 3 is in table, SELECT had to wait. +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +# connection con1 +SET SESSION debug="-d,sleep_create_select_before_lock"; +# connection default +# Cleanup for next test. +DROP TABLE t4; +DELETE FROM t1 WHERE c1 != 1; +# +# CREATE ... SELECT +# try to access child from another thread. +# +# connection con1 +SET SESSION debug="+d,sleep_create_select_before_lock"; +CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) +INSERT_METHOD=FIRST SELECT * FROM t3; +# connection default +# Now try to access a child. +# If 3 is in table, SELECT had to wait. +SELECT * FROM t1 ORDER BY c1; +c1 +1 +3 +# connection con1 +SET SESSION debug="-d,sleep_create_select_before_lock"; +# connection default +DROP TABLE t1, t2, t3, t4; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 6e9195f7425..a709817b7ef 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -584,9 +584,7 @@ insert into t1 values (1); insert into t2 values (2); create temporary table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); select * from t3; -a -1 -2 +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist create temporary table t4 (a int not null); create temporary table t5 (a int not null); insert into t4 values (1); @@ -597,6 +595,54 @@ a 1 2 drop table t6, t3, t1, t2, t4, t5; +create temporary table t1 (a int not null); +create temporary table t2 (a int not null); +insert into t1 values (1); +insert into t2 values (2); +create table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +select * from t3; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +drop table t3, t2, t1; +create table t1 (a int not null); +create temporary table t2 (a int not null); +insert into t1 values (1); +insert into t2 values (2); +create table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +select * from t3; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +drop table t3; +create temporary table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +select * from t3; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +drop table t3, t2, t1; +# CREATE...SELECT is not implemented for MERGE tables. +CREATE TEMPORARY TABLE t1 (c1 INT NOT NULL); +CREATE TEMPORARY TABLE t2 (c1 INT NOT NULL); +CREATE TABLE t3 (c1 INT NOT NULL); +INSERT INTO t3 VALUES (3), (33); +LOCK TABLES t3 READ; +CREATE TEMPORARY TABLE t4 (c1 INT NOT NULL) ENGINE=MERGE UNION=(t1,t2) +INSERT_METHOD=LAST SELECT * FROM t3; +ERROR HY000: 'test.t4' is not BASE TABLE +SELECT * FROM t4; +ERROR HY000: Table 't4' was not locked with LOCK TABLES +UNLOCK TABLES; +CREATE TEMPORARY TABLE t4 (c1 INT NOT NULL) ENGINE=MERGE UNION=(t1,t2) +INSERT_METHOD=LAST; +INSERT INTO t4 SELECT * FROM t3; +# Alter temporary MERGE table. +ALTER TABLE t4 UNION=(t1); +LOCK TABLES t4 WRITE; +# Alter temporary MERGE table under LOCk tables. +ALTER TABLE t4 UNION=(t1,t2); +UNLOCK TABLES; +# MERGE table and function. +CREATE FUNCTION f1 () RETURNS INT RETURN (SELECT max(c1) FROM t3); +SELECT * FROM t4 WHERE c1 < f1(); +c1 +3 +DROP FUNCTION f1; +DROP TABLE t4, t3, t2, t1; CREATE TABLE t1 ( fileset_id tinyint(3) unsigned NOT NULL default '0', file_code varchar(32) NOT NULL default '', @@ -650,11 +696,11 @@ create table t2 (a int); insert into t1 values (0); insert into t2 values (1); create table t3 engine=merge union=(t1, t2) select * from t1; -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: 'test.t3' is not BASE TABLE create table t3 engine=merge union=(t1, t2) select * from t2; -ERROR HY000: You can't specify target table 't2' for update in FROM clause +ERROR HY000: 'test.t3' is not BASE TABLE create table t3 engine=merge union=(t1, t2) select (select max(a) from t2); -ERROR HY000: You can't specify target table 't2' for update in FROM clause +ERROR HY000: 'test.t3' is not BASE TABLE drop table t1, t2; create table t1 ( a double(14,4), @@ -784,7 +830,7 @@ ERROR HY000: Unable to open underlying table which is differently defined or of DROP TABLE t1, t2; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); SELECT * FROM t2; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR 42S02: Table 'test.t3' doesn't exist DROP TABLE t2; CREATE TABLE t1(a INT, b TEXT); CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1); @@ -849,20 +895,17 @@ drop table t2; drop table t1; CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2); SELECT * FROM tm1; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR 42S02: Table 'test.t1' doesn't exist CHECK TABLE tm1; Table Op Msg_type Msg_text -test.tm1 check Error Table 'test.t1' is differently defined or of non-MyISAM type or doesn't exist -test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist -test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +test.tm1 check Error Table 'test.t1' doesn't exist test.tm1 check error Corrupt CREATE TABLE t1(a INT); SELECT * FROM tm1; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR 42S02: Table 'test.t2' doesn't exist CHECK TABLE tm1; Table Op Msg_type Msg_text -test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist -test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +test.tm1 check Error Table 'test.t2' doesn't exist test.tm1 check error Corrupt CREATE TABLE t2(a BLOB); SELECT * FROM tm1; @@ -922,3 +965,1022 @@ id ref 4 5 DROP TABLE t1, t2, t3; End of 5.0 tests +create table t1 (c1 int, index(c1)); +create table t2 (c1 int, index(c1)) engine=merge union=(t1); +insert into t1 values (1); +flush tables; +select * from t2; +c1 +1 +flush tables; +truncate table t1; +insert into t1 values (1); +flush tables; +select * from t2; +c1 +1 +truncate table t1; +insert into t1 values (1); +drop table t1,t2; +# +# Extra tests for TRUNCATE. +# +# Truncate MERGE table. +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)); +CREATE TABLE t3 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1,t2); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t3; +c1 +1 +2 +TRUNCATE TABLE t3; +SELECT * FROM t3; +c1 +# +# Truncate child table. +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +TRUNCATE TABLE t1; +SELECT * FROM t3; +c1 +2 +# +# Truncate MERGE table under locked tables. +LOCK TABLE t1 WRITE, t2 WRITE, t3 WRITE; +INSERT INTO t1 VALUES (1); +TRUNCATE TABLE t3; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3; +c1 +1 +2 +# +# Truncate child table under locked tables. +TRUNCATE TABLE t1; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3; +c1 +1 +2 +UNLOCK TABLES; +DROP TABLE t1, t2, t3; +# +# Truncate temporary MERGE table. +CREATE TEMPORARY TABLE t1 (c1 INT, INDEX(c1)); +CREATE TEMPORARY TABLE t2 (c1 INT, INDEX(c1)); +CREATE TEMPORARY TABLE t3 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1,t2); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t3; +c1 +1 +2 +TRUNCATE TABLE t3; +SELECT * FROM t3; +c1 +# +# Truncate temporary child table. +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +TRUNCATE TABLE t1; +SELECT * FROM t3; +c1 +2 +# +# Truncate temporary MERGE table under locked tables. +INSERT INTO t1 VALUES (1); +CREATE TABLE t4 (c1 INT, INDEX(c1)); +LOCK TABLE t4 WRITE; +TRUNCATE TABLE t3; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3; +c1 +1 +2 +# +# Truncate temporary child table under locked tables. +TRUNCATE TABLE t1; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3; +c1 +1 +2 +UNLOCK TABLES; +DROP TABLE t1, t2, t3, t4; +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1) INSERT_METHOD= LAST; +REPAIR TABLE t1; +INSERT INTO t2 VALUES (1); +Table Op Msg_type Msg_text +test.t1 repair status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1) INSERT_METHOD= LAST; +LOCK TABLE t1 WRITE; +INSERT INTO t2 VALUES (1); +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +UNLOCK TABLES; +DROP TABLE t1, t2; +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +LOCK TABLE t1 WRITE; +INSERT INTO t1 VALUES (1); +FLUSH TABLES; +FLUSH TABLES; +SELECT * FROM t1; +c1 +UNLOCK TABLES; +DROP TABLE t1; +# +# Extra tests for Bug#26379 - Combination of FLUSH TABLE and +# REPAIR TABLE corrupts a MERGE table +# +# CREATE ... SELECT is disabled for MERGE tables. +# +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=LAST; +CREATE TABLE t3 ENGINE=MRG_MYISAM INSERT_METHOD=LAST SELECT * FROM t2; +ERROR HY000: Table 't3' is read only +SHOW CREATE TABLE t3; +ERROR 42S02: Table 'test.t3' doesn't exist +CREATE TABLE t3 ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=LAST +SELECT * FROM t2; +ERROR HY000: 'test.t3' is not BASE TABLE +SHOW CREATE TABLE t3; +ERROR 42S02: Table 'test.t3' doesn't exist +DROP TABLE t1, t2; +# +# CREATE ... LIKE +# +# 1. Create like. +CREATE TABLE t1 (c1 INT); +CREATE TABLE t2 (c1 INT); +CREATE TABLE t3 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) +INSERT_METHOD=LAST; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +CREATE TABLE t4 LIKE t3; +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=() +INSERT INTO t4 VALUES (4); +ERROR HY000: Table 't4' is read only +DROP TABLE t4; +# +# 1. Create like with locked tables. +LOCK TABLES t3 WRITE, t2 WRITE, t1 WRITE; +CREATE TABLE t4 LIKE t3; +SHOW CREATE TABLE t4; +ERROR HY000: Table 't4' was not locked with LOCK TABLES +INSERT INTO t4 VALUES (4); +ERROR HY000: Table 't4' was not locked with LOCK TABLES +UNLOCK TABLES; +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=() +INSERT INTO t4 VALUES (4); +ERROR HY000: Table 't4' is read only +DROP TABLE t4; +# +# Rename child. +# +# 1. Normal rename of non-MERGE table. +CREATE TABLE t4 (c1 INT); +INSERT INTO t4 VALUES (4); +SELECT * FROM t4 ORDER BY c1; +c1 +4 +RENAME TABLE t4 TO t5; +SELECT * FROM t5 ORDER BY c1; +c1 +4 +RENAME TABLE t5 TO t4; +SELECT * FROM t4 ORDER BY c1; +c1 +4 +DROP TABLE t4; +# +# 2. Normal rename. +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +RENAME TABLE t2 TO t5; +SELECT * FROM t3 ORDER BY c1; +ERROR 42S02: Table 'test.t2' doesn't exist +RENAME TABLE t5 TO t2; +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +# +# 3. Normal rename with locked tables. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +RENAME TABLE t2 TO t5; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +RENAME TABLE t5 TO t2; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# +# 4. Alter table rename. +ALTER TABLE t2 RENAME TO t5; +SELECT * FROM t3 ORDER BY c1; +ERROR 42S02: Table 'test.t2' doesn't exist +ALTER TABLE t5 RENAME TO t2; +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +# +# 5. Alter table rename with locked tables. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +ALTER TABLE t2 RENAME TO t5; +SELECT * FROM t3 ORDER BY c1; +ERROR HY000: Table 't3' was not locked with LOCK TABLES +ALTER TABLE t5 RENAME TO t2; +ERROR HY000: Table 't5' was not locked with LOCK TABLES +UNLOCK TABLES; +ALTER TABLE t5 RENAME TO t2; +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +# +# Rename parent. +# +# 1. Normal rename with locked tables. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +RENAME TABLE t3 TO t5; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +RENAME TABLE t5 TO t3; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +# +# 5. Alter table rename with locked tables. +ALTER TABLE t3 RENAME TO t5; +SELECT * FROM t5 ORDER BY c1; +ERROR HY000: Table 't5' was not locked with LOCK TABLES +ALTER TABLE t5 RENAME TO t3; +ERROR HY000: Table 't5' was not locked with LOCK TABLES +UNLOCK TABLES; +ALTER TABLE t5 RENAME TO t3; +SELECT * FROM t3 ORDER BY c1; +c1 +1 +2 +3 +DROP TABLE t1, t2, t3; +# +# Drop locked tables. +# +# 1. Drop parent. +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1) +INSERT_METHOD=LAST; +LOCK TABLES t1 WRITE, t2 WRITE; +INSERT INTO t1 VALUES (1); +DROP TABLE t2; +SELECT * FROM t2; +ERROR HY000: Table 't2' was not locked with LOCK TABLES +SELECT * FROM t1; +c1 +1 +UNLOCK TABLES; +# 2. Drop child. +CREATE TABLE t2 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1) +INSERT_METHOD=LAST; +LOCK TABLES t1 WRITE, t2 WRITE; +INSERT INTO t1 VALUES (1); +DROP TABLE t1; +SELECT * FROM t2; +ERROR 42S02: Table 'test.t1' doesn't exist +SELECT * FROM t1; +ERROR 42S02: Table 'test.t1' doesn't exist +UNLOCK TABLES; +DROP TABLE t2; +# +# ALTER TABLE. Change child list. +# +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)); +CREATE TABLE t3 (c1 INT, INDEX(c1)); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +CREATE TABLE t4 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t3,t2) +INSERT_METHOD=LAST; +# Shrink child list. +ALTER TABLE t4 UNION=(t3); +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `c1` int(11) DEFAULT NULL, + KEY `c1` (`c1`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t3`) +SELECT * FROM t4 ORDER BY c1; +c1 +3 +# Extend child list. +ALTER TABLE t4 UNION=(t3,t2); +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `c1` int(11) DEFAULT NULL, + KEY `c1` (`c1`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t3`,`t2`) +SELECT * FROM t4 ORDER BY c1; +c1 +2 +3 +# +# ALTER TABLE under LOCK TABLES. Change child list. +# +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE; +# Shrink child list. +ALTER TABLE t4 UNION=(t3); +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +# Extend child list within locked tables. +ALTER TABLE t4 UNION=(t3,t2); +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +# Extend child list beyond locked tables. +ALTER TABLE t4 UNION=(t3,t2,t1); +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +SHOW CREATE TABLE t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `c1` int(11) DEFAULT NULL, + KEY `c1` (`c1`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t3`,`t2`) +SELECT * FROM t4 ORDER BY c1; +c1 +2 +3 +UNLOCK TABLES; +DROP TABLE t4; +# +# ALTER TABLE under LOCK TABLES. Grave change, table re-creation. +# +CREATE TABLE t4 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1,t2,t3) +INSERT_METHOD=LAST; +# Lock parent first and then children. +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE, t1 WRITE; +ALTER TABLE t4 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +ALTER TABLE t2 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# Lock children first and then parent. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE; +ALTER TABLE t4 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +ALTER TABLE t2 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# Lock parent between children. +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +ALTER TABLE t4 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +ALTER TABLE t2 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +DROP TABLE t1, t2, t3, t4; +# +# ALTER TABLE under LOCK TABLES. Simple change, no re-creation. +# +CREATE TABLE t1 (c1 INT); +CREATE TABLE t2 (c1 INT); +CREATE TABLE t3 (c1 INT); +CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2,t3) +INSERT_METHOD=LAST; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +# Lock parent first and then children. +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE, t1 WRITE; +ALTER TABLE t4 ALTER COLUMN c1 SET DEFAULT 44; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +ALTER TABLE t2 ALTER COLUMN c1 SET DEFAULT 22; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# Lock children first and then parent. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE; +ALTER TABLE t4 ALTER COLUMN c1 SET DEFAULT 44; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +ALTER TABLE t2 ALTER COLUMN c1 SET DEFAULT 22; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# Lock parent between children. +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +ALTER TABLE t4 ALTER COLUMN c1 SET DEFAULT 44; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +ALTER TABLE t2 ALTER COLUMN c1 SET DEFAULT 22; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# +# FLUSH TABLE under LOCK TABLES. +# +# Lock parent first and then children. +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE, t1 WRITE; +FLUSH TABLE t4; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +FLUSH TABLE t2; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +FLUSH TABLES; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# Lock children first and then parent. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE; +FLUSH TABLE t4; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +FLUSH TABLE t2; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +FLUSH TABLES; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# Lock parent between children. +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +FLUSH TABLE t4; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +FLUSH TABLE t2; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +FLUSH TABLES; +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +UNLOCK TABLES; +# +# Triggers +# +# Trigger on parent +DELETE FROM t4 WHERE c1 = 4; +CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +@a +1 +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +DROP TRIGGER t4_ai; +# Trigger on parent under LOCK TABLES +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +@a +1 +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +DROP TRIGGER t4_ai; +UNLOCK TABLES; +# +# Trigger on child +DELETE FROM t4 WHERE c1 = 4; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +@a +0 +INSERT INTO t3 VALUES (33); +SELECT @a; +@a +1 +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +33 +DROP TRIGGER t3_ai; +# Trigger on child under LOCK TABLES +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +@a +0 +INSERT INTO t3 VALUES (33); +SELECT @a; +@a +1 +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +33 +33 +DELETE FROM t4 WHERE c1 = 33; +DROP TRIGGER t3_ai; +# +# Trigger with table use on child +DELETE FROM t4 WHERE c1 = 4; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22); +INSERT INTO t4 VALUES (4); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +INSERT INTO t3 VALUES (33); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +22 +33 +DELETE FROM t4 WHERE c1 = 22; +DELETE FROM t4 WHERE c1 = 33; +DROP TRIGGER t3_ai; +# Trigger with table use on child under LOCK TABLES +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22); +INSERT INTO t4 VALUES (4); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +INSERT INTO t3 VALUES (33); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +22 +33 +DROP TRIGGER t3_ai; +DELETE FROM t4 WHERE c1 = 22; +DELETE FROM t4 WHERE c1 = 33; +UNLOCK TABLES; +# +# Repair +# +REPAIR TABLE t4; +Table Op Msg_type Msg_text +test.t4 repair note The storage engine for the table doesn't support repair +REPAIR TABLE t2; +Table Op Msg_type Msg_text +test.t2 repair status OK +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +REPAIR TABLE t4; +Table Op Msg_type Msg_text +test.t4 repair note The storage engine for the table doesn't support repair +REPAIR TABLE t2; +Table Op Msg_type Msg_text +test.t2 repair status OK +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +UNLOCK TABLES; +# +# Optimize +# +OPTIMIZE TABLE t4; +Table Op Msg_type Msg_text +test.t4 optimize note The storage engine for the table doesn't support optimize +OPTIMIZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status OK +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +OPTIMIZE TABLE t4; +Table Op Msg_type Msg_text +test.t4 optimize note The storage engine for the table doesn't support optimize +OPTIMIZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status Table is already up to date +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +UNLOCK TABLES; +# +# Checksum +# +CHECKSUM TABLE t4; +Table Checksum +test.t4 46622073 +CHECKSUM TABLE t2; +Table Checksum +test.t2 3700403066 +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CHECKSUM TABLE t4; +Table Checksum +test.t4 46622073 +CHECKSUM TABLE t2; +Table Checksum +test.t2 3700403066 +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +UNLOCK TABLES; +# +# Insert delayed +# +INSERT DELAYED INTO t4 VALUES(44); +DELETE FROM t4 WHERE c1 = 44; +INSERT DELAYED INTO t3 VALUES(33); +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +33 +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +INSERT DELAYED INTO t4 VALUES(444); +Got one of the listed errors +INSERT DELAYED INTO t3 VALUES(333); +Got one of the listed errors +SELECT * FROM t4 ORDER BY c1; +c1 +1 +2 +3 +4 +4 +33 +UNLOCK TABLES; +DROP TABLE t1, t2, t3, t4; +# +# Recursive inclusion of merge tables in their union clauses. +# +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1) +INSERT_METHOD=LAST; +CREATE TABLE t3 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t2,t1) +INSERT_METHOD=LAST; +ALTER TABLE t2 UNION=(t3,t1); +SELECT * FROM t2; +ERROR HY000: Table 't3' is differently defined or of non-MyISAM type or doesn't exist +DROP TABLE t1, t2, t3; +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t3 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1, t2); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t3; +c1 +1 +2 +TRUNCATE TABLE t1; +SELECT * FROM t3; +c1 +2 +DROP TABLE t1, t2, t3; +CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER); +SET @rnd_max= 2147483647; +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +SET @rnd= RAND(); +SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); +SET @id_rev= @rnd_max - @id; +SET @grp= CAST(127.0 * @rnd AS UNSIGNED); +INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); +set @@read_buffer_size=2*1024*1024; +CREATE TABLE t2 SELECT * FROM t1; +INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2; +INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1; +INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2; +INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1; +INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2; +CREATE TABLE t3 (id INTEGER, grp TINYINT, id_rev INTEGER) +ENGINE= MRG_MYISAM UNION= (t1, t2); +SELECT COUNT(*) FROM t1; +COUNT(*) +130 +SELECT COUNT(*) FROM t2; +COUNT(*) +80 +SELECT COUNT(*) FROM t3; +COUNT(*) +210 +SELECT COUNT(DISTINCT a1.id) FROM t3 AS a1, t3 AS a2 +WHERE a1.id = a2.id GROUP BY a2.grp; +TRUNCATE TABLE t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +0 +SELECT COUNT(*) FROM t2; +COUNT(*) +80 +SELECT COUNT(*) FROM t3; +COUNT(*) +80 +DROP TABLE t1, t2, t3; +CREATE TABLE t1 (c1 INT) ENGINE=MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=LAST; +INSERT INTO t2 VALUES (1); +SELECT * FROM t2; +c1 +1 +LOCK TABLES t2 WRITE, t1 WRITE; +FLUSH TABLES; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +UNLOCK TABLES; +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +LOCK TABLES t2 WRITE, t1 WRITE; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +UNLOCK TABLES; +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +CREATE TABLE t1 ( a INT ) ENGINE=MyISAM; +CREATE TABLE m1 ( a INT ) ENGINE=MRG_MYISAM UNION=(t1); +LOCK TABLES t1 WRITE, m1 WRITE; +FLUSH TABLE t1; +UNLOCK TABLES; +DROP TABLE m1, t1; +CREATE TABLE t1 ( a INT ) ENGINE=MyISAM; +CREATE TABLE m1 ( a INT ) ENGINE=MRG_MYISAM UNION=(t1); +LOCK TABLES m1 WRITE, t1 WRITE; +FLUSH TABLE t1; +UNLOCK TABLES; +DROP TABLE m1, t1; +CREATE TABLE t1 (c1 INT, c2 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT, c2 INT) ENGINE= MyISAM; +CREATE TABLE t3 (c1 INT, c2 INT) ENGINE= MRG_MYISAM UNION(t1, t2); +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +SELECT * FROM t3; +c1 c2 +1 1 +2 2 +ALTER TABLE t1 ENGINE= MEMORY; +INSERT INTO t1 VALUES (0, 0); +SELECT * FROM t3; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +DROP TABLE t1, t2, t3; +CREATE TABLE t1 (c1 INT, KEY(c1)); +CREATE TABLE t2 (c1 INT, KEY(c1)) ENGINE=MRG_MYISAM UNION=(t1) +INSERT_METHOD=FIRST; +LOCK TABLE t1 WRITE, t2 WRITE; +FLUSH TABLES t2, t1; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +FLUSH TABLES t1; +UNLOCK TABLES; +FLUSH TABLES; +INSERT INTO t1 VALUES (1); +LOCK TABLE t1 WRITE, t2 WRITE; +FLUSH TABLES t2, t1; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +FLUSH TABLES t1; +UNLOCK TABLES; +DROP TABLE t1, t2; +CREATE TABLE t1 (ID INT) ENGINE=MYISAM; +CREATE TABLE m1 (ID INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST; +INSERT INTO t1 VALUES (); +INSERT INTO m1 VALUES (); +LOCK TABLE t1 WRITE, m1 WRITE; +FLUSH TABLES m1, t1; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +FLUSH TABLES m1, t1; +UNLOCK TABLES; +DROP TABLE t1, m1; diff --git a/mysql-test/r/merge_innodb.result b/mysql-test/r/merge_innodb.result new file mode 100644 index 00000000000..f6057d279b1 --- /dev/null +++ b/mysql-test/r/merge_innodb.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS t1, t2, t3, t4, t5; +CREATE TABLE t1 (c1 varchar(100)) ENGINE=MyISAM; +CREATE TABLE t2 (c1 varchar(100)) ENGINE=MyISAM; +CREATE TABLE t3 (c1 varchar(100)) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('Ann'), ('Alice'); +INSERT INTO t2 VALUES ('Bob'), ('Brian'); +INSERT INTO t3 VALUES ('Chris'), ('Charlie'); +CREATE TABLE t4 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t2) +INSERT_METHOD=LAST; +CREATE TABLE t5 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t3) +INSERT_METHOD=LAST; +SELECT * FROM t5; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +SELECT * FROM t4; +c1 +Ann +Alice +Bob +Brian +ALTER TABLE t2 ENGINE=InnoDB; +SELECT * FROM t4; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +DELETE FROM t2 LIMIT 1; +SELECT * FROM t4; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +INSERT INTO t4 VALUES ('Beware'); +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +SELECT * FROM t4; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +SELECT * FROM t2; +c1 +Brian +SELECT * FROM t1; +c1 +Ann +Alice +DROP TABLE t1, t2, t3, t4, t5; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 55e47756312..0bc01e95d2d 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -614,6 +614,7 @@ CREATE TABLE `t2` ( `b` int(11) default NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; +set @sav_binlog_format= @@session.binlog_format; set @@session.binlog_format= mixed; insert into t1 values (1,1),(2,2); insert into t2 values (1,1),(4,4); @@ -626,7 +627,7 @@ a b 4 4 show master status /* there must be the UPDATE query event */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 197 +master-bin.000001 268 delete from t1; delete from t2; insert into t1 values (1,2),(3,4),(4,4); @@ -636,6 +637,24 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; ERROR 23000: Duplicate entry '4' for key 'PRIMARY' show master status /* there must be the UPDATE query event */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 212 +master-bin.000001 283 drop table t1, t2; +set @@session.binlog_format= @sav_binlog_format; +drop table if exists t1, t2, t3; +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)); +CREATE TABLE t3 (a int, PRIMARY KEY (a)) ENGINE=MyISAM; +create trigger trg_del_t3 before delete on t3 for each row insert into t1 values (1); +insert into t2 values (1),(2); +insert into t3 values (1),(2); +reset master; +delete t3.* from t2,t3 where t2.a=t3.a; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +select count(*) from t1 /* must be 1 */; +count(*) +1 +select count(*) from t3 /* must be 1 */; +count(*) +1 +drop table t1, t2, t3; end of tests diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 205edf2d617..1c8b5e9d7d9 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -606,24 +606,6 @@ select count(*) from t1 where a is null; count(*) 2 drop table t1; -create table t1 (c1 int, index(c1)); -create table t2 (c1 int, index(c1)) engine=merge union=(t1); -insert into t1 values (1); -flush tables; -select * from t2; -c1 -1 -flush tables; -truncate table t1; -insert into t1 values (1); -flush tables; -select * from t2; -c1 -1 -truncate table t1; -ERROR HY000: MyISAM table 't1' is in use (most likely by a MERGE table). Try FLUSH TABLES. -insert into t1 values (1); -drop table t1,t2; create table t1 (c1 int, c2 varchar(4) not null default '', key(c2(3))) default charset=utf8; insert into t1 values (1,'A'), (2, 'B'), (3, 'A'); @@ -1818,6 +1800,14 @@ ALTER TABLE t1 ENABLE KEYS; SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # # +# Enable keys with parallel repair +SET @@myisam_repair_threads=2; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +SET @@myisam_repair_threads=1; +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM; CREATE TABLE t2 LIKE t1; diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result new file mode 100644 index 00000000000..5f39d318234 --- /dev/null +++ b/mysql-test/r/myisampack.result @@ -0,0 +1,29 @@ +CREATE TABLE t1(c1 DOUBLE, c2 DOUBLE, c3 DOUBLE, c4 DOUBLE, c5 DOUBLE, +c6 DOUBLE, c7 DOUBLE, c8 DOUBLE, c9 DOUBLE, a INT PRIMARY KEY); +INSERT INTO t1 VALUES +(-3.31168791059336e-06,-3.19054655887874e-06,-1.06528081684847e-05,-1.227278240089e-06,-1.66718069164799e-06,-2.59038972510885e-06,-2.83145227805303e-06,-4.09678491270648e-07,-2.22610091291797e-06,6), +(0.0030743000272545,2.53222044316438e-05,2.78674650061845e-05,1.95914465544536e-05,1.7347572525984e-05,1.87513810069614e-05,1.69882826885005e-05,2.44449336987598e-05,1.89914629921774e-05,9), +(2.85229319423495e-05,3.05970988282259e-05,3.77161100113133e-05,2.3055238978766e-05,2.08241267364615e-05,2.28009504270553e-05,2.12070165658947e-05,2.84350091565409e-05,2.3366822910704e-05,3), +(0,0,0,0,0,0,0,0,0,12), +(3.24544577570754e-05,3.44619021870993e-05,4.37561613201124e-05,2.57556808726748e-05,2.3195354640561e-05,2.58532400758869e-05,2.34934241667179e-05,3.1621640063232e-05,2.58229982746189e-05,19), +(2.53222044316438e-05,0.00445071933455582,2.97447268116016e-05,2.12379514059868e-05,1.86777776502663e-05,2.0170058676712e-05,1.8946030385445e-05,2.66040037173511e-05,2.09161899668946e-05,20), +(3.03462382611645e-05,3.26517930083994e-05,3.5242025468662e-05,2.53219745106391e-05,2.24384532945004e-05,2.4052346047657e-05,2.23865572957053e-05,3.1634313969082e-05,2.48285463481801e-05,21), +(1.95914465544536e-05,2.12379514059868e-05,2.27808649037128e-05,0.000341724375366877,1.4512761275113e-05,1.56475828693953e-05,1.44372366441415e-05,2.07952121981765e-05,1.61488256935919e-05,28), +(1.7347572525984e-05,1.86777776502663e-05,2.04116907052727e-05,1.4512761275113e-05,0.000432162526082388,1.38116514014465e-05,1.2712914948904e-05,1.82503165178506e-05,1.43043075345922e-05,30), +(1.68339762136661e-05,1.77836497166611e-05,2.36328309295222e-05,1.30183423732016e-05,1.18674654241553e-05,1.32467273128652e-05,1.24581739117775e-05,1.55624190959406e-05,1.33010638508213e-05,31), +(1.89643062824415e-05,2.06997140070717e-05,2.29045490159364e-05,1.57918175731019e-05,1.39864987449492e-05,1.50580274578455e-05,1.45908734129609e-05,1.95329296993327e-05,1.5814709481221e-05,32), +(1.69882826885005e-05,1.8946030385445e-05,2.00820439721439e-05,1.44372366441415e-05,1.2712914948904e-05,1.35209686474184e-05,0.00261563314789896,1.78285095864627e-05,1.46699314500019e-05,34), +(2.0278186540684e-05,2.18923409729654e-05,2.39981539939738e-05,1.71774589459438e-05,1.54654355357383e-05,1.62731485707636e-05,1.49253140625051e-05,2.18229800160297e-05,1.71923561673718e-05,35), +(2.44449336987598e-05,2.66040037173511e-05,2.84860148925308e-05,2.07952121981765e-05,1.82503165178506e-05,1.97667730441441e-05,1.78285095864627e-05,0.00166478601822712,2.0299952103232e-05,36), +(1.89914629921774e-05,2.09161899668946e-05,2.26026841007872e-05,1.61488256935919e-05,1.43043075345922e-05,1.52609063290127e-05,1.46699314500019e-05,2.0299952103232e-05,0.00306670170971682,39), +(0,0,0,0,0,0,0,0,0,41), +(0,0,0,0,0,0,0,0,0,17), +(0,0,0,0,0,0,0,0,0,18), +(2.51880677333017e-05,2.63051795435778e-05,2.79874748974906e-05,2.02888886670845e-05,1.8178636318197e-05,1.91308527003585e-05,1.83260023644133e-05,2.4422300558171e-05,1.96411467520551e-05,44), +(2.22402118719591e-05,2.37546284320705e-05,2.58463051055541e-05,1.83391609130854e-05,1.6300720519646e-05,1.74559091886791e-05,1.63733785575587e-05,2.26616253279828e-05,1.79541237435621e-05,45), +(3.01092775359837e-05,3.23865212934412e-05,4.09444584045994e-05,0,2.15470966302776e-05,2.39082636344032e-05,2.28296706429177e-05,2.9007671511595e-05,2.44201138973326e-05,46); +FLUSH TABLES; +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 4e39fb28454..a4d96c1c243 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -178,5 +178,14 @@ ERROR at line 1: DELIMITER cannot contain a backslash character 1 1 1 +This is a file starting with UTF8 BOM 0xEFBBBF +This is a file starting with UTF8 BOM 0xEFBBBF End of 5.0 tests WARNING: --server-arg option not supported in this configuration. +Warning (Code 1286): Unknown table engine 'nonexistent' +Warning (Code 1266): Using storage engine MyISAM for table 't2' +Warning (Code 1286): Unknown table engine 'nonexistent2' +Warning (Code 1266): Using storage engine MyISAM for table 't2' +Error (Code 1050): Table 't2' already exists +drop tables t1, t2; +End of tests diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 1deb9401aa1..e6485720c49 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -326,6 +326,7 @@ flush logs; drop table t1; 1 drop table t1; +shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql End of 5.0 tests flush logs; BUG#31611: Security risk with BINLOG statement diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index b8ada0adff9..047b2662b1b 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, `t``1`, `t 1`; drop view if exists v1; drop database if exists client_test_db; mysql.columns_priv OK @@ -57,4 +57,27 @@ test.t1 OK test.t1 OK drop view v1; drop table t1; +create table `t``1`(a int); +create table `t 1`(a int); +test.t 1 OK +test.t`1 OK +drop table `t``1`, `t 1`; End of 5.0 tests +create table t1(a int); +create view v1 as select * from t1; +show tables; +Tables_in_test +t1 +v1 +show tables; +Tables_in_test +t1 +#mysql50#v-1 +v1 +show tables; +Tables_in_test +t1 +v1 +v-1 +drop view v1, `v-1`; +drop table t1; diff --git a/mysql-test/r/no-threads.result b/mysql-test/r/no-threads.result index 50e52138be8..aefecd0f7bc 100644 --- a/mysql-test/r/no-threads.result +++ b/mysql-test/r/no-threads.result @@ -4,3 +4,6 @@ select 1+1; select 1+2; 1+2 3 +SHOW GLOBAL VARIABLES LIKE 'thread_handling'; +Variable_name Value +thread_handling no-threads diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 63c9590401c..4540c9d5218 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -726,3 +726,11 @@ count(a) 3 drop table t1; ############################################################## +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(0); +SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP; +1 +1 +1 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 76326f65f08..ef53f227ec0 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -484,3 +484,46 @@ select atan(10, 20 "p2"); ERROR 42000: Incorrect parameters in the call to native function 'atan' select atan(10 AS p1, 20 AS p2); ERROR 42000: Incorrect parameters in the call to native function 'atan' +DROP TABLE IF EXISTS t1; +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; +STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE +NULL +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE; +STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE +NULL +SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND; +"1997-12-31 23:59:59" + INTERVAL 1 SECOND +1998-01-01 00:00:00 +SELECT 1 + INTERVAL(1,0,1,2) + 1; +1 + INTERVAL(1,0,1,2) + 1 +4 +SELECT INTERVAL(1^1,0,1,2) + 1; +INTERVAL(1^1,0,1,2) + 1 +2 +SELECT INTERVAL(1,0+1,2,3) * 5.5; +INTERVAL(1,0+1,2,3) * 5.5 +5.5 +SELECT INTERVAL(3,3,1+3,4+4) / 0.5; +INTERVAL(3,3,1+3,4+4) / 0.5 +2.0000 +SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2; +(INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2 +50.0000 +SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2); +INTERVAL(1,0,1,2) + 1 5 * INTERVAL(1,0,1,2) +3 10 +SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3); +INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3) +2 +SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND; +1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND +NULL +SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND; +1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND +NULL +CREATE TABLE t1 (a INT, b DATETIME); +INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND); +SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1; +a b +3 1998-01-01 00:00:00 +DROP TABLE t1; diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index f90bd2de661..a361a8f6bcc 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -289,6 +289,13 @@ select * from t1 where a = 4; a b 4 4 drop table t1; +CREATE TABLE t1 (c1 INT, c2 INT, PRIMARY KEY USING BTREE (c1,c2)) ENGINE=MEMORY +PARTITION BY KEY(c2,c1) PARTITIONS 4; +INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6); +SELECT * FROM t1 WHERE c1 = 4; +c1 c2 +4 4 +DROP TABLE t1; CREATE TABLE t1 (a int) PARTITION BY LIST (a) PARTITIONS 1 @@ -1303,6 +1310,63 @@ select c1 from t1 group by (select c0 from t1 limit 1); c1 -6862346 drop table t1; +CREATE TABLE t1(a int) +PARTITION BY RANGE (a) ( +PARTITION p1 VALUES LESS THAN (10), +PARTITION p2 VALUES LESS THAN (20) +); +ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1 +ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1 +DROP TABLE t1; +CREATE TABLE t1 (s1 BIGINT UNSIGNED) +PARTITION BY RANGE (s1) ( +PARTITION p0 VALUES LESS THAN (0), +PARTITION p1 VALUES LESS THAN (1), +PARTITION p2 VALUES LESS THAN (18446744073709551615) +); +INSERT INTO t1 VALUES (0), (18446744073709551614); +INSERT INTO t1 VALUES (18446744073709551615); +ERROR HY000: Table has no partition for value 18446744073709551615 +DROP TABLE t1; +CREATE TABLE t1 (s1 BIGINT UNSIGNED) +PARTITION BY RANGE (s1) ( +PARTITION p0 VALUES LESS THAN (0), +PARTITION p1 VALUES LESS THAN (1), +PARTITION p2 VALUES LESS THAN (18446744073709551614), +PARTITION p3 VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (-1), (0), (18446744073709551613), +(18446744073709551614), (18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 's1' at row 1 +SELECT * FROM t1; +s1 +0 +0 +18446744073709551613 +18446744073709551614 +18446744073709551615 +SELECT * FROM t1 WHERE s1 = 0; +s1 +0 +0 +SELECT * FROM t1 WHERE s1 = 18446744073709551614; +s1 +18446744073709551614 +SELECT * FROM t1 WHERE s1 = 18446744073709551615; +s1 +18446744073709551615 +DROP TABLE t1; +CREATE TABLE t1 (s1 BIGINT UNSIGNED) +PARTITION BY RANGE (s1) ( +PARTITION p0 VALUES LESS THAN (0), +PARTITION p1 VALUES LESS THAN (1), +PARTITION p2 VALUES LESS THAN (18446744073709551615), +PARTITION p3 VALUES LESS THAN MAXVALUE +); +DROP TABLE t1; CREATE TABLE t1 (int_column INT, char_column CHAR(5), PRIMARY KEY(char_column,int_column)) diff --git a/mysql-test/r/partition_02myisam.result b/mysql-test/r/partition_02myisam.result deleted file mode 100644 index 55263e4f8ce..00000000000 --- a/mysql-test/r/partition_02myisam.result +++ /dev/null @@ -1,1725 +0,0 @@ -SET SESSION storage_engine='MYISAM'; -SET @max_row = 200; -SET AUTOCOMMIT= 1; - -#------------------------------------------------------------------------ -# There are several testcases disabled because ouf the open bugs -# #15407 , #15408 , #15890 , #15961 , #13447 , #15966 , #15968, #16370 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ -# 0. Setting of auxiliary variables + Creation of an auxiliary table -# needed in all testcases -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t0_template; -CREATE TABLE t0_template ( f1 INTEGER, f2 char(20), PRIMARY KEY(f1)) -ENGINE = MEMORY; -# Logging of <max_row> INSERTs into t0_template suppressed - -#------------------------------------------------------------------------ -# 1. Some syntax checks -#------------------------------------------------------------------------ -# 1.1 Subpartioned table without subpartitioning rule must be rejected -DROP TABLE IF EXISTS t1; -# FIXME Implement testcases, where it is checked that all create and -# alter table statements -# - with missing mandatory parameters are rejected -# - with optional parameters are accepted -# - with wrong combinations of optional parameters are rejected -# - ............ - -#------------------------------------------------------------------------ -# 2. Checks where the engine is assigned on all supported (CREATE TABLE -# statement) positions + basic operations on the tables -# Storage engine mixups are currently (2005-12-23) not supported -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t1; -# 2.1 non partitioned table (for comparison) -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM'; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.2 Assignment of storage engine just after column list only -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM' -PARTITION BY HASH(f1) PARTITIONS 2; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) PARTITIONS 2 */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.3 Assignment of storage engine just after partition or subpartition -# name only -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) -( PARTITION part1 STORAGE ENGINE = 'MYISAM', -PARTITION part2 STORAGE ENGINE = 'MYISAM' -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (100) -(SUBPARTITION subpart11 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MYISAM'), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MYISAM') -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.4 Some but not all named partitions or subpartitions get a storage -# engine assigned -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) -( PARTITION part1 STORAGE ENGINE = 'MYISAM', -PARTITION part2 -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) -( PARTITION part1 , -PARTITION part2 STORAGE ENGINE = 'MYISAM' -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (100) -(SUBPARTITION subpart11, -SUBPARTITION subpart12 STORAGE ENGINE = 'MYISAM'), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MYISAM') -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (100) -(SUBPARTITION subpart11 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MYISAM'), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, -SUBPARTITION subpart22 ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.5 Storage engine assignment after partition name + after name of -# subpartitions belonging to another partition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (100) ENGINE = 'MYISAM' -(SUBPARTITION subpart11, -SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MYISAM') -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (100) -(SUBPARTITION subpart11 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MYISAM'), -PARTITION part2 VALUES LESS THAN (2147483647) ENGINE = 'MYISAM' -(SUBPARTITION subpart21, -SUBPARTITION subpart22) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.6 Precedence of storage engine assignments -# 2.6.1 Storage engine assignment after column list + after partition -# or subpartition name -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM' -PARTITION BY HASH(f1) -( PARTITION part1 STORAGE ENGINE = 'MYISAM', -PARTITION part2 STORAGE ENGINE = 'MYISAM' -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM' -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (100) -(SUBPARTITION subpart11 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MYISAM'), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MYISAM') -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.6.2 Storage engine assignment after partition name + after -# subpartition name -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (100) STORAGE ENGINE = 'MYISAM' -(SUBPARTITION subpart11 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MYISAM'), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MYISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MYISAM') -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.7 Session default engine differs from engine used within create table -SET SESSION storage_engine='MEMORY'; -SET SESSION storage_engine='MYISAM'; - -#------------------------------------------------------------------------ -# 3. Check assigning the number of partitions and subpartitions -# with and without named partitions/subpartitions -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t1; -# 3.1 (positive) without partition/subpartition number assignment -# 3.1.1 no partition number, no named partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 3.1.2 no partition number, named partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part2); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 3.1.3 variations on no partition/subpartition number, named partitions, -# different subpartitions are/are not named -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) (PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (200), PARTITION part3 VALUES LESS THAN (2147483647)) ; -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) (PARTITION part1 VALUES LESS THAN (100) -(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (200) -(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (100) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (200) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (2147483647) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM)) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 3.2 partition/subpartition numbers good and bad values and notations -DROP TABLE IF EXISTS t1; -# 3.2.1 partition/subpartition numbers INTEGER notation -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) PARTITIONS 2 */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 2 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483647) ENGINE = MyISAM) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 1; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) PARTITIONS 1 */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 1 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483647) ENGINE = MyISAM) */ -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 0; -ERROR HY000: Number of partitions = 0 is not an allowed value -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 0 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR HY000: Number of subpartitions = 0 is not an allowed value -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS -1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS -1 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (21' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 1000000; -ERROR HY000: Too many partitions (including subpartitions) were defined -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 1000000 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR HY000: Too many partitions (including subpartitions) were defined -# 3.2.4 partition/subpartition numbers STRING notation -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '2' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '2.0'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2.0'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '2.0' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2.0' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN ' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '0.2E+1'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0.2E+1'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '0.2E+1' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0.2E+1' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS TH' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '2A'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2A'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '2A' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2A' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 'A2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''A2'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 'A2' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''A2' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS ''; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (21' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 'GARBAGE'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''GARBAGE'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 'GARBAGE' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''GARBAGE' -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS T' at line 3 -# 3.2.5 partition/subpartition numbers other notations -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2A; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2A' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 2A -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2A -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (21' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS A2; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A2' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS A2 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A2 -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (21' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS GARBAGE; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GARBAGE' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS GARBAGE -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GARBAGE -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THA' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "2"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "2" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "2A"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2A"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "2A" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2A" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "A2"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"A2"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "A2" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"A2" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "GARBAGE"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"GARBAGE"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "GARBAGE" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"GARBAGE" -(PARTITION part1 VALUES LESS THAN (100), PARTITION part2 VALUES LESS T' at line 3 -# 3.3 Mixups of assigned partition/subpartition numbers and names -# 3.3.1 (positive) number of partition/subpartition -# = number of named partition/subpartition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2 ( PARTITION part1, PARTITION part2 ) ; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) PARTITIONS 2 -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPARTITION subpart22) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ -DROP TABLE t1; -# 3.3.2 (positive) number of partition/subpartition , -# 0 (= no) named partition/subpartition -# already checked above -# 3.3.3 (negative) number of partitions/subpartitions -# > number of named partitions/subpartitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2 ( PARTITION part1 ) ; -ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11 ), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPARTITION subpart22) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPAR' at line 5 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 ), -PARTITION part3 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart31, SUBPARTITION subpart32) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), -PARTITION part3 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart31, SUBPAR' at line 7 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) PARTITIONS 2 -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 ) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ') -)' at line 7 -# 3.3.4 (negative) number of partitions < number of named partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 1 ( PARTITION part1, PARTITION part2 ) ; -ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 1 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPARTITION subpart22) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPAR' at line 5 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 1 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 ), -PARTITION part3 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart31, SUBPARTITION subpart32) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 ' at line 5 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 1 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPARTITION subpart22) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPAR' at line 5 - -#------------------------------------------------------------------------ -# 4. Checks of logical partition/subpartition name -# file name clashes during CREATE TABLE -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t1; -# 4.1 (negative) A partition name used more than once -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part1); -ERROR HY000: Duplicate partition name part1 -# FIXME Implement testcases with filename problems -# existing file of other table --- partition/subpartition file name -# partition/subpartition file name --- file of the same table - -#------------------------------------------------------------------------ -# 5. Alter table experiments -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t1; -# 5.1 alter table add partition -# 5.1.1 (negative) add partition to non partitioned table -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -ALTER TABLE t1 ADD PARTITION (PARTITION part1); -Got one of the listed errors -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE t1; -# 5.1.2 Add one partition to a table with one partition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 100 - 1; -ALTER TABLE t1 ADD PARTITION (PARTITION part1); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 100 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 5.1.3 Several times add one partition to a table with some partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part3); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part3 ENGINE = MyISAM) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 100 - 1; -ALTER TABLE t1 ADD PARTITION (PARTITION part0); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part3 ENGINE = MyISAM, PARTITION part0 ENGINE = MyISAM) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 100 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DELETE FROM t1; -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 100 - 1; -ALTER TABLE t1 ADD PARTITION (PARTITION part2); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part3 ENGINE = MyISAM, PARTITION part0 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 100 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DELETE FROM t1; -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 100 - 1; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part3 ENGINE = MyISAM, PARTITION part0 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 100 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 5.1.4 Add several partitions to a table with some partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part3); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part3 ENGINE = MyISAM) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 100 - 1; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) DEFAULT NULL, - `f2` char(20) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = MyISAM, PARTITION part3 ENGINE = MyISAM) */ -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 100 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 5.1.5 (negative) Add partitions to a table with some partitions -# clash on new and already existing partition names -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part2, PARTITION part3); -ALTER TABLE t1 ADD PARTITION (PARTITION part1); -ERROR HY000: Duplicate partition name part1 -ALTER TABLE t1 ADD PARTITION (PARTITION part2); -ERROR HY000: Duplicate partition name part2 -ALTER TABLE t1 ADD PARTITION (PARTITION part3); -ERROR HY000: Duplicate partition name part3 -ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part2, PARTITION part3); -ERROR HY000: Duplicate partition name part1 -DROP TABLE t1; -# 5.2 alter table add subpartition -# 5.2.1 Add one subpartition to a table with subpartitioning rule and -# no explicit defined subpartitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -(PARTITION part1 VALUES LESS THAN (100)); -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 100 - 1; -ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21)); -DROP TABLE t1; -DROP TABLE if exists t0_template; diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result index 72f036be099..94fefe77a77 100644 --- a/mysql-test/r/partition_hash.result +++ b/mysql-test/r/partition_hash.result @@ -1,4 +1,16 @@ drop table if exists t1; +CREATE TABLE t1 (c1 INT) +PARTITION BY HASH (c1) +PARTITIONS 15; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +ALTER TABLE t1 COALESCE PARTITION 13; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) +PARTITION BY LINEAR HASH (c1) +PARTITIONS 5; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +ALTER TABLE t1 COALESCE PARTITION 3; +DROP TABLE t1; create table t1 (a int unsigned) partition by hash(a div 2) partitions 4; diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index f80e0001ea8..5cbe34c94ca 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -1,3 +1,15 @@ +# Bug#32948 +CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB; +CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1), +FOREIGN KEY (c1) REFERENCES t1 (c1) +ON DELETE CASCADE) +ENGINE=INNODB; +ALTER TABLE t1 PARTITION BY HASH(c1) PARTITIONS 5; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +ALTER TABLE t1 ENGINE=MyISAM; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +DROP TABLE t2; +DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; show table status like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 9996471076c..a6b07bfc127 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1145,6 +1145,11 @@ a 13 DEALLOCATE PREPARE st1; DROP TABLE t1; +create table t1 (a int, b tinyint); +prepare st1 from 'update t1 set b= (str_to_date(a, a))'; +execute st1; +deallocate prepare st1; +drop table t1; End of 4.1 tests. create table t1 (a varchar(20)); insert into t1 values ('foo'); diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result index cd652c03f96..bf0f16a174f 100644 --- a/mysql-test/r/skip_grants.result +++ b/mysql-test/r/skip_grants.result @@ -77,3 +77,10 @@ ERROR HY000: Can't initialize function 'a'; UDFs are unavailable with the --skip DROP FUNCTION a; ERROR 42000: FUNCTION test.a does not exist End of 5.0 tests +# +# Bug#29817 Queries with UDF fail with non-descriptive error +# if mysql.proc is missing +# +select no_such_function(1); +ERROR 42000: FUNCTION test.no_such_function does not exist +End of 5.1 tests diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index db75044ee5d..c95b09597fc 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -8,6 +8,8 @@ VARIABLE_NAME VARIABLE_VALUE TABLE_LOCKS_IMMEDIATE 2 TABLE_LOCKS_WAITED 0 SET SQL_LOG_BIN=0; +set @old_general_log = @@global.general_log; +set global general_log = 'OFF'; drop table if exists t1; create table t1(n int) engine=myisam; insert into t1 values(1); @@ -20,6 +22,7 @@ show status like 'Table_locks_waited'; Variable_name Value Table_locks_waited 1 drop table t1; +set global general_log = @old_general_log; select 1; 1 1 diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 47ffc90e3cd..8b384dfdc4e 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1979,8 +1979,41 @@ a drop table table_25411_a; drop table table_25411_b; DROP TRIGGER IF EXISTS trg; -Warnings: -Note 1360 Trigger does not exist SHOW CREATE TRIGGER trg; ERROR HY000: Trigger does not exist +drop table if exists t1; +create table t1 (i int, j int); +create trigger t1_bi before insert on t1 for each row begin end; +create trigger t1_bi before insert on t1 for each row begin end; +ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table' +drop trigger t1_bi; +drop trigger t1_bi; +ERROR HY000: Trigger does not exist +lock tables t1 read; +create trigger t1_bi before insert on t1 for each row begin end; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +create trigger t1_bi before insert on t1 for each row begin end; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +drop trigger t1_bi; +ERROR HY000: Trigger does not exist +unlock tables; +create trigger t1_bi before insert on t1 for each row begin end; +lock tables t1 read; +create trigger t1_bi before insert on t1 for each row begin end; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +drop trigger t1_bi; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +unlock tables; +drop trigger t1_bi; +lock tables t1 write; +create trigger b1_bi before insert on t1 for each row set new.i = new.i + 10; +insert into t1 values (10, 10); +drop trigger b1_bi; +insert into t1 values (10, 10); +select * from t1; +i j +20 10 +10 10 +unlock tables; +drop table t1; End of 5.1 tests. diff --git a/mysql-test/r/trigger-grant.result b/mysql-test/r/trigger_notembedded.result index 14b8c98f2fa..d56f83993a6 100644 --- a/mysql-test/r/trigger-grant.result +++ b/mysql-test/r/trigger_notembedded.result @@ -448,3 +448,4 @@ DROP TABLE t1; DROP DATABASE mysqltest_db1; USE test; End of 5.0 tests. +End of 5.1 tests. diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 7d5dabf1929..5921991bf50 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -261,3 +261,10 @@ ERROR 22007: Incorrect date value: '1000-00-00' for column 'a' at row 1 SET SQL_MODE=DEFAULT; DROP TABLE t1,t2; End of 5.0 tests +create table t1 (a date, primary key (a))engine=memory; +insert into t1 values ('0000-01-01'), ('0000-00-01'), ('0001-01-01'); +select * from t1 where a between '0000-00-01' and '0000-00-02'; +a +0000-00-01 +drop table t1; +End of 5.1 tests diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 24be10a7a29..71be41b106f 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1509,6 +1509,26 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b; 1 1 DROP TABLE t1; +CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +Warnings: +Note 1265 Data truncated for column 'f1' at row 1 +DESC t1; +Field Type Null Key Default Extra +f1 decimal(31,30) NO 0.000000000000000000000000000000 +SELECT f1 FROM t1; +f1 +0.123456789012345678901234567890 +DROP TABLE t1; +CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1; +Warnings: +Warning 1264 Out of range value for column 'f1' at row 1 +DESC t1; +Field Type Null Key Default Extra +f1 decimal(59,30) NO 0.000000000000000000000000000000 +SELECT f1 FROM t1; +f1 +99999999999999999999999999999.999999999999999999999999999999 +DROP TABLE t1; End of 5.0 tests select cast(143.481 as decimal(4,1)); cast(143.481 as decimal(4,1)) diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 2988a13de41..2cd132ce03c 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -360,3 +360,14 @@ j 1 2 drop table t1; +create table t1(a int); +insert into t1 values(5),(4),(4),(3),(2),(2),(2),(1); +set @rownum := 0; +set @rank := 0; +set @prev_score := NULL; +select @rownum := @rownum + 1 as row, +@rank := IF(@prev_score!=a, @rownum, @rank) as rank, +@prev_score := a as score +from t1 order by score desc; +drop table t1; +End of 5.1 tests diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 60c3ff68e67..2971af7347d 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3617,4 +3617,47 @@ DROP TABLE `t-2`; DROP VIEW `v-2`; DROP DATABASE `d-1`; USE test; + +# +# Bug#26676: VIEW using old table schema in a session. +# + +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(c1 INT, c2 INT); +INSERT INTO t1 VALUES (1, 2), (3, 4); + +SELECT * FROM t1; +c1 c2 +1 2 +3 4 + +CREATE VIEW v1 AS SELECT * FROM t1; + +SELECT * FROM v1; +c1 c2 +1 2 +3 4 + +ALTER TABLE t1 ADD COLUMN c3 INT AFTER c2; + +SELECT * FROM t1; +c1 c2 c3 +1 2 NULL +3 4 NULL + +SELECT * FROM v1; +c1 c2 +1 2 +3 4 + +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c1` AS `c1`,`t1`.`c2` AS `c2` from `t1` latin1 latin1_swedish_ci + +DROP VIEW v1; +DROP TABLE t1; + +# End of test case for Bug#26676. + End of 5.1 tests. diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index d98173dbe15..56c884343e3 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1022,4 +1022,11 @@ NULL NULL NULL select updatexml(NULL, NULL, NULL); updatexml(NULL, NULL, NULL) NULL +CREATE TABLE t1(a INT NOT NULL); +INSERT INTO t1 VALUES (0), (0); +SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1')); +1 +1 +1 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/std_data/corrupt-relay-bin.000624 b/mysql-test/std_data/corrupt-relay-bin.000624 Binary files differnew file mode 100644 index 00000000000..21b4901211c --- /dev/null +++ b/mysql-test/std_data/corrupt-relay-bin.000624 diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result new file mode 100644 index 00000000000..7deffb86244 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -0,0 +1,56 @@ +set binlog_format=statement; +reset master; +create database testing_1; +use testing_1; +create table t1 (a int); +create function sf1 (a int) returns int return a+1; +create trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a); +create procedure sp1 (a int) insert into t1 values(a); +drop database testing_1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # create database testing_1 +master-bin.000001 # Query # # use `testing_1`; create table t1 (a int) +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` function sf1 (a int) returns int return a+1 +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a) +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` procedure sp1 (a int) insert into t1 values(a) +master-bin.000001 # Query # # drop database testing_1 +set binlog_format=mixed; +reset master; +create database testing_1; +use testing_1; +create table t1 (a int); +create function sf1 (a int) returns int return a+1; +create trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a); +create procedure sp1 (a int) insert into t1 values(a); +drop database testing_1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # create database testing_1 +master-bin.000001 # Query # # use `testing_1`; create table t1 (a int) +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` function sf1 (a int) returns int return a+1 +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a) +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` procedure sp1 (a int) insert into t1 values(a) +master-bin.000001 # Query # # drop database testing_1 +set binlog_format=row; +reset master; +create database testing_1; +use testing_1; +create table t1 (a int); +create function sf1 (a int) returns int return a+1; +create trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a); +create procedure sp1 (a int) insert into t1 values(a); +drop database testing_1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # create database testing_1 +master-bin.000001 # Query # # use `testing_1`; create table t1 (a int) +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` function sf1 (a int) returns int return a+1 +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a) +master-bin.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` procedure sp1 (a int) insert into t1 values(a) +master-bin.000001 # Query # # drop database testing_1 +show databases; +Database +information_schema +mysql +test diff --git a/mysql-test/suite/binlog/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result index ba4f38fb4c1..72fda535b6f 100644 --- a/mysql-test/suite/binlog/r/binlog_killed.result +++ b/mysql-test/suite/binlog/r/binlog_killed.result @@ -9,4 +9,135 @@ insert into t2 values (null, null), (null, get_lock("a", 10)); select @result /* must be zero either way */; @result 0 +select RELEASE_LOCK("a"); +RELEASE_LOCK("a") +1 +delete from t1; +delete from t2; +insert into t1 values (1,1),(2,2); +begin; +update t1 set b=11 where a=2; +begin; +update t1 set b=b+10; +kill query ID; +rollback; +rollback; +select * from t1 order by a /* must be the same as before (1,1),(2,2) */; +a b +1 1 +2 2 +begin; +delete from t1 where a=2; +begin; +delete from t1 where a=2; +kill query ID; +rollback; +rollback; +select * from t1 order by a /* must be the same as before (1,1),(2,2) */; +a b +1 1 +2 2 +drop table if exists t4; +create table t4 (a int, b int) engine=innodb; +insert into t4 values (3, 3); +begin; +insert into t1 values (3, 3); +begin; +insert into t1 select * from t4 for update; +kill query ID; +rollback; +rollback; +select * from t1 /* must be the same as before (1,1),(2,2) */; +a b +1 1 +2 2 +drop table t4; +create table t4 (a int, b int) ENGINE=MyISAM /* for killing update and delete */; +create function bug27563(n int) +RETURNS int(11) +DETERMINISTIC +begin +if @b > 0 then +select get_lock("a", 20) into @a; +else +set @b= 1; +end if; +return n; +end| +delete from t4; +insert into t4 values (1,1), (1,1); +reset master; +select get_lock("a", 20); +get_lock("a", 20) +1 +set @b= 0; +update t4 set b=b + bug27563(b); +select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock'; +count(*) +1 +kill query ID; +ERROR 70100: Query execution was interrupted +select * from t4 order by b /* must be (1,1), (1,2) */; +a b +1 1 +1 2 +select @b /* must be 1 at the end of a stmt calling bug27563() */; +@b +1 +must have the update query event more to FD +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # User var # # @`b`=0 +master-bin.000001 # Query # # use `test`; update t4 set b=b + bug27563(b) +select +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null +1 +select 0 /* must return 0 to mean the killed query is in */; +0 +0 +select RELEASE_LOCK("a"); +RELEASE_LOCK("a") +1 +delete from t4; +insert into t4 values (1,1), (2,2); +reset master; +select get_lock("a", 20); +get_lock("a", 20) +1 +set @b= 0; +delete from t4 where b=bug27563(1) or b=bug27563(2); +select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock'; +count(*) +1 +kill query ID; +ERROR 70100: Query execution was interrupted +select count(*) from t4 /* must be 1 */; +count(*) +1 +select @b /* must be 1 at the end of a stmt calling bug27563() */; +@b +1 +must have the delete query event more to FD +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # User var # # @`b`=0 +master-bin.000001 # Query # # use `test`; delete from t4 where b=bug27563(1) or b=bug27563(2) +select +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null +1 +select 0 /* must return 0 to mean the killed query is in */; +0 +0 +select RELEASE_LOCK("a"); +RELEASE_LOCK("a") +1 +drop table t4; +drop function bug27563; drop table t1,t2,t3; +end of the tests diff --git a/mysql-test/suite/binlog/r/binlog_killed_simulate.result b/mysql-test/suite/binlog/r/binlog_killed_simulate.result new file mode 100644 index 00000000000..f6a5ddade51 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_killed_simulate.result @@ -0,0 +1,33 @@ +drop table if exists t1,t2; +create table t1 (a int) engine=MyISAM; +insert into t1 set a=1; +reset master; +update t1 set a=2 /* will be "killed" after work has been done */; +select +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null +1 +select 1 /* must return 1 as query completed before got killed*/; +1 +1 +create table t2 (a int, b int) ENGINE=MyISAM; +reset master; +load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; +ERROR 70100: Query execution was interrupted +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12 +master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=1 +select +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null +1 +select 0 /* must return 0 to mean the killed query is in */; +0 +0 +drop table t1,t2; +end of the tests diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result index ef9f76b7d9c..655100203b5 100644 --- a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result +++ b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result @@ -2,6 +2,80 @@ drop table if exists t1; drop table if exists t2; drop table if exists t3; drop table if exists t4; +SET @test_character_set= 'cp932'; +SET @test_collation= 'cp932_japanese_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) cp932_japanese_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) cp932_japanese_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; set names cp932; set character_set_database = cp932; CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932; diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 6ac942176c7..f69d5717a1f 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -413,3 +413,236 @@ select @a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" 1 1 drop table t1, t2; +create temporary table tt (a int unique); +create table ti (a int) engine=innodb; +reset master; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 106 +begin; +insert into ti values (1); +insert into ti values (2) ; +insert into tt select * from ti; +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +select count(*) from tt /* 2 */; +count(*) +2 +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 395 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ti) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.ti) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from ti /* zero */; +count(*) +0 +insert into ti select * from tt; +select * from ti /* that is what slave would miss - bug#28960 */; +a +1 +2 +delete from ti; +delete from tt where a=1; +reset master; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 106 +begin; +insert into ti values (1); +insert into ti values (2) /* to make the dup error in the following */; +insert into tt select * from ti /* one affected and error */; +ERROR 23000: Duplicate entry '2' for key 'a' +rollback; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 106 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +select count(*) from ti /* zero */; +count(*) +0 +insert into ti select * from tt; +select * from tt /* that is what otherwise slave missed - the bug */; +a +1 +2 +drop table ti; +drop function if exists bug27417; +drop table if exists t1,t2; +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM; +CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a)); +create function bug27417(n int) +RETURNS int(11) +begin +insert into t1 values (null); +return n; +end| +reset master; +insert into t2 values (bug27417(1)); +insert into t2 select bug27417(2); +reset master; +insert into t2 values (bug27417(2)); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2)) +select count(*) from t1 /* must be 3 */; +count(*) +3 +reset master; +select count(*) from t2; +count(*) +2 +delete from t2 where a=bug27417(3); +select count(*) from t2 /* nothing got deleted */; +count(*) +2 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3) +select count(*) from t1 /* must be 5 */; +count(*) +5 +delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */; +affected rows: 0 +select count(*) from t1 /* must be 7 */; +count(*) +7 +drop table t1,t2; +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM; +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM; +CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb; +CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +insert into t2 values (1); +reset master; +insert into t2 values (bug27417(1)); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1)) +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 1 */; +count(*) +1 +delete from t1; +delete from t2; +insert into t2 values (2); +reset master; +insert into t2 select bug27417(1) union select bug27417(2); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=2 +master-bin.000001 # Query # # use `test`; insert into t2 select bug27417(1) union select bug27417(2) +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 2 */; +count(*) +2 +delete from t1; +insert into t3 values (1,1),(2,3),(3,4); +reset master; +update t3 set b=b+bug27417(1); +ERROR 23000: Duplicate entry '4' for key 'b' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1) +select count(*) from t1 /* must be 2 */; +count(*) +2 +delete from t3; +delete from t4; +insert into t3 values (1,1); +insert into t4 values (1,1),(2,2); +reset master; +UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=6 +master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */ +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 4 */; +count(*) +4 +delete from t1; +delete from t3; +delete from t4; +insert into t3 values (1,1),(2,2); +insert into t4 values (1,1),(2,2); +reset master; +UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +select count(*) from t1 /* must be 1 */; +count(*) +1 +drop table t4; +delete from t1; +delete from t2; +delete from t3; +insert into t2 values (1); +insert into t3 values (1,1); +create trigger trg_del before delete on t2 for each row +insert into t3 values (bug27417(1), 2); +reset master; +delete from t2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=9 +master-bin.000001 # Query # # use `test`; delete from t2 +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 1 */; +count(*) +1 +drop trigger trg_del; +delete from t1; +delete from t2; +delete from t5; +create trigger trg_del_t2 after delete on t2 for each row +insert into t1 values (1); +insert into t2 values (2),(3); +insert into t5 values (1),(2); +reset master; +delete t2.* from t2,t5 where t2.a=t5.a + 1; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1 +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 1 */; +count(*) +1 +delete from t1; +create table t4 (a int default 0, b int primary key) engine=innodb; +insert into t4 values (0, 17); +reset master; +load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); +ERROR 23000: Duplicate entry '17' for key 'PRIMARY' +select * from t4; +a b +0 17 +select count(*) from t1 /* must be 2 */; +count(*) +2 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=10 +master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12 +master-bin.000001 # Intvar # # INSERT_ID=10 +master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1 +master-bin.000001 # Query # # use `test`; ROLLBACK +drop trigger trg_del_t2; +drop table t1,t2,t3,t4,t5; +drop function bug27417; diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result index a1c83ffc73d..a79642a9204 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result +++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result @@ -124,6 +124,7 @@ master-bin.000001 # Query # # use `test`; replace into t1 select * from t3 drop table t1,t2,t3; CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; INSERT DELAYED INTO t1 VALUES(1); +ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines DROP TABLE t1; CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE; DELETE FROM t1 WHERE a=10; diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result index ef9f76b7d9c..655100203b5 100755 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result @@ -2,6 +2,80 @@ drop table if exists t1; drop table if exists t2; drop table if exists t3; drop table if exists t4; +SET @test_character_set= 'cp932'; +SET @test_collation= 'cp932_japanese_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) cp932_japanese_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) cp932_japanese_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; set names cp932; set character_set_database = cp932; CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 5ef36861c30..c15478bc826 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -380,7 +380,8 @@ select @a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" 1 1 drop table t1, t2; -create table tt (a int unique); +set @@session.binlog_format=statement; +create temporary table tt (a int unique); create table ti (a int) engine=innodb; reset master; show master status; @@ -399,18 +400,18 @@ count(*) show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 515 -show binlog events from 106; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into ti values (1) -master-bin.000001 # Query 1 # use `test`; insert into ti values (2) -master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti -master-bin.000001 # Query 1 # use `test`; ROLLBACK +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into ti values (1) +master-bin.000001 # Query # # use `test`; insert into ti values (2) +master-bin.000001 # Query # # use `test`; insert into tt select * from ti +master-bin.000001 # Query # # use `test`; ROLLBACK select count(*) from ti /* zero */; count(*) 0 insert into ti select * from tt; -select * from ti /* that is what slave would miss - a bug */; +select * from ti /* that is what slave would miss - bug#28960 */; a 1 2 @@ -431,13 +432,13 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 589 -show binlog events from 106; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; BEGIN -master-bin.000001 # Query 1 # use `test`; insert into ti values (1) -master-bin.000001 # Query 1 # use `test`; insert into ti values (2) /* to make the dup error in the following */ -master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti /* one affected and error */ -master-bin.000001 # Query 1 # use `test`; ROLLBACK +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; insert into ti values (1) +master-bin.000001 # Query # # use `test`; insert into ti values (2) /* to make the dup error in the following */ +master-bin.000001 # Query # # use `test`; insert into tt select * from ti /* one affected and error */ +master-bin.000001 # Query # # use `test`; ROLLBACK select count(*) from ti /* zero */; count(*) 0 @@ -446,7 +447,7 @@ select * from tt /* that is what otherwise slave missed - the bug */; a 1 2 -drop table ti,tt; +drop table ti; drop function if exists bug27417; drop table if exists t1,t2; CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM; @@ -463,6 +464,10 @@ insert into t2 select bug27417(2); reset master; insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=3 +master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2)) select count(*) from t1 /* must be 3 */; count(*) 3 @@ -474,6 +479,10 @@ delete from t2 where a=bug27417(3); select count(*) from t2 /* nothing got deleted */; count(*) 2 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3) select count(*) from t1 /* must be 5 */; count(*) 5 @@ -482,6 +491,134 @@ affected rows: 0 select count(*) from t1 /* must be 7 */; count(*) 7 -drop function bug27417; drop table t1,t2; +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM; +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM; +CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb; +CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +insert into t2 values (1); +reset master; +insert into t2 values (bug27417(1)); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1)) +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 1 */; +count(*) +1 +delete from t1; +delete from t2; +insert into t2 values (2); +reset master; +insert into t2 select bug27417(1) union select bug27417(2); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=2 +master-bin.000001 # Query # # use `test`; insert into t2 select bug27417(1) union select bug27417(2) +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 2 */; +count(*) +2 +delete from t1; +insert into t3 values (1,1),(2,3),(3,4); +reset master; +update t3 set b=b+bug27417(1); +ERROR 23000: Duplicate entry '4' for key 'b' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=4 +master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1) +select count(*) from t1 /* must be 2 */; +count(*) +2 +delete from t3; +delete from t4; +insert into t3 values (1,1); +insert into t4 values (1,1),(2,2); +reset master; +UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=6 +master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */ +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 4 */; +count(*) +4 +delete from t1; +delete from t3; +delete from t4; +insert into t3 values (1,1),(2,2); +insert into t4 values (1,1),(2,2); +reset master; +UPDATE t3,t4 SET t3.a=t4.a + bug27417(1); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +select count(*) from t1 /* must be 1 */; +count(*) +1 +drop table t4; +delete from t1; +delete from t2; +delete from t3; +insert into t2 values (1); +insert into t3 values (1,1); +create trigger trg_del before delete on t2 for each row +insert into t3 values (bug27417(1), 2); +reset master; +delete from t2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=9 +master-bin.000001 # Query # # use `test`; delete from t2 +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 1 */; +count(*) +1 +drop trigger trg_del; +delete from t1; +delete from t2; +delete from t5; +create trigger trg_del_t2 after delete on t2 for each row +insert into t1 values (1); +insert into t2 values (2),(3); +insert into t5 values (1),(2); +reset master; +delete t2.* from t2,t5 where t2.a=t5.a + 1; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1 +master-bin.000001 # Query # # use `test`; ROLLBACK +select count(*) from t1 /* must be 1 */; +count(*) +1 +delete from t1; +create table t4 (a int default 0, b int primary key) engine=innodb; +insert into t4 values (0, 17); +reset master; +load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); +ERROR 23000: Duplicate entry '17' for key 'PRIMARY' +select * from t4; +a b +0 17 +select count(*) from t1 /* must be 2 */; +count(*) +2 +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Intvar # # INSERT_ID=10 +master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12 +master-bin.000001 # Intvar # # INSERT_ID=10 +master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1 +master-bin.000001 # Query # # use `test`; ROLLBACK +drop trigger trg_del_t2; +drop table t1,t2,t3,t4,t5; +drop function bug27417; +set @@session.binlog_format=@@global.binlog_format; end of tests diff --git a/mysql-test/suite/binlog/t/binlog_database.test b/mysql-test/suite/binlog/t/binlog_database.test new file mode 100644 index 00000000000..ee236b4e5ea --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_database.test @@ -0,0 +1,12 @@ +# A wrapper to test that dropping a database is binlogged +# correctly. We test all three modes in the same file to avoid +# unecessary server restarts. + +set binlog_format=statement; +source extra/binlog_tests/database.test; +set binlog_format=mixed; +source extra/binlog_tests/database.test; +set binlog_format=row; +source extra/binlog_tests/database.test; + +show databases; diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test index 6c0b4b46a4e..e5f7288b17c 100644 --- a/mysql-test/suite/binlog/t/binlog_killed.test +++ b/mysql-test/suite/binlog/t/binlog_killed.test @@ -55,194 +55,277 @@ enable_result_log; select @result /* must be zero either way */; -# the functions are either *insensitive* to killing or killing can cause -# strange problmes with the error propagation out of SF's stack -# Bug#27563, Bug#27565, BUG#24971 -# -# TODO: use if's block as regression test for the bugs or remove -# -if (0) -{ -delimiter |; -create function bug27563() -RETURNS int(11) -DETERMINISTIC -begin - select get_lock("a", 10) into @a; - return 1; -end| -delimiter ;| -# the function is sensitive to killing requiring innodb though with wrong client error -# TO FIX in BUG#27565; TODO: remove --error 1105 afterwards -delimiter |; -create function bug27565() -RETURNS int(11) -DETERMINISTIC -begin - select a from t1 where a=1 into @a for update; - return 1; -end| -delimiter ;| +--remove_file $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog +connection con1; +select RELEASE_LOCK("a"); -reset master; +# +# bug#27571 asynchronous setting mysql_`query`::error and Query_log_e::error_code +# +# checking that killing inside of select loops is safe as before +# killing after the loop can be only simulated - another test -### ta table case: killing causes rollback +delete from t1; +delete from t2; +insert into t1 values (1,1),(2,2); -# A. autocommit ON +# +# simple update +# connection con1; -select get_lock("a", 20); +begin; update t1 set b=11 where a=2; connection con2; let $ID= `select connection_id()`; -send insert into t1 values (bug27563(),1); +begin; +send update t1 set b=b+10; connection con1; +--replace_result $ID ID eval kill query $ID; +rollback; + +# Bug #32148 killi query may be ineffective +# forced to comment out the test's outcome +# and mask out ineffective ER_QUERY_INTERRUPTED +# todo1: revert back upon fixing bug#32148 +# todo2: the tests need refining in that +# killing should wait till the victim requested +# its lock (wait_condition available in 5.1 tests) connection con2; -# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero ---enable_info -# todo: remove 0 return after fixing Bug#27563 --error 0,ER_QUERY_INTERRUPTED -reap; ### pb: wrong error ---disable_info -###--replace_column 2 # 5 # -### show binlog events from 98 /* nothing in binlog unless Bug#27563 */; -show master status /* must be only FD event unless Bug#27563 */; -select count(*) from t1 /* must be zero unless Bug#27563 */; - -# M. multi-statement-ta +reap; +rollback; +select * from t1 order by a /* must be the same as before (1,1),(2,2) */; + +# +# multi update +# commented out as Bug #31807 multi-update,delete killing does not report with ER_QUERY_INTERRUPTED +# in the way +# +# connection con1; +# begin; update t1 set b=b+10; + +# connection con2; +# send update t1 as t_1,t1 as t_2 set t_1.b=11 where t_2.a=2; + +# connection con1; +# --replace_result $ID ID +# eval kill query $ID; +# rollback; + +# disable_abort_on_error; + +# connection con2; +# --error HY000,ER_QUERY_INTERRUPTED +# reap; +# select * from t1 /* must be the same as before (1,1),(2,2) */; + +# enable_abort_on_error; +# +# simple delete +# +connection con1; +begin; delete from t1 where a=2; + connection con2; let $ID= `select connection_id()`; begin; -send insert into t1 values (bug27563(),1); +send delete from t1 where a=2; connection con1; +--replace_result $ID ID eval kill query $ID; +rollback; + connection con2; -# todo (re-record test): after bugs 27563,27565 got fixed affected rows will report zero ---enable_info -# todo: remove 0 return after fixing Bug#27563 --error 0,ER_QUERY_INTERRUPTED reap; ---disable_info -select count(*) from t1 /* must be zero unless Bug#27563 */; -commit; +rollback; +# todo1,2 above +select * from t1 order by a /* must be the same as before (1,1),(2,2) */; -### non-ta table case: killing must be recorded in binlog +# +# multi delete +# the same as for multi-update +# +# connection con1; +# begin; delete from t1 where a=2; -reset master; +# connection con2; +# send delete t1 from t1 where t1.a=2; + +# connection con1; +# --replace_result $ID ID +# eval kill query $ID; +# rollback; + +# connection con2; +# --error 0,ER_QUERY_INTERRUPTED +# reap; +# select * from t1 /* must be the same as before (1,1),(2,2) */; +# +# insert select +# +connection con1; +--disable_warnings +drop table if exists t4; +--enable_warnings +create table t4 (a int, b int) engine=innodb; +insert into t4 values (3, 3); +begin; insert into t1 values (3, 3); connection con2; let $ID= `select connection_id()`; -send insert into t2 values (bug27563(),1); +begin; +send insert into t1 select * from t4 for update; connection con1; +--replace_result $ID ID eval kill query $ID; +rollback; connection con2; -# todo: remove 0 return after fixing Bug#27563 --error 0,ER_QUERY_INTERRUPTED reap; -select count(*) from t2 /* must be one */; -#show binlog events from 98 /* must have the insert on non-ta table */; -show master status /* must have the insert event more to FD */; -# the value of the error flag of KILLED_QUERY is tested further +# todo 1,2 above +rollback; +select * from t1 /* must be the same as before (1,1),(2,2) */; -connection con1; -select RELEASE_LOCK("a"); +drop table t4; # cleanup for the sub-case -### test with effective killing of SF() +### +## non-ta table case: killing must be recorded in binlog +### +create table t4 (a int, b int) ENGINE=MyISAM /* for killing update and delete */; -delete from t1; -delete from t2; -insert into t1 values (1,1); -insert into t2 values (1,1); +delimiter |; +create function bug27563(n int) +RETURNS int(11) +DETERMINISTIC +begin + if @b > 0 then + select get_lock("a", 20) into @a; + else + set @b= 1; + end if; + return n; +end| +delimiter ;| + +# +# update +# -# -# Bug#27565 -# test where KILL is propagated as error to the top level -# still another bug with the error message to the user -# todo: fix reexecute the result file after fixing -# -begin; update t1 set b=0 where a=1; +delete from t4; +insert into t4 values (1,1), (1,1); +reset master; +connection con1; +select get_lock("a", 20); connection con2; let $ID= `select connection_id()`; -send update t2 set b=bug27565()-1 where a=1; +set @b= 0; +send update t4 set b=b + bug27563(b); connection con1; +let $wait_condition= select count(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock'; +source include/wait_condition.inc; +select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock'; + +--replace_result $ID ID eval kill query $ID; -commit; connection con2; -# todo: fix Bug #27565 killed query of SF() is not reported correctly and -# remove 1105 (wrong) -#--error ER_QUERY_INTERRUPTED ---error 1105,ER_QUERY_INTERRUPTED -reap; ### pb: wrong error -select * from t1 /* must be: (1,0) */; -select * from t2 /* must be as before: (1,1) */; +--error ER_QUERY_INTERRUPTED +reap; +select * from t4 order by b /* must be (1,1), (1,2) */; +select @b /* must be 1 at the end of a stmt calling bug27563() */; +--echo must have the update query event more to FD +source include/show_binlog_events.inc; -## bug#22725 with effective and propagating killing -# -# top-level ta-table +# a proof the query is binlogged with an error + +--exec $MYSQL_BINLOG --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select +(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`; +eval select $error_code /* must return 0 to mean the killed query is in */; + +# cleanup for the sub-case connection con1; -delete from t3; +select RELEASE_LOCK("a"); +--remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog + +# +# delete +# + +delete from t4; +insert into t4 values (1,1), (2,2); reset master; -begin; update t1 set b=0 where a=1; +connection con1; +select get_lock("a", 20); connection con2; let $ID= `select connection_id()`; -# the query won't perform completely since the function gets interrupted -send insert into t3 values (0,0),(1,bug27565()); +set @b= 0; +send delete from t4 where b=bug27563(1) or b=bug27563(2); connection con1; +let $wait_condition= select count(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock'; +source include/wait_condition.inc; +select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock'; +--replace_result $ID ID eval kill query $ID; -rollback; connection con2; -# todo: fix Bug #27565 killed query of SF() is not reported correctly and -# remove 1105 (wrong) -#--error ER_QUERY_INTERRUPTED ---error 1105,ER_QUERY_INTERRUPTED -reap; ### pb: wrong error -select count(*) from t3 /* must be zero */; -show master status /* nothing in binlog */; - -# top-level non-ta-table -connection con1; -delete from t2; -reset master; -begin; update t1 set b=0 where a=1; +--error ER_QUERY_INTERRUPTED +reap; +select count(*) from t4 /* must be 1 */; +select @b /* must be 1 at the end of a stmt calling bug27563() */; +--echo must have the delete query event more to FD +source include/show_binlog_events.inc; -connection con2; -let $ID= `select connection_id()`; -# the query won't perform completely since the function gets intrurrupted -send insert into t2 values (0,0),(1,bug27565()) /* non-ta t2 */; +# a proof the query is binlogged with an error + +--exec $MYSQL_BINLOG --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select +(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`; +eval select $error_code /* must return 0 to mean the killed query is in */; +# cleanup for the sub-case connection con1; -eval kill query $ID; -rollback; +select RELEASE_LOCK("a"); +--remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog -connection con2; -# todo: fix Bug #27565 killed query of SF() is not reported correctly and -# remove 1105 (wrong) -#--error ER_QUERY_INTERRUPTED ---error 1105,ER_QUERY_INTERRUPTED -reap; ### pb: wrong error +drop table t4; -select count(*) from t2 /* count must be one */; -show master status /* insert into non-ta must be in binlog */; +# +# load data - see simulation tests +# + + +# bug#27571 cleanup drop function bug27563; -drop function bug27565; -} -system rm $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ; + +# +# common cleanup +# drop table t1,t2,t3; +--echo end of the tests diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt b/mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt new file mode 100644 index 00000000000..90c70ecee29 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt @@ -0,0 +1 @@ +--loose-debug=d,simulate_kill_bug27571 diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test new file mode 100644 index 00000000000..2121a90dc8c --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test @@ -0,0 +1,69 @@ +-- source include/have_debug.inc +-- source include/have_binlog_format_mixed_or_statement.inc +# +# bug#27571 asynchronous setting mysql_$query()'s local error and +# Query_log_event::error_code +# + +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + +# +# Checking that killing upon successful row-loop does not affect binlogging +# + +create table t1 (a int) engine=MyISAM; +insert into t1 set a=1; +reset master; + +update t1 set a=2 /* will be "killed" after work has been done */; + +# a proof the query is binlogged with no error +#todo: introduce a suite private macro that provides numeric values +# for some constants like the offset of the first real event +# that is different between severs versions. +--exec $MYSQL_BINLOG --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select +(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`; +eval select $error_code /* must return 1 as query completed before got killed*/; + +# cleanup for the sub-case +system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog; + + +# +# Checking that killing inside of row-loop for LOAD DATA into +# non-transactional table affects binlogging +# + +create table t2 (a int, b int) ENGINE=MyISAM; +reset master; +--error ER_QUERY_INTERRUPTED +load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; + + +# a proof the query is binlogged with an error + +source include/show_binlog_events.inc; + +--exec $MYSQL_BINLOG --start-position=98 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select +(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) +is not null; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`; +eval select $error_code /* must return 0 to mean the killed query is in */; + +# cleanup for the sub-case +system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog; + + +drop table t1,t2; + +--echo end of the tests diff --git a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test index 7b7753a487e..3148cc50fd0 100644 --- a/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test +++ b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test @@ -31,3 +31,5 @@ eval select @a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", @a not like "%#%error_code=%error_code=%"; drop table t1, t2; + +-- source extra/binlog_tests/mix_innodb_myisam_side_effects.test diff --git a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test index 1815f3deb34..e7149e03b87 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test @@ -24,123 +24,9 @@ eval select drop table t1, t2; -# -# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack -# bug #28960 non-trans temp table changes with insert .. select -# not binlogged after rollback -# -# testing appearence of insert into temp_table in binlog. -# There are two branches of execution that require different setup. +set @@session.binlog_format=statement; +-- source extra/binlog_tests/mix_innodb_myisam_side_effects.test +set @@session.binlog_format=@@global.binlog_format; -## send_eof() branch - -# prepare - -create table tt (a int unique); -create table ti (a int) engine=innodb; -reset master; -show master status; - -# action - -begin; -insert into ti values (1); -insert into ti values (2) ; -insert into tt select * from ti; -rollback; - -# check - -select count(*) from tt /* 2 */; -show master status; ---replace_column 2 # 5 # -show binlog events from 106; -select count(*) from ti /* zero */; -insert into ti select * from tt; -select * from ti /* that is what slave would miss - a bug */; - - -## send_error() branch -delete from ti; -delete from tt where a=1; -reset master; -show master status; - -# action - -begin; -insert into ti values (1); -insert into ti values (2) /* to make the dup error in the following */; ---error ER_DUP_ENTRY -insert into tt select * from ti /* one affected and error */; -rollback; - -# check - -show master status; ---replace_column 2 # 5 # -show binlog events from 106; -select count(*) from ti /* zero */; -insert into ti select * from tt; -select * from tt /* that is what otherwise slave missed - the bug */; - -drop table ti,tt; - - -# -# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack -# -# Testing asserts: if there is a side effect of modifying non-transactional -# table thd->no_trans_update.stmt must be TRUE; -# the assert is active with debug build -# - ---disable_warnings -drop function if exists bug27417; -drop table if exists t1,t2; ---enable_warnings -# side effect table -CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM; -# target tables -CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a)); - -delimiter |; -create function bug27417(n int) -RETURNS int(11) -begin - insert into t1 values (null); - return n; -end| -delimiter ;| - -reset master; - -# execute - -insert into t2 values (bug27417(1)); -insert into t2 select bug27417(2); -reset master; - ---error ER_DUP_ENTRY -insert into t2 values (bug27417(2)); -#TODO: Andrei: enable this test after 23333 is pushed -#show master status; /* only (!) with fixes for #23333 will show there is the query */; -select count(*) from t1 /* must be 3 */; - -reset master; -select count(*) from t2; -delete from t2 where a=bug27417(3); -select count(*) from t2 /* nothing got deleted */; -#TODO: Andrei: enable this test after 23333 is pushed -#show master status; /* the query must be in regardless of #23333 */; -select count(*) from t1 /* must be 5 */; - ---enable_info -delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */; ---disable_info -select count(*) from t1 /* must be 7 */; - -drop function bug27417; -drop table t1,t2; --echo end of tests diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def index 888298bbb09..a6e73fa31d8 100644 --- a/mysql-test/suite/binlog/t/disabled.def +++ b/mysql-test/suite/binlog/t/disabled.def @@ -9,3 +9,4 @@ # Do not use any TAB characters for whitespace. # ############################################################################## +binlog_multi_engine : Bug#32663 binlog_multi_engine.test fails randomly diff --git a/mysql-test/suite/funcs_1/datadict/datadict_master.inc b/mysql-test/suite/funcs_1/datadict/datadict_master.inc index ee94f7cb318..73a23d6d377 100644 --- a/mysql-test/suite/funcs_1/datadict/datadict_master.inc +++ b/mysql-test/suite/funcs_1/datadict/datadict_master.inc @@ -199,7 +199,7 @@ select s.catalog_name, s.schema_name, s.default_character_set_name, --source suite/funcs_1/datadict/datadict_bug_12777.inc select * from columns; select * from character_sets; -select sum(id) from collations; +select sum(id) from collations where collation_name <> 'utf8_general_cs'; select collation_name, character_set_name into @x,@y from collation_character_set_applicability limit 1; select @x, @y; @@ -1660,13 +1660,14 @@ connect (u_6_401017, localhost, u_6_401017, , test); use information_schema; -select * from collation_character_set_applicability; +select * from collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; select * from schemata; select table_name from tables; --source suite/funcs_1/datadict/datadict_bug_12777.inc select table_name, column_name, column_type from columns; select character_set_name from character_sets; -select collation_name from collations; +select collation_name from collations where collation_name <> 'utf8_general_cs'; select routine_name, routine_type from routines; select table_name, index_name from statistics; select table_name from views; @@ -1926,7 +1927,7 @@ let $message= Testcase 3.2.3.2:; # the USAGE privilege. ################################################################################ -SELECT * FROM collations; +SELECT * FROM collations where collation_name <> 'utf8_general_cs'; # ------------------------------------------------------------------------------------------------------- let $message= Testcase 3.2.3.3:; @@ -1973,7 +1974,8 @@ let $message= Testcase 3.2.4.2:; # and update with expected results afterwards. ################################################################################ -SELECT * FROM collation_character_set_applicability; +SELECT * FROM collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; # ------------------------------------------------------------------------------------------------------- let $message= Testcase 3.2.4.3:; diff --git a/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc b/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc index 260119f030f..35060cefbf8 100644 --- a/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc +++ b/mysql-test/suite/funcs_1/datadict/datadict_show_schema.inc @@ -35,8 +35,9 @@ eval select table_name, index_schema, index_name, index_type where table_schema like '$dbname%'; --replace_result $SERVER_NAME <SERVER_NAME> +--sorted_result eval select * - from information_schema.user_privileges order by grantee, privilege_type; + from information_schema.user_privileges; # where grantee="'u_6_401013'@'%'"; eval select * diff --git a/mysql-test/suite/funcs_1/datadict/datadict_tables.inc b/mysql-test/suite/funcs_1/datadict/datadict_tables.inc index 14e39c083b0..9712f0a9c1c 100644 --- a/mysql-test/suite/funcs_1/datadict/datadict_tables.inc +++ b/mysql-test/suite/funcs_1/datadict/datadict_tables.inc @@ -28,8 +28,8 @@ eval $dd_part1 tables $dd_part2; --source suite/funcs_1/datadict/datadict_bug_12777.inc eval $dd_part1 columns $dd_part2; eval $dd_part1 character_sets $dd_part2; -eval $dd_part1 collations $dd_part2; -eval $dd_part1 collation_character_set_applicability $dd_part2; +eval $dd_part1 collations where collation_name <> 'utf8_general_cs' $dd_part2; +eval $dd_part1 collation_character_set_applicability where collation_name <> 'utf8_general_cs' $dd_part2; --replace_column 16 <Created> 17 <Last_Altered> eval $dd_part1 routines $dd_part2; eval $dd_part1 statistics $dd_part2; diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc index da2c2950095..62e5d95f875 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -94,14 +94,25 @@ connect (ddicttestuser1,localhost,ddicttestuser1,ddictpass,information_schema); --echo ----- switch to connection default (user = root) ----- connection default; # - We have now a second connection. -# - important values in second connection +# First working phase for this connection is "Connect". +# This is a very short phase and the likelihood to meet it is +# - nearly zero on average boxes with low parallel load +# - around some percent on weak or overloaded boxes +# (Bug#32153 Status output differs - scheduling ?) +# Therefore we poll till we reach the long lasting phase with: # - USER = ddicttestuser1 # - HOST = 'localhost' # - DB = 'information_schema' # - Command = 'Sleep' -# - TIME = 0, I hope the testing machines are all time fast enough +# - TIME >= 0 Overloaded boxes can cause that we do not hit TIME = 0. # - State IS NULL # - INFO must be empty +# +let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE COMMAND = 'Sleep' AND TIME > 0; +--source include/wait_condition.inc +# +# Expect to hit TIME = 1. --replace_column 1 <ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; # Change the SQL command (affects content of INFO) @@ -109,25 +120,19 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SHOW FULL PROCESSLIST; # --echo # Sleep some time -# The value of TIME must increase after some sleeps. -# So poll till TIME changes. -let $run= 10; -while ($run) -{ - dec $run; - if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = @my_proclist_id + 1 AND TIME > 0`) - { - let $run= 0; - } - --real_sleep 0.2 -} -# Either we have now reached TIME = 1 or we fail with unexpected result. -# Expect to see now TIME = 1 +# The value of TIME must increase and reach 2 after some sleeps. +let $wait_timeout= 2; +let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE TIME > 1; +--source include/wait_condition.inc +# +# Expect to hit TIME = 2. --replace_column 1 <ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; --replace_column 1 <ID> SHOW FULL PROCESSLIST; +# +# # The second connection must have an ID = my ID + 1; SELECT ID = @my_proclist_id + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'ddicttestuser1'; @@ -150,6 +155,12 @@ SHOW FULL PROCESSLIST; --echo --echo ----- establish connection con2 (user = ddicttestuser1) ------ connect (con2,localhost,ddicttestuser1,ddictpass,information_schema); +# +# If the testing box is under heavy load we might see connection ddicttestuser1 +# within the short phase INFO = 'SHOW FULL PROCESSLIST' and STATE = 'Writing to net'. +let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE COMMAND = 'Sleep'; +--source include/wait_condition.inc --replace_column 1 <ID> 6 <TIME> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; --replace_column 1 <ID> 6 <TIME> @@ -183,24 +194,17 @@ connection default; # - USER = ddicttestuser1 # - HOST = 'localhost' # - DB = 'information_schema' -# - Command = 'Query' +# - Command = 'Query'(run without --ps-protocol)/'Execute' (run --ps-protocol) # - TIME = 1, Attention: check with TIME = 0 is not stable # - State IS NULL # - INFO = "SELECT sleep(2.5),'Command time'" --echo # Sleep some time -# The command must be at some time in work by the server. +# The command must be after some time in work by the server. # So poll till INFO is no more NULL and TIME > 0. -let $run= 10; -while ($run) -{ - dec $run; - if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE INFO IS NOT NULL AND TIME > 0`) - { - let $run= 0; - } - --real_sleep 0.2 -} +let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE INFO IS NOT NULL AND TIME > 0; +--source include/wait_condition.inc +# # Expect to see TIME = 1 --replace_column 1 <ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; @@ -208,20 +212,13 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; SHOW FULL PROCESSLIST; # --echo # Sleep some time -# The value of TIME must increase after some sleeps therefore -# poll till TIME changes -let $run= 10; -while ($run) -{ - dec $run; - if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = @my_proclist_id + 1 AND TIME > 1`) - { - let $run= 0; - } - --real_sleep 0.2 -} -# Either we have now reached TIME = 2 or we fail with unexpected result. +# The value of TIME must increase and reach 2 after some sleeps. +let $wait_timeout= 2; +let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE TIME > 1; +--source include/wait_condition.inc +# +# Expect to see TIME = 2 --replace_column 1 <ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; --replace_column 1 <ID> @@ -248,19 +245,14 @@ send SELECT sleep(2),'BEGIN this is the representative of a very long statement. --echo ----- switch to connection default (user = root) ----- connection default; --echo # Sleep some time -# The command must be at some time in work by the server. -# So poll till INFO is no more NULL. -let $run= 10; -while ($run) -{ - dec $run; - if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE INFO IS NOT NULL`) - { - let $run= 0; - } - --real_sleep 0.2 -} +# The command must be after some time in work by the server. +# There is a short phase with STATE IS NULL followed by a longer phase +# with STATE = 'init'. +# So poll till INFO is no more NULL AND STATE = 'init'. +let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE INFO IS NOT NULL AND STATE = 'init'; +--source include/wait_condition.inc +# # Expect to see that SELECT/SHOW PROCESSLIST can handle my statement monster. --replace_column 1 <ID> 6 <TIME> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; @@ -295,19 +287,12 @@ send SELECT COUNT(*) FROM test.t1; --echo ----- switch to connection default (user = root) ----- connection default; --echo # Sleep some time -# The command must be at some time in work by the server. +# The command must be after some time in work by the server. # So poll till INFO is no more NULL. -let $run= 10; -while ($run) -{ - dec $run; - if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE INFO IS NOT NULL`) - { - let $run= 0; - } - --real_sleep 0.2 -} +let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE INFO IS NOT NULL AND STATE = 'Locked'; +--source include/wait_condition.inc +# # Expect to see the state 'Locked' for the second connection because the SELECT # collides with the WRITE TABLE LOCK. --replace_column 1 <ID> 6 <TIME> diff --git a/mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result index 9a7c9805b66..967c157f535 100644 --- a/mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result +++ b/mysql-test/suite/funcs_1/r/a_processlist_val_no_prot.result @@ -45,21 +45,21 @@ SELECT ID INTO @my_proclist_id FROM INFORMATION_SCHEMA.PROCESSLIST; ----- switch to connection default (user = root) ----- SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO -<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL <ID> root localhost information_schema Query 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST SHOW FULL PROCESSLIST; Id User Host db Command Time State Info <ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST -<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL # Sleep some time SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO -<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 2 NULL <ID> root localhost information_schema Query 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST SHOW FULL PROCESSLIST; Id User Host db Command Time State Info <ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST -<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 2 NULL SELECT ID = @my_proclist_id + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'ddicttestuser1'; ID = @my_proclist_id + 1 diff --git a/mysql-test/suite/funcs_1/r/b_processlist_val_ps.result b/mysql-test/suite/funcs_1/r/b_processlist_val_ps.result index db0a7750077..b4d8095125a 100644 --- a/mysql-test/suite/funcs_1/r/b_processlist_val_ps.result +++ b/mysql-test/suite/funcs_1/r/b_processlist_val_ps.result @@ -45,21 +45,21 @@ SELECT ID INTO @my_proclist_id FROM INFORMATION_SCHEMA.PROCESSLIST; ----- switch to connection default (user = root) ----- SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO -<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL <ID> root localhost information_schema Execute 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST SHOW FULL PROCESSLIST; Id User Host db Command Time State Info <ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST -<ID> ddicttestuser1 localhost information_schema Sleep 0 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL # Sleep some time SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO -<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 2 NULL <ID> root localhost information_schema Execute 0 preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST SHOW FULL PROCESSLIST; Id User Host db Command Time State Info <ID> root localhost information_schema Query 0 NULL SHOW FULL PROCESSLIST -<ID> ddicttestuser1 localhost information_schema Sleep 1 NULL +<ID> ddicttestuser1 localhost information_schema Sleep 2 NULL SELECT ID = @my_proclist_id + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'ddicttestuser1'; ID = @my_proclist_id + 1 diff --git a/mysql-test/suite/funcs_1/r/innodb__datadict.result b/mysql-test/suite/funcs_1/r/innodb__datadict.result index 5b500575f20..76e699614c8 100644 --- a/mysql-test/suite/funcs_1/r/innodb__datadict.result +++ b/mysql-test/suite/funcs_1/r/innodb__datadict.result @@ -3139,7 +3139,7 @@ binary binary Binary pseudo charset 1 geostd8 geostd8_general_ci GEOSTD8 Georgian 1 cp932 cp932_japanese_ci SJIS for Windows Japanese 2 eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3 -select sum(id) from collations; +select sum(id) from collations where collation_name <> 'utf8_general_cs'; sum(id) 10840 select collation_name, character_set_name into @x,@y @@ -3610,10 +3610,10 @@ NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 N SELECT * FROM character_sets LIMIT 1; CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN big5 big5_chinese_ci Big5 Traditional Chinese 2 -SELECT * FROM collations LIMIT 1; +SELECT * FROM collations where collation_name <> 'utf8_general_cs' LIMIT 1; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN big5_chinese_ci big5 1 Yes Yes 1 -SELECT * FROM collation_character_set_applicability LIMIT 1; +SELECT * FROM collation_character_set_applicability where collation_name <> 'utf8_general_cs' LIMIT 1; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 SELECT * FROM routines LIMIT 1; @@ -5596,10 +5596,10 @@ COUNT(*) SELECT COUNT(*) FROM information_schema. character_sets ; COUNT(*) 36 -SELECT COUNT(*) FROM information_schema. collations ; +SELECT COUNT(*) FROM information_schema. collations where collation_name <> 'utf8_general_cs' ; COUNT(*) 127 -SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ; +SELECT COUNT(*) FROM information_schema. collation_character_set_applicability where collation_name <> 'utf8_general_cs' ; COUNT(*) 128 SELECT COUNT(*) FROM information_schema. routines ; @@ -7354,7 +7354,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7505,7 +7505,7 @@ where table_schema like 'db_datadict%'; table_name index_schema index_name index_type res_t_401013 db_datadict i_6_401013 BTREE select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7642,7 +7642,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7791,7 +7791,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7936,7 +7936,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8094,7 +8094,7 @@ where table_schema like 'db_datadict%'; table_name index_schema index_name index_type res_t_401015 db_datadict i_6_401015 BTREE select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8230,7 +8230,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8480,7 +8480,8 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_ FLUSH PRIVILEGES; connect(localhost,u_6_401017,,test,MYSQL_PORT,MYSQL_SOCK); use information_schema; -select * from collation_character_set_applicability; +select * from collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 big5_bin big5 @@ -9262,7 +9263,7 @@ binary geostd8 cp932 eucjpms -select collation_name from collations; +select collation_name from collations where collation_name <> 'utf8_general_cs'; collation_name big5_chinese_ci big5_bin @@ -9627,7 +9628,7 @@ NULL information_schema collations SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NUL Testcase 3.2.3.2: -------------------------------------------------------------------------------- -SELECT * FROM collations; +SELECT * FROM collations where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN big5_chinese_ci big5 1 Yes Yes 1 big5_bin big5 84 Yes 1 @@ -9789,7 +9790,8 @@ NULL information_schema collation_character_set_applicability CHARACTER_SET_NAME Testcase 3.2.4.2: -------------------------------------------------------------------------------- -SELECT * FROM collation_character_set_applicability; +SELECT * FROM collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 big5_bin big5 diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index 275192365e8..b826f2a8449 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -9886,16 +9886,23 @@ f2 two SET sql_mode = 'traditional,ansi'; CREATE OR REPLACE VIEW v1 AS +SELECT f3 AS "pure column f3:", f1 + f3 AS "sum of columns f1 + f3 =", +3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1):", +'->' || CAST(f3 AS CHAR) || '<-' + AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR):" +FROM t1 WHERE f1 = 2; +CREATE OR REPLACE VIEW v1 AS SELECT f3 AS "pure column f3: ", f1 + f3 AS "sum of columns f1 + f3 = ", 3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1): ", '->' || CAST(f3 AS CHAR) || '<-' AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): " FROM t1 WHERE f1 = 2; +ERROR 42000: Incorrect column name 'pure column f3: ' SELECT * FROM v1; -pure column f3: 2.20000 -sum of columns f1 + f3 = 4.20000 -product of constants 3 * (- 0.11111E+1): -3.3333 -expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- +pure column f3: 2.20000 +sum of columns f1 + f3 = 4.20000 +product of constants 3 * (- 0.11111E+1): -3.3333 +expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- SET sql_mode = ''; Testcases 3.3.1.55 - 3.3.1.62 diff --git a/mysql-test/suite/funcs_1/r/memory__datadict.result b/mysql-test/suite/funcs_1/r/memory__datadict.result index ad3e8d862d5..0a7c7f20437 100644 --- a/mysql-test/suite/funcs_1/r/memory__datadict.result +++ b/mysql-test/suite/funcs_1/r/memory__datadict.result @@ -3122,7 +3122,7 @@ binary binary Binary pseudo charset 1 geostd8 geostd8_general_ci GEOSTD8 Georgian 1 cp932 cp932_japanese_ci SJIS for Windows Japanese 2 eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3 -select sum(id) from collations; +select sum(id) from collations where collation_name <> 'utf8_general_cs'; sum(id) 10840 select collation_name, character_set_name into @x,@y @@ -3593,10 +3593,10 @@ NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 N SELECT * FROM character_sets LIMIT 1; CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN big5 big5_chinese_ci Big5 Traditional Chinese 2 -SELECT * FROM collations LIMIT 1; +SELECT * FROM collations where collation_name <> 'utf8_general_cs' LIMIT 1; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN big5_chinese_ci big5 1 Yes Yes 1 -SELECT * FROM collation_character_set_applicability LIMIT 1; +SELECT * FROM collation_character_set_applicability where collation_name <> 'utf8_general_cs' LIMIT 1; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 SELECT * FROM routines LIMIT 1; @@ -5579,10 +5579,10 @@ COUNT(*) SELECT COUNT(*) FROM information_schema. character_sets ; COUNT(*) 36 -SELECT COUNT(*) FROM information_schema. collations ; +SELECT COUNT(*) FROM information_schema. collations where collation_name <> 'utf8_general_cs' ; COUNT(*) 127 -SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ; +SELECT COUNT(*) FROM information_schema. collation_character_set_applicability where collation_name <> 'utf8_general_cs' ; COUNT(*) 128 SELECT COUNT(*) FROM information_schema. routines ; @@ -7337,7 +7337,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7488,7 +7488,7 @@ where table_schema like 'db_datadict%'; table_name index_schema index_name index_type res_t_401013 db_datadict i_6_401013 HASH select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7625,7 +7625,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7774,7 +7774,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7919,7 +7919,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8077,7 +8077,7 @@ where table_schema like 'db_datadict%'; table_name index_schema index_name index_type res_t_401015 db_datadict i_6_401015 BTREE select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8213,7 +8213,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8463,7 +8463,8 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_ FLUSH PRIVILEGES; connect(localhost,u_6_401017,,test,MYSQL_PORT,MYSQL_SOCK); use information_schema; -select * from collation_character_set_applicability; +select * from collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 big5_bin big5 @@ -9230,7 +9231,7 @@ binary geostd8 cp932 eucjpms -select collation_name from collations; +select collation_name from collations where collation_name <> 'utf8_general_cs'; collation_name big5_chinese_ci big5_bin @@ -9595,7 +9596,7 @@ NULL information_schema collations SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NUL Testcase 3.2.3.2: -------------------------------------------------------------------------------- -SELECT * FROM collations; +SELECT * FROM collations where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN big5_chinese_ci big5 1 Yes Yes 1 big5_bin big5 84 Yes 1 @@ -9757,7 +9758,8 @@ NULL information_schema collation_character_set_applicability CHARACTER_SET_NAME Testcase 3.2.4.2: -------------------------------------------------------------------------------- -SELECT * FROM collation_character_set_applicability; +SELECT * FROM collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 big5_bin big5 diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index 2ec3c714e46..7d045e3412a 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -9891,16 +9891,23 @@ f2 two SET sql_mode = 'traditional,ansi'; CREATE OR REPLACE VIEW v1 AS +SELECT f3 AS "pure column f3:", f1 + f3 AS "sum of columns f1 + f3 =", +3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1):", +'->' || CAST(f3 AS CHAR) || '<-' + AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR):" +FROM t1 WHERE f1 = 2; +CREATE OR REPLACE VIEW v1 AS SELECT f3 AS "pure column f3: ", f1 + f3 AS "sum of columns f1 + f3 = ", 3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1): ", '->' || CAST(f3 AS CHAR) || '<-' AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): " FROM t1 WHERE f1 = 2; +ERROR 42000: Incorrect column name 'pure column f3: ' SELECT * FROM v1; -pure column f3: 2.20000 -sum of columns f1 + f3 = 4.20000 -product of constants 3 * (- 0.11111E+1): -3.3333 -expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- +pure column f3: 2.20000 +sum of columns f1 + f3 = 4.20000 +product of constants 3 * (- 0.11111E+1): -3.3333 +expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- SET sql_mode = ''; Testcases 3.3.1.55 - 3.3.1.62 diff --git a/mysql-test/suite/funcs_1/r/myisam__datadict.result b/mysql-test/suite/funcs_1/r/myisam__datadict.result index 5f11a18565c..29fcc8a378f 100644 --- a/mysql-test/suite/funcs_1/r/myisam__datadict.result +++ b/mysql-test/suite/funcs_1/r/myisam__datadict.result @@ -3192,7 +3192,7 @@ binary binary Binary pseudo charset 1 geostd8 geostd8_general_ci GEOSTD8 Georgian 1 cp932 cp932_japanese_ci SJIS for Windows Japanese 2 eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3 -select sum(id) from collations; +select sum(id) from collations where collation_name <> 'utf8_general_cs'; sum(id) 10840 select collation_name, character_set_name into @x,@y @@ -3663,10 +3663,10 @@ NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 N SELECT * FROM character_sets LIMIT 1; CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN big5 big5_chinese_ci Big5 Traditional Chinese 2 -SELECT * FROM collations LIMIT 1; +SELECT * FROM collations where collation_name <> 'utf8_general_cs' LIMIT 1; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN big5_chinese_ci big5 1 Yes Yes 1 -SELECT * FROM collation_character_set_applicability LIMIT 1; +SELECT * FROM collation_character_set_applicability where collation_name <> 'utf8_general_cs' LIMIT 1; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 SELECT * FROM routines LIMIT 1; @@ -5649,10 +5649,10 @@ COUNT(*) SELECT COUNT(*) FROM information_schema. character_sets ; COUNT(*) 36 -SELECT COUNT(*) FROM information_schema. collations ; +SELECT COUNT(*) FROM information_schema. collations where collation_name <> 'utf8_general_cs' ; COUNT(*) 127 -SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ; +SELECT COUNT(*) FROM information_schema. collation_character_set_applicability where collation_name <> 'utf8_general_cs' ; COUNT(*) 128 SELECT COUNT(*) FROM information_schema. routines ; @@ -7407,7 +7407,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7558,7 +7558,7 @@ where table_schema like 'db_datadict%'; table_name index_schema index_name index_type res_t_401013 db_datadict i_6_401013 BTREE select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7695,7 +7695,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7844,7 +7844,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -7989,7 +7989,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8147,7 +8147,7 @@ where table_schema like 'db_datadict%'; table_name index_schema index_name index_type res_t_401015 db_datadict i_6_401015 BTREE select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8283,7 +8283,7 @@ from information_schema.statistics where table_schema like 'db_datadict%'; table_name index_schema index_name index_type select * -from information_schema.user_privileges order by grantee, privilege_type; +from information_schema.user_privileges; GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE 'root'@'127.0.0.1' NULL ALTER YES 'root'@'127.0.0.1' NULL ALTER ROUTINE YES @@ -8533,7 +8533,8 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_ FLUSH PRIVILEGES; connect(localhost,u_6_401017,,test,MYSQL_PORT,MYSQL_SOCK); use information_schema; -select * from collation_character_set_applicability; +select * from collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 big5_bin big5 @@ -9332,7 +9333,7 @@ binary geostd8 cp932 eucjpms -select collation_name from collations; +select collation_name from collations where collation_name <> 'utf8_general_cs'; collation_name big5_chinese_ci big5_bin @@ -9697,7 +9698,7 @@ NULL information_schema collations SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NUL Testcase 3.2.3.2: -------------------------------------------------------------------------------- -SELECT * FROM collations; +SELECT * FROM collations where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN big5_chinese_ci big5 1 Yes Yes 1 big5_bin big5 84 Yes 1 @@ -9859,7 +9860,8 @@ NULL information_schema collation_character_set_applicability CHARACTER_SET_NAME Testcase 3.2.4.2: -------------------------------------------------------------------------------- -SELECT * FROM collation_character_set_applicability; +SELECT * FROM collation_character_set_applicability +where collation_name <> 'utf8_general_cs'; COLLATION_NAME CHARACTER_SET_NAME big5_chinese_ci big5 big5_bin big5 diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views.result index bba9238e685..3e494f53a2d 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views.result +++ b/mysql-test/suite/funcs_1/r/myisam_views.result @@ -9908,16 +9908,23 @@ f2 two SET sql_mode = 'traditional,ansi'; CREATE OR REPLACE VIEW v1 AS +SELECT f3 AS "pure column f3:", f1 + f3 AS "sum of columns f1 + f3 =", +3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1):", +'->' || CAST(f3 AS CHAR) || '<-' + AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR):" +FROM t1 WHERE f1 = 2; +CREATE OR REPLACE VIEW v1 AS SELECT f3 AS "pure column f3: ", f1 + f3 AS "sum of columns f1 + f3 = ", 3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1): ", '->' || CAST(f3 AS CHAR) || '<-' AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): " FROM t1 WHERE f1 = 2; +ERROR 42000: Incorrect column name 'pure column f3: ' SELECT * FROM v1; -pure column f3: 2.20000 -sum of columns f1 + f3 = 4.20000 -product of constants 3 * (- 0.11111E+1): -3.3333 -expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- +pure column f3: 2.20000 +sum of columns f1 + f3 = 4.20000 +product of constants 3 * (- 0.11111E+1): -3.3333 +expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- SET sql_mode = ''; Testcases 3.3.1.55 - 3.3.1.62 diff --git a/mysql-test/suite/funcs_1/r/ndb_cursors.result b/mysql-test/suite/funcs_1/r/ndb_cursors.result index 3a558ea7883..ac1eb46e974 100644 --- a/mysql-test/suite/funcs_1/r/ndb_cursors.result +++ b/mysql-test/suite/funcs_1/r/ndb_cursors.result @@ -75,7 +75,7 @@ Note 1265 Data truncated for column 'f45' at row 1 Note 1265 Data truncated for column 'f47' at row 1 Note 1265 Data truncated for column 'f49' at row 1 Note 1265 Data truncated for column 'f51' at row 1 -Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb1.txt' into table tb1 ; NOT YET IMPLEMENTED: cursor tests diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result index 7b1b3caf058..b67b0e2afe0 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result @@ -65,7 +65,7 @@ Warnings: Note 1265 Data truncated for column 'f150' at row 1 Note 1265 Data truncated for column 'f151' at row 1 Note 1265 Data truncated for column 'f152' at row 1 -Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ; Testcase: 3.5.1.1: diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03.result b/mysql-test/suite/funcs_1/r/ndb_trig_03.result index c0d2575bc38..fa86acedcb7 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_03.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_03.result @@ -65,7 +65,7 @@ Warnings: Note 1265 Data truncated for column 'f150' at row 1 Note 1265 Data truncated for column 'f151' at row 1 Note 1265 Data truncated for column 'f152' at row 1 -Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ; Testcase 3.5.3: diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result index 601e8fe7ce7..e21a2b312e4 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result @@ -65,7 +65,7 @@ Warnings: Note 1265 Data truncated for column 'f150' at row 1 Note 1265 Data truncated for column 'f151' at row 1 Note 1265 Data truncated for column 'f152' at row 1 -Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ; Testcase: 3.5: diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_08.result b/mysql-test/suite/funcs_1/r/ndb_trig_08.result index 1fefd964a40..63bb50c37eb 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_08.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_08.result @@ -65,7 +65,7 @@ Warnings: Note 1265 Data truncated for column 'f150' at row 1 Note 1265 Data truncated for column 'f151' at row 1 Note 1265 Data truncated for column 'f152' at row 1 -Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ; Testcase: 3.5: diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_09.result b/mysql-test/suite/funcs_1/r/ndb_trig_09.result index 9c9ceedd586..623036fa28f 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_09.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_09.result @@ -65,7 +65,7 @@ Warnings: Note 1265 Data truncated for column 'f150' at row 1 Note 1265 Data truncated for column 'f151' at row 1 Note 1265 Data truncated for column 'f152' at row 1 -Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ; Testcase 3.5.9.1/2: diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result index 1f48a72ea12..4d063ff2acf 100644 --- a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result +++ b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result @@ -65,7 +65,7 @@ Warnings: Note 1265 Data truncated for column 'f150' at row 1 Note 1265 Data truncated for column 'f151' at row 1 Note 1265 Data truncated for column 'f152' at row 1 -Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/ndb_tb3.txt' into table tb3 ; Testcase 3.5.10.1/2/3: diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result index 35193fa7a76..1f8b00a695b 100644 --- a/mysql-test/suite/funcs_1/r/ndb_views.result +++ b/mysql-test/suite/funcs_1/r/ndb_views.result @@ -9886,16 +9886,23 @@ f2 two SET sql_mode = 'traditional,ansi'; CREATE OR REPLACE VIEW v1 AS +SELECT f3 AS "pure column f3:", f1 + f3 AS "sum of columns f1 + f3 =", +3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1):", +'->' || CAST(f3 AS CHAR) || '<-' + AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR):" +FROM t1 WHERE f1 = 2; +CREATE OR REPLACE VIEW v1 AS SELECT f3 AS "pure column f3: ", f1 + f3 AS "sum of columns f1 + f3 = ", 3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1): ", '->' || CAST(f3 AS CHAR) || '<-' AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): " FROM t1 WHERE f1 = 2; +ERROR 42000: Incorrect column name 'pure column f3: ' SELECT * FROM v1; -pure column f3: 2.20000 -sum of columns f1 + f3 = 4.20000 -product of constants 3 * (- 0.11111E+1): -3.3333 -expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- +pure column f3: 2.20000 +sum of columns f1 + f3 = 4.20000 +product of constants 3 * (- 0.11111E+1): -3.3333 +expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<- SET sql_mode = ''; Testcases 3.3.1.55 - 3.3.1.62 diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc index e3917170812..6f07d4f38b3 100644 --- a/mysql-test/suite/funcs_1/views/views_master.inc +++ b/mysql-test/suite/funcs_1/views/views_master.inc @@ -2415,6 +2415,15 @@ SELECT * FROM v1; # 3.3.1.54 --vertical_results SET sql_mode = 'traditional,ansi'; +# due to bug#32496 "no trailing blanks in identifier". +CREATE OR REPLACE VIEW v1 AS +SELECT f3 AS "pure column f3:", f1 + f3 AS "sum of columns f1 + f3 =", + 3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1):", + '->' || CAST(f3 AS CHAR) || '<-' + AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR):" +FROM t1 WHERE f1 = 2; +# This error is not conformant with ansi (see bug#32496). hhunger +--error ER_WRONG_COLUMN_NAME CREATE OR REPLACE VIEW v1 AS SELECT f3 AS "pure column f3: ", f1 + f3 AS "sum of columns f1 + f3 = ", 3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1): ", diff --git a/mysql-test/suite/manual/r/rpl_replication_delay.result b/mysql-test/suite/manual/r/rpl_replication_delay.result new file mode 100644 index 00000000000..a8fa6ce8265 --- /dev/null +++ b/mysql-test/suite/manual/r/rpl_replication_delay.result @@ -0,0 +1,136 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +show slave status /* Second_behind reports 0 */;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port 9306 +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 106 +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 106 +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master 0 +Master_SSL_Verify_Server_Cert No +Last_IO_Errno 0 +Last_IO_Error +Last_SQL_Errno 0 +Last_SQL_Error +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +create table t1 (f1 int); +flush logs /* contaminate rli->last_master_timestamp */; +lock table t1 write; +insert into t1 values (1); +show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port 9306 +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 367 +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 279 +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master 9 +Master_SSL_Verify_Server_Cert No +Last_IO_Errno 0 +Last_IO_Error +Last_SQL_Errno 0 +Last_SQL_Error +unlock tables; +flush logs /* this time rli->last_master_timestamp is not affected */; +lock table t1 write; +insert into t1 values (2); +show slave status /* reports the correct diff with master query time about 3+3 secs */;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port 9306 +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 455 +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 367 +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master 7 +Master_SSL_Verify_Server_Cert No +Last_IO_Errno 0 +Last_IO_Error +Last_SQL_Errno 0 +Last_SQL_Error +unlock tables; +drop table t1; diff --git a/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt b/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt new file mode 100644 index 00000000000..24a4c5952fe --- /dev/null +++ b/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt @@ -0,0 +1 @@ +--loose-debug=d,let_first_flush_log_change_timestamp diff --git a/mysql-test/suite/manual/t/rpl_replication_delay.test b/mysql-test/suite/manual/t/rpl_replication_delay.test new file mode 100644 index 00000000000..8230698c8f9 --- /dev/null +++ b/mysql-test/suite/manual/t/rpl_replication_delay.test @@ -0,0 +1,71 @@ +# +# Testing replication delay reporting (bug#29309) +# there is an unavoidable non-determinism in the test +# please compare the results with the comments +# + + +source include/master-slave.inc; + +connection master; +#connection slave; +sync_slave_with_master; +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +--replace_column 1 # 8 # 9 # 23 # +--query_vertical show slave status /* Second_behind reports 0 */; +sleep 3; + +### bug emulation + +connection master; +drop table if exists t1; +create table t1 (f1 int); +sleep 3; + +#connection slave; +sync_slave_with_master; +flush logs /* contaminate rli->last_master_timestamp */; + +connection slave; +lock table t1 write; + +connection master; +insert into t1 values (1); + +sleep 3; + +connection slave; +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +--replace_column 1 # 8 # 9 # 23 # +--query_vertical show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */; +unlock tables; + +connection master; +sync_slave_with_master; + +### bugfix + + +connection slave; +flush logs /* this time rli->last_master_timestamp is not affected */; +lock table t1 write; + +connection master; +insert into t1 values (2); +sleep 3; + +connection slave; +--replace_result $DEFAULT_MASTER_PORT DEFAULT_MASTER_PORT +--replace_column 1 # 8 # 9 # 23 # +--query_vertical show slave status /* reports the correct diff with master query time about 3+3 secs */; +unlock tables; + +connection master; +drop table t1; + +#connection slave; +sync_slave_with_master; + + +# End of tests + diff --git a/mysql-test/suite/ndb/r/partition_03ndb.result b/mysql-test/suite/ndb/r/partition_03ndb.result deleted file mode 100644 index 28339cc7435..00000000000 --- a/mysql-test/suite/ndb/r/partition_03ndb.result +++ /dev/null @@ -1,1361 +0,0 @@ -SET SESSION storage_engine='NDB' ; -SET @max_row = 200; -SET AUTOCOMMIT= 1; -#------------------------------------------------------------------------ -# 0. Creation of an auxiliary table needed in all testcases -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t0_template; -CREATE TABLE t0_template ( f1 INTEGER, f2 char(20), PRIMARY KEY(f1)) -ENGINE = MEMORY; -# Logging of 200 INSERTs into t0_template suppressed -#------------------------------------------------------------------------ -# 1. Some syntax checks -#------------------------------------------------------------------------ -# 1.1 Subpartioned table without subpartitioning rule must be rejected -DROP TABLE IF EXISTS t1; -#------------------------------------------------------------------------ -# 2. Checks where the engine is set on all supported CREATE TABLE -# statement positions + basic operations on the tables -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t1; -# 2.1 table (non partitioned) for comparison -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'NDB' ; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.2 table with engine setting just after column list -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'NDB' -PARTITION BY HASH(f1) PARTITIONS 2; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) PARTITIONS 2 -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.3 table with engine setting in the named partition part -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) -( PARTITION part1 STORAGE ENGINE = 'NDB' , -PARTITION part2 STORAGE ENGINE = 'NDB' -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.4 table with engine setting in the named subpartition part -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart12 STORAGE ENGINE = 'NDB' ), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart22 STORAGE ENGINE = 'NDB' ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.5 Ugly "incomplete" storage engine assignments -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) -( PARTITION part1 STORAGE ENGINE = 'NDB' , -PARTITION part2 -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) -( PARTITION part1 , -PARTITION part2 STORAGE ENGINE = 'NDB' -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, -SUBPARTITION subpart12 STORAGE ENGINE = 'NDB' ), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart22 STORAGE ENGINE = 'NDB' ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart12 STORAGE ENGINE = 'NDB' ), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 , -SUBPARTITION subpart22 ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.6 Ugly "over determined" storage engine assignments -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'NDB' -PARTITION BY HASH(f1) -( PARTITION part1 STORAGE ENGINE = 'NDB' , -PARTITION part2 STORAGE ENGINE = 'NDB' -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'NDB' -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart12 STORAGE ENGINE = 'NDB' ), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart22 STORAGE ENGINE = 'NDB' ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) STORAGE ENGINE = 'NDB' -(SUBPARTITION subpart11 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart12 STORAGE ENGINE = 'NDB' ), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart22 STORAGE ENGINE = 'NDB' ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.7 Ugly storage engine assignments mixups -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) ENGINE = 'NDB' -(SUBPARTITION subpart11 , -SUBPARTITION subpart12 ), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart22 STORAGE ENGINE = 'NDB' ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11 STORAGE ENGINE = 'NDB' , -SUBPARTITION subpart12 STORAGE ENGINE = 'NDB' ), -PARTITION part2 VALUES LESS THAN (2000) ENGINE = 'NDB' -(SUBPARTITION subpart21 , -SUBPARTITION subpart22 ) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 2.8 Session default engine differs from engine used within create table -SET SESSION storage_engine='MEMORY'; -SET SESSION storage_engine='NDB' ; -#------------------------------------------------------------------------ -# 3. Check number of partitions and subpartitions -#------------------------------------------------------------------------ -DROP TABLE IF EXISTS t1; -# 3.1 (positive) without partition/subpartition number assignment -# 3.1.1 no partition number, no named partitions, no subpartitions mentioned -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 3.1.2 no partition number, named partitions, no subpartitions mentioned -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part2); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 3.1.3 variations on no partition/subpartition number, named partitions, -# different subpartitions are/are not named -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) (PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2000), PARTITION part3 VALUES LESS THAN (2147483647)) ; -DROP TABLE t1; -# FIXME several subtestcases of 3.1.3 disabled because of server crashes -# Bug#15407 Partitions: crash if subpartition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) (PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 , SUBPARTITION subpart22 )) ; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2000) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster), PARTITION part3 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -# 3.2 partition/subpartition numbers good and bad values and notations -DROP TABLE IF EXISTS t1; -# 3.2.1 partition/subpartition numbers INTEGER notation -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) PARTITIONS 2 -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 2 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (1000) , PARTITION part2 VALUES LESS THAN (2147483647) ) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 1; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) PARTITIONS 1 -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 1 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (1000) , PARTITION part2 VALUES LESS THAN (2147483647) ) -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 200; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -UPDATE t1 SET f1 = f1 + 200 -WHERE f1 BETWEEN 100 - 50 AND 100 + 50; -SELECT (COUNT(*) = 200) AND (MIN(f1) = 1) AND (MAX(f1) = 100 + 50 + 200 ) -AS my_value FROM t1; -my_value -1 -DELETE FROM t1 -WHERE f1 BETWEEN 100 - 50 + 200 AND 100 + 50 + 200; -SELECT (COUNT(*) = 200 - 50 - 50 - 1) AND (MIN(f1) = 1) AND (MAX(f1) = 200) -AS my_value FROM t1; -my_value -1 -INSERT INTO t1 SET f1 = 0 , f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 0 AND f2 = '#######'; -my_value -1 -INSERT INTO t1 SET f1 = 200 + 1, f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 1 AND f2 = '#######'; -my_value -1 -UPDATE t1 SET f1 = 200 + 2, f2 = 'ZZZZZZZ' - WHERE f1 = 0 AND f2 = '#######'; -SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -my_value -1 -DELETE FROM t1 WHERE f1 = 200 + 2 AND f2 = 'ZZZZZZZ'; -SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; -my_value -1 -TRUNCATE t1; -SELECT COUNT(*) = 0 AS my_value FROM t1; -my_value -1 -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 0; -ERROR HY000: Number of partitions = 0 is not an allowed value -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 0 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR HY000: Number of subpartitions = 0 is not an allowed value -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS -1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS -1 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 1000000; -ERROR HY000: Too many partitions were defined -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 1000000 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR HY000: Too many partitions were defined -# 3.2.4 partition/subpartition numbers STRING notation -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '2' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '2.0'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2.0'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '2.0' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2.0' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '0.2E+1'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0.2E+1'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '0.2E+1' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0.2E+1' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS T' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS '2A'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2A'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '2A' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2A' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN ' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 'A2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''A2'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 'A2' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''A2' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN ' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS ''; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS '' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 'GARBAGE'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''GARBAGE'' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 'GARBAGE' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''GARBAGE' -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS ' at line 3 -# 3.2.5 partition/subpartition numbers other notations -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2A; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2A' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS 2A -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2A -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS A2; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A2' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS A2 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A2 -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS GARBAGE; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GARBAGE' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS GARBAGE -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GARBAGE -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS TH' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "2"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "2" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "2A"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2A"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "2A" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2A" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN ' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "A2"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"A2"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "A2" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"A2" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN ' at line 3 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS "GARBAGE"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"GARBAGE"' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) SUBPARTITION BY HASH(f1) -SUBPARTITIONS "GARBAGE" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS THAN (2147483647)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"GARBAGE" -(PARTITION part1 VALUES LESS THAN (1000), PARTITION part2 VALUES LESS ' at line 3 -# 3.3 Mixups of number and names of partition/subpartition assigned -# 3.3.1 (positive) number of partition/subpartition = number of named partition/subpartition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2 ( PARTITION part1, PARTITION part2 ) ; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) -DROP TABLE t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) PARTITIONS 2 -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPARTITION subpart22) -); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f1` int(11) default NULL, - `f2` char(20) default NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483647) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) -DROP TABLE t1; -# 3.3.2 (positive) number of partition/subpartition , 0 (= no) named partition/subpartition -# already checked above -# 3.3.3 (negative) number of partitions > number of named partitions -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) PARTITIONS 2 ( PARTITION part1 ) ; -ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 2 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11 ), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPARTITION subpart22) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21, SUBPAR' at line 5 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2000) -(SUBPARTITION subpart21 ), -PARTITION part3 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart31, SUBPARTITION subpart32) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), -PARTITION part3 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart31, SUBPAR' at line 7 -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY RANGE(f1) PARTITIONS 2 -SUBPARTITION BY HASH(f1) SUBPARTITIONS 2 -( PARTITION part1 VALUES LESS THAN (1000) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483647) -(SUBPARTITION subpart21 ) -); -ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ') -)' at line 7 -#------------------------------------------------------------------------ -# 4. Checks of logical partition/subpartition name -# file name clashes during CREATE TABLE -#------------------------------------------------------------------------ -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1) (PARTITION part1, PARTITION part1); -ERROR HY000: Duplicate partition name part1 -#------------------------------------------------------------------------ -# 5. Alter table experiments -#------------------------------------------------------------------------ -# 5.1 alter table add partition -# 5.1.1 (negative) add partition to non partitioned table -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)); -# FIXME Why does the error numbers of MyISAM(1482) and NDB(1005) differ ? -ALTER TABLE t1 ADD PARTITION (PARTITION part1); -Got one of the listed errors -DROP TABLE t1; -# 5.1.2 Add one partition to a table with one partition -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) -PARTITION BY HASH(f1); -INSERT INTO t1 SELECT * FROM t0_template WHERE f1 BETWEEN 1 AND 100; diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index f876039a042..1752314ea47 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -12,7 +12,10 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms +ndb_binlog_basic : Bug #32759 2007-11-27 mats ndb_binlog_basic assert failure 'thd->transaction.stmt.modified_non_trans_table' # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open #ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events #ndb_binlog_discover : bug#21806 2006-08-24 +ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild +ndb_dd_backuprestore : Bug#32659 ndb_dd_backuprestore.test fails randomly diff --git a/mysql-test/suite/ndb/t/partition_03ndb.test b/mysql-test/suite/ndb/t/partition_03ndb.test deleted file mode 100644 index 3190ab9dfc7..00000000000 --- a/mysql-test/suite/ndb/t/partition_03ndb.test +++ /dev/null @@ -1,26 +0,0 @@ -############################################### -# # -# Partition tests NDB tables # -# # -############################################### - -# -# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE ! -# NON STORAGE SPECIFIC TESTCASES SHOULD BE ADDED IN -# THE SOURCED FIELS ONLY. -# - -# Storage engine to be tested -let $engine= 'NDB' ; --- source include/have_ndb.inc -eval SET SESSION storage_engine=$engine; - - -# Other storage engine <> storage engine to be tested -let $engine_other= 'MEMORY'; -# number of rows for the INSERT/UPDATE/DELETE/SELECT experiments -# on partioned tables -# Attention: In the moment the result files fit to @max_row = 200 only -SET @max_row = 200; - --- source include/partition_1.inc diff --git a/mysql-test/suite/parts/inc/methods1.inc b/mysql-test/suite/parts/inc/methods1.inc index 24006b6e0f1..d986b67a456 100644 --- a/mysql-test/suite/parts/inc/methods1.inc +++ b/mysql-test/suite/parts/inc/methods1.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_methods1.inc # +# inc/partition_methods1.inc # # # # Purpose: # # Create and check partitioned tables # @@ -11,7 +11,7 @@ # do # # 1. Create the partitioned table # # 2 Insert the content of the table t0_template into t1 # -# 3. Execute include/partition_check.inc # +# 3. Execute inc/partition_check.inc # # 4. Drop the table t1 # # done # # # @@ -21,14 +21,14 @@ # has to be set before sourcing this routine. # # Example: # # let $unique= , UNIQUE INDEX uidx1 (f_int1); # -# include/partition_method1s.inc # +# inc/partition_method1s.inc # # # -# Attention: The routine include/partition_methods2.inc is very similar # +# Attention: The routine inc/partition_methods2.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -52,7 +52,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY KEY @@ -67,7 +66,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY LIST @@ -90,7 +88,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY RANGE @@ -114,7 +111,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH @@ -137,7 +133,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY @@ -163,7 +158,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY LIST -- SUBPARTITION BY HASH @@ -186,7 +180,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY LIST -- SUBPARTITION BY KEY @@ -209,5 +202,4 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; diff --git a/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc index cba5c47f01b..1a66a26312a 100644 --- a/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc +++ b/mysql-test/suite/parts/inc/part_blocked_sql_funcs_main.inc @@ -21,253 +21,207 @@ let $sqlfunc = ascii(col1); let $valsqlfunc = ascii('a'); let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = ord(col1); let $valsqlfunc = ord('a'); let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = greatest(col1,15); let $valsqlfunc = greatest(1,15); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = isnull(col1); let $valsqlfunc = isnull(15); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = least(col1,15); let $valsqlfunc = least(15,30); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = case when col1>15 then 20 else 10 end; let $valsqlfunc = case when 1>30 then 20 else 15 end; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = ifnull(col1,30); let $valsqlfunc = ifnull(1,30); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = nullif(col1,30); let $valsqlfunc = nullif(1,30); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = bit_length(col1); let $valsqlfunc = bit_length(255); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = char_length(col1); let $valsqlfunc = char_length('a'); #let $coltype = int; #--source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = character_length(col1); let $valsqlfunc = character_length('a'); let $coltype = char(30) --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = find_in_set(col1,'1,2,3,4,5,6,7,8,9'); let $valsqlfunc = find_in_set('i','a,b,c,d,e,f,g,h,i'); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = instr(col1,'acb'); let $valsqlfunc = instr('i','a,b,c,d,e,f,g,h,i'); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = length(col1); let $valsqlfunc = length('a,b,c,d,e,f,g,h,i'); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = locate('a',col1); let $valsqlfunc = locate('i','a,b,c,d,e,f,g,h,i'); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = octet_length(col1); let $valsqlfunc = octet_length('a,b,c,d,e,f,g,h,i'); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = position('a' in col1); let $valsqlfunc = position('i' in 'a,b,c,d,e,f,g,h,i'); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = strcmp(col1,'acb'); let $valsqlfunc = strcmp('i','a,b,c,d,e,f,g,h,i'); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = crc32(col1); let $valsqlfunc = crc32('a,b,c,d,e,f,g,h,i'); let $coltype = char(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = round(col1); let $valsqlfunc = round(15); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = sign(col1); let $valsqlfunc = sign(123); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = period_add(col1,5); let $valsqlfunc = period_add(9804,5); let $coltype = datetime; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = period_diff(col1,col2); let $valsqlfunc = period_diff(9809,199907); let $coltype = datetime,col2 datetime; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $coltype = int,col2 int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = timestampdiff(day,5,col1); let $valsqlfunc = timestampdiff(YEAR,'2002-05-01','2001-01-01'); let $coltype = datetime; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = unix_timestamp(col1); let $valsqlfunc = unix_timestamp ('2002-05-01'); let $coltype = date; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = week(col1); let $valsqlfunc = week('2002-05-01'); let $coltype = datetime; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = weekofyear(col1); let $valsqlfunc = weekofyear('2002-05-01'); let $coltype = datetime; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = cast(col1 as signed); let $valsqlfunc = cast(123 as signed); let $coltype = varchar(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = convert(col1,unsigned); let $valsqlfunc = convert(123,unsigned); let $coltype = varchar(30); --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = col1 | 20; let $valsqlfunc = 10 | 20; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = col1 & 20; let $valsqlfunc = 10 & 20; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = col1 ^ 20; let $valsqlfunc = 10 ^ 20; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = col1 << 20; let $valsqlfunc = 10 << 20; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = col1 >> 20; let $valsqlfunc = 10 >> 20; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = ~col1; let $valsqlfunc = ~20; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = bit_count(col1); let $valsqlfunc = bit_count(20); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc let $sqlfunc = inet_aton(col1); let $valsqlfunc = inet_aton('192.168.1.1'); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc set @var =20; let $sqlfunc = bit_length(col1)+@var-@var; let $valsqlfunc = bit_length(20)+@var-@var; let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc delimiter //; @@ -298,5 +252,4 @@ let $sqlfunc = getmaxsigned_t1(col1); let $valsqlfunc = getmaxsigned(10); let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc -# --source include/partition_blocked_sql_funcs.inc drop function if exists getmaxsigned_t1; diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc index c0769cdeef1..3a486619b0b 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc @@ -1,5 +1,6 @@ ################################################################################ -# t/part_supported_sql_funcs_delete.inc # # # +# t/part_supported_sql_funcs_delete.inc # +# # # Purpose: # # Delete access of the tests frame for allowed sql functions # # # diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc index 4761d15c6d3..25a9774d2a1 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc @@ -38,7 +38,6 @@ let $val2 = 13 ; let $val3 = 17 ; let $val4 = 15 ; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = ceiling(col1); @@ -51,7 +50,6 @@ let $val3 = 17.987; let $val4 = 15.654 ; # DISABLED due to bug 30577 #--source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = floor(col1); let $valsqlfunc = floor(15.123); @@ -63,7 +61,6 @@ let $val3 = 17.987; let $val4 = 15.654 ; # DISABLED due to bug 30577 #--source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = mod(col1,10); let $valsqlfunc = mod(15,10); @@ -74,7 +71,6 @@ let $val2 = 19; let $val3 = 17; let $val4 = 15 ; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = day(col1); let $valsqlfunc = day('2006-12-21'); @@ -85,7 +81,6 @@ let $val2 = '2006-01-17'; let $val3 = '2006-01-25'; let $val4 = '2006-02-05'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = dayofmonth(col1); let $valsqlfunc = dayofmonth('2006-12-24'); @@ -96,7 +91,6 @@ let $val2 = '2006-01-17'; let $val3 = '2006-01-25'; let $val4 = '2006-02-05'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = dayofweek(col1); let $valsqlfunc = dayofweek('2006-12-24'); @@ -107,7 +101,6 @@ let $val2 = '2006-02-17'; let $val3 = '2006-01-25'; let $val4 = '2006-02-05'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = dayofyear(col1); let $valsqlfunc = dayofyear('2006-12-25'); @@ -118,10 +111,8 @@ let $val2 = '2006-01-17'; let $val3 = '2006-02-25'; let $val4 = '2006-02-05'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = extract(month from col1); let $valsqlfunc = extract(year from '1998-11-23'); @@ -132,7 +123,6 @@ let $val2 = '2006-02-17'; let $val3 = '2006-01-25'; let $val4 = '2006-02-05'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = hour(col1); let $valsqlfunc = hour('18:30'); @@ -143,7 +133,6 @@ let $val2 = '14:30'; let $val3 = '21:59'; let $val4 = '10:30'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = microsecond(col1); let $valsqlfunc = microsecond('10:30:10.000010'); @@ -154,7 +143,6 @@ let $val2 = '04:30:01.000018'; let $val3 = '00:59:22.000024'; let $val4 = '05:30:34.000037'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = minute(col1); let $valsqlfunc = minute('18:30'); @@ -164,7 +152,6 @@ let $val2 = '14:30:45'; let $val3 = '21:59:22'; let $val4 = '10:24:23'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = second(col1); let $valsqlfunc = second('18:30:14'); @@ -175,10 +162,8 @@ let $val2 = '14:30:20'; let $val3 = '21:59:22'; let $val4 = '10:22:33'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $coltype = char(30); --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = month(col1); let $valsqlfunc = month('2006-10-14'); @@ -189,7 +174,6 @@ let $val2 = '2006-12-17'; let $val3 = '2006-05-25'; let $val4 = '2006-11-06'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = quarter(col1); let $valsqlfunc = quarter('2006-10-14'); @@ -200,7 +184,6 @@ let $val2 = '2006-12-17'; let $val3 = '2006-09-25'; let $val4 = '2006-07-30'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = time_to_sec(col1)-(time_to_sec(col1)-20); let $valsqlfunc = time_to_sec('18:30:14')-(time_to_sec('17:59:59')); @@ -211,7 +194,6 @@ let $val2 = '14:30:45'; let $val3 = '21:59:22'; let $val4 = '10:33:11'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = to_days(col1)-to_days('2006-01-01'); let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01'); @@ -222,7 +204,6 @@ let $val2 = '2006-01-17'; let $val3 = '2006-01-25'; let $val4 = '2006-02-06'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc # DATEDIFF() is implemented as (TO_DAYS(d1) - TO_DAYS(d2)) let $sqlfunc = datediff(col1, '2006-01-01'); @@ -234,7 +215,6 @@ let $val2 = '2006-01-17'; let $val3 = '2006-01-25'; let $val4 = '2006-02-06'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = weekday(col1); let $valsqlfunc = weekday('2006-10-14'); @@ -245,7 +225,6 @@ let $val2 = '2006-11-17'; let $val3 = '2006-05-25'; let $val4 = '2006-02-06'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = year(col1)-1990; let $valsqlfunc = year('2005-10-14')-1990; @@ -256,7 +235,6 @@ let $val2 = '2000-02-17'; let $val3 = '2004-05-25'; let $val4 = '2002-02-15'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc let $sqlfunc = yearweek(col1)-200600; let $valsqlfunc = yearweek('2006-10-14')-200600; @@ -267,4 +245,3 @@ let $val2 = '2006-08-17'; let $val3 = '2006-03-25'; let $val4 = '2006-11-15'; --source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc diff --git a/mysql-test/suite/parts/inc/partition.pre b/mysql-test/suite/parts/inc/partition.pre index ade4a1592be..0c906ce4581 100644 --- a/mysql-test/suite/parts/inc/partition.pre +++ b/mysql-test/suite/parts/inc/partition.pre @@ -1,5 +1,5 @@ ################################################################################ -# include/partition.pre # +# inc/partition.pre # # # # Purpose: # # Auxiliary script creating prerequisites needed by the partitioning tests # @@ -26,27 +26,21 @@ eval SET @@session.storage_engine = $engine; ##### Disabled/affected testcases, because of open bugs ##### ---echo ---echo #------------------------------------------------------------------------ ---echo # There are several testcases disabled because of the open bugs ---echo # #15890 -if (`SELECT @@session.storage_engine IN('ndbcluster')`) -{ ---echo # #18730, Bug#18735 -} ---echo #------------------------------------------------------------------------ -# Attention: Only bugs appearing in all storage engines should be mentioned above. -# The top level test wrapper (example: t/partition_basic_ndb.test) -# may set the $fixed_bug<nnnnn> variable to 0 after sourcing -# this file. -# Bug#15890 Partitions: Strange interpretation of partition number -let $fixed_bug15890= 0; -# Bug#18730: Partitions: NDB, crash on SELECT MIN(<unique column>) -# Attention: NDB testcases set this variable later to 0 -let $fixed_bug18730= 1; -# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response -# Attention: NDB testcases set this variable later to 0 -let $fixed_bug18735= 1; +# --echo +# --echo #------------------------------------------------------------------------ +# --echo # There are several testcases disabled because of the open bugs +# if (`SELECT @@session.storage_engine IN('ndbcluster')`) +# { +# --echo # #18730 +# } +# --echo #------------------------------------------------------------------------ +# # Attention: Only bugs appearing in all storage engines should be mentioned above. +# # The top level test wrapper (example: t/partition_basic_ndb.test) +# # may set the $fixed_bug<nnnnn> variable to 0 after sourcing +# # this file. +# # Bug#18730: Partitions: NDB, crash on SELECT MIN(<unique column>) +# # Attention: NDB testcases set this variable later to 0 +# let $fixed_bug18730= 1; --echo --echo #------------------------------------------------------------------------ @@ -66,6 +60,17 @@ if ($debug) --echo # It is to be expected, that we get huge differences. } +let $ER_DUP_KEY= 1022; +let $ER_GET_ERRNO= 1030; +let $ER_BAD_NULL_ERROR= 1048; +let $ER_DUP_ENTRY= 1062; +let $ER_PARSE_ERROR= 1064; +let $ER_TOO_MANY_PARTITIONS_ERROR= 1499; +let $ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF= 1503; +let $ER_NO_PARTS_ERROR= 1504; +let $ER_DROP_PARTITION_NON_EXISTENT= 1507; +let $ER_SAME_NAME_PARTITION= 1517; +let $ER_NO_PARTITION_FOR_GIVEN_VALUE= 1526; # Set the variable $engine_other to a storage engine <> $engine --disable_query_log @@ -308,23 +313,23 @@ if (0) # (t/partition_<feature>_<engine>.test) # a) General not engine specific settings and requirements # $debug, $ls, @max_row, $more_trigger_tests, ..... -# --source include/have_partition.inc +# --source inc/have_partition.inc # b) Engine specific settings and requirements # $do_pk_tests, $MAX_VALUE, $engine # SET SESSION storage_engine # $engine_other # c) Generate the prerequisites ($variables, @variables, tables) needed # via -# --source include/partition.pre +# --source inc/partition.pre # d) Set "fixed_bug<number>" variables to 1 if there are open engine # specific bugs which need worarounds. # e) Execute the feature specific testscript via -# --source include/partition_<feature>.inc +# --source inc/partition_<feature>.inc # f) Perform a cleanup by removing all objects created within the tests -# --source include/partition_cleanup.inc +# --source inc/partition_cleanup.inc # # 2.2. script generating the prerequisites needed in all tests -# (include/partition.pre) +# (inc/partition.pre) # a) Message about open bugs causing that # - some testcases are disabled # - it cannot be avoided that the file with expected results suffers @@ -340,36 +345,70 @@ if (0) # c) Setting of auxiliary variables # d) Creation of auxiliary tables .... # -# 3. script checking a feature -# (include/partition_<feature.inc>.inc) -# Example: -# a) "set/compute" a CREATE TABLE t1 .. and an ALTER TABLE ... statement -# b) CREATE TABLE t1 ... -# c) INSERT INTO t1 (.....) SELECT .... FROM t0_template WHERE ... -# The first 50 % of all t0_template rows will be inserted into t1. -# d) ALTER TABLE t1 (Example: ADD/DROP UNIQUE INDEX) -# e) INSERT INTO t1 (.....) SELECT .... FROM t0_template WHERE ... -# The second 50 % of all t0_template rows will be inserted into t1. -# Now t1 and t0_template should have the same content. -# f) Check the "usability" of the current table t1 -# via -# --source include/partition_check.pre -# g) DROP TABLE t1 -# Switch to other CREATE and ALTER statements and run sequence a)-g) again -# ... +# 2.3. script checking a feature +# (inc/partition_<feature.inc>.inc) +# Example: +# a) "set/compute" a CREATE TABLE t1 .. and an ALTER TABLE ... statement +# b) CREATE TABLE t1 ... +# c) INSERT INTO t1 (.....) SELECT .... FROM t0_template WHERE ... +# The first 50 % of all t0_template rows will be inserted into t1. +# d) ALTER TABLE t1 (Example: ADD/DROP UNIQUE INDEX) +# e) INSERT INTO t1 (.....) SELECT .... FROM t0_template WHERE ... +# The second 50 % of all t0_template rows will be inserted into t1. +# Now t1 and t0_template should have the same content. +# f) Check the "usability" of the current table t1 +# via +# --source inc/partition_check.pre +# g) DROP TABLE t1 +# Switch to other CREATE and ALTER statements and run sequence a)-g) again +# ... +# +# 2.4. script checking if a certain table shows the expected behaviour +# ("usability" check): inc/partition_check.inc +# - SELECT/INSERT/UPDATE/DELETE affecting single and multiple records +# - check of values of special interest like NULL etc. +# - INSERT/UPDATE with BEFORE/AFTER triggers +# - violations of UNIQUE constraints, if there are any defined +# - transactions ... +# - TRUNCATE/OPTIMIZE/.. +# - ... +# +# +# 2.5. There are some auxiliary scripts with sub tests where we cannot predict +# if we get an error and if we get one, which one. +# Example: INSERT a record where the value for a certain column equals +# some existing record. +# Depending on existing/not existing PRIMARY KEYs, UNIQUE INDEXes +# the response might be "no error", ER_DUP_KEY, ER_DUP_ENTRY. +# Our requirements: +# 1. We cannot abort whenever get an error message from the server. +# 2. We want the exact server message into the protocol. +# 3. We want abort testing if we know that a certain error must not happen. +# Common but unusable Solutions: +# a) --error 0, ER_DUP_KEY, ER_DUP_ENTRY +# <statment> +# We get no error message even if the statement fails. +# b) --error ER_DUP_KEY, ER_DUP_ENTRY +# <statment> +# We might get "got one of the expected errors". +# There are situations where the statement must be successful. +# c) --disable_abort_on_error +# <statment> +# --enable_abort_on_error +# And nothing extra +# We do not abort in case of unexpected server errors. +# +# Final solution: +# --disable_abort_on_error +# <statment> +# --enable_abort_on_error +# Check via error number if the error is not totally unexpected. +# The sub tests use $ER_DUP_KEY, $ER_DUP_ENTRY, etc. +# Assignment of values happen in this file. # -# 4. script checking if a certain table shows the expected behaviour -# ("usability" check): include/partition_check.inc -# - SELECT/INSERT/UPDATE/DELETE affecting single and multiple records -# - check of values of special interest like NULL etc. -# - INSERT/UPDATE with BEFORE/AFTER triggers -# - violations of UNIQUE constraints, if there are any defined -# - transactions ... -# - TRUNCATE/OPTIMIZE/.. -# - ... # # 3. How to analyze a partitioning bug revealed with these tests/ How to build -# a small replay script from the monstrous protocols ? +# a small replay script from the monstrous protocols ? #------------------------------------------------------------------------------# # a) crash -- use the file var/master-data/mysql/general_log.CSV # b) no crash, but unexpected server response (there is no "reject file) @@ -382,19 +421,19 @@ if (0) # protocolling of some queries. # In most cases you will find that the r/<testcase>.<log/reject> contains at # least a line "# # check <something>: 0". -# That means that a check within include/partition_check did not got the +# That means that a check within inc/partition_check did not got the # expected result. # A good start for a replay script would be # 1. Copy t/partition_<feature>_<engine>.test to t/my_test.test # 2. Edit t/my_test.test # - set $debug to 1 # - replace the line -# "--source include/partition_<feature>.inc" +# "--source inc/partition_<feature>.inc" # with all statements between the last # CREATE TABLE t1 statement (included this) # and the line -# "# Start usability test (include/partition_check.inc)" -# - add the content of include/partition_check.inc at the end. +# "# Start usability test (inc/partition_check.inc)" +# - add the content of inc/partition_check.inc at the end. # # Please excuse that the partitioning tests generate such huge protocols which # and are not very handy when it comes to bug analysis. I tried to squeez out diff --git a/mysql-test/include/partition_10.inc b/mysql-test/suite/parts/inc/partition_10.inc index 74b0fdf7f6a..2050c809463 100644 --- a/mysql-test/include/partition_10.inc +++ b/mysql-test/suite/parts/inc/partition_10.inc @@ -1,4 +1,4 @@ -# include/partition_10.inc +# inc/partition_10.inc # # Do some basic checks on a table. # @@ -10,7 +10,7 @@ # is like expected. # ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc ####### Variations with multiple records # Select on empty table @@ -50,20 +50,14 @@ eval UPDATE t1 SET f1 = $max_row + 2, f2 = 'ZZZZZZZ' WHERE f1 = 0 AND f2 = '#######'; # Select eval SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = $max_row + 2 AND f2 = 'ZZZZZZZ'; -if ($fixed_bug15968) -{ # Bug #15968: Partitions: crash when INSERT with f1 = -1 into PARTITION BY HASH(f1) eval UPDATE t1 SET f1 = 0 - 1, f2 = 'ZZZZZZZ' WHERE f1 = $max_row + 1 AND f2 = '#######'; # Select SELECT COUNT(*) AS my_value FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ'; -} # Delete eval DELETE FROM t1 WHERE f1 = $max_row + 2 AND f2 = 'ZZZZZZZ'; -if ($fixed_bug15968) -{ DELETE FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ'; -} # Select SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; diff --git a/mysql-test/include/partition_11.inc b/mysql-test/suite/parts/inc/partition_11.inc index 7ed4d882aa0..9f10f58a5f0 100644 --- a/mysql-test/include/partition_11.inc +++ b/mysql-test/suite/parts/inc/partition_11.inc @@ -1,4 +1,4 @@ -# include/partition_11.inc +# inc/partition_11.inc # # Try to create a table with the given partition number # @@ -13,7 +13,7 @@ let $run= `SELECT @my_errno = 0`; # If this operation was successfull, check + drop this table if ($run) { - --source include/partition_10.inc + --source suite/parts/inc/partition_10.inc eval DROP TABLE t1; } #### Try to create a table with the given subpartition number @@ -29,6 +29,6 @@ let $run= `SELECT @my_errno = 0`; # If this operation was successfull, check + drop this table if ($run) { - --source include/partition_10.inc + --source suite/parts/inc/partition_10.inc eval DROP TABLE t1; } diff --git a/mysql-test/include/partition_12.inc b/mysql-test/suite/parts/inc/partition_12.inc index 2a5610b82e1..c30990a61ef 100644 --- a/mysql-test/include/partition_12.inc +++ b/mysql-test/suite/parts/inc/partition_12.inc @@ -1,10 +1,10 @@ -# include/partition_12.inc +# inc/partition_12.inc # # Do some basic things on a table, if the SQL command executed just before # sourcing this file was successful. # ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc ####### Variations with multiple records # (mass) Insert max_row_div2 + 1 records @@ -42,20 +42,14 @@ eval UPDATE t1 SET f1 = $max_row + 2, f2 = 'ZZZZZZZ' WHERE f1 = 0 AND f2 = '#######'; # Select eval SELECT COUNT(*) = 1 AS my_value FROM t1 WHERE f1 = $max_row + 2 AND f2 = 'ZZZZZZZ'; -if ($fixed_bug15968) -{ # Bug #15968: Partitions: crash when INSERT with f1 = -1 into PARTITION BY HASH(f1) eval UPDATE t1 SET f1 = 0 - 1, f2 = 'ZZZZZZZ' WHERE f1 = $max_row + 1 AND f2 = '#######'; # Select SELECT COUNT(*) AS my_value FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ'; -} # Delete eval DELETE FROM t1 WHERE f1 = $max_row + 2 AND f2 = 'ZZZZZZZ'; -if ($fixed_bug15968) -{ DELETE FROM t1 WHERE f1 = 0 - 1 AND f2 = 'ZZZZZZZ'; -} # Select SELECT COUNT(*) = 0 AS my_value FROM t1 WHERE f2 = 'ZZZZZZZ'; diff --git a/mysql-test/suite/parts/inc/partition_20.inc b/mysql-test/suite/parts/inc/partition_20.inc index 7901b332a11..cc820b8312b 100644 --- a/mysql-test/suite/parts/inc/partition_20.inc +++ b/mysql-test/suite/parts/inc/partition_20.inc @@ -1,10 +1,11 @@ ################################################################################ -# include/partition_20.inc # +# inc/partition_20.inc # # # # Purpose: # -# Auxiliary script, only useful when sourced by include/partition_check.inc. # +# Auxiliary script, only useful when sourced by # +# suite/parts/inc/partition_check.inc. # # # -# 1. Check if the preceeding statement caused that the expected number of # +# 1. Check if the preceding statement caused that the expected number of # # records was # # - inserted # # - updated or deleted+inserted # @@ -17,19 +18,13 @@ # must be set before sourcing this routine. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # # Change: # ################################################################################ -# include/partition_20.inc -# -# Auxiliary script, only useful when sourced by include/partition_check.inc. -# - -# Check of preceeding statement via Select if ($no_debug) { --disable_query_log diff --git a/mysql-test/suite/parts/inc/partition_alter1.inc b/mysql-test/suite/parts/inc/partition_alter1.inc index a9706d5eb98..e3ec924f346 100644 --- a/mysql-test/suite/parts/inc/partition_alter1.inc +++ b/mysql-test/suite/parts/inc/partition_alter1.inc @@ -1,12 +1,12 @@ ################################################################################ -# include/partition_alter1.inc # +# inc/partition_alter1.inc # # # # Purpose: # # ADD/DROP PRIMARY KEYs and/or UNIQUE INDEXes tests on partitioned tables # # This routine is only useful for the partition_<feature>_<engine> tests. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -26,7 +26,7 @@ --echo # within the partitioning function --echo #------------------------------------------------------------------------ # Rule: Only f_int1 is used within the partitioning function -# ---> include/partition_alter_11.inc +# ---> inc/partition_alter_11.inc if ($do_pk_tests) { # The value of the following test is maybe covered by 1.1.3. @@ -35,12 +35,10 @@ if ($do_pk_tests) --echo # 1.1.1 PRIMARY KEY consisting of one column let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # This must fail, because PRIMARY KEY does not contain f_int1 let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # The value of the following test is maybe covered by 1.1.4. if ($more_pk_ui_tests) @@ -48,65 +46,52 @@ if ($more_pk_ui_tests) --echo # 1.1.2 UNIQUE INDEX consisting of one column let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # This must fail, because UNIQUE INDEX does not contain f_int1 let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc if ($do_pk_tests) { --echo # 1.1.3 PRIMARY KEY consisting of two columns let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } --echo # 1.1.4 UNIQUE INDEX consisting of two columns let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc # --echo #------------------------------------------------------------------------ --echo # 1.2 ADD PRIMARY KEY or UNIQUE INDEX to table with two columns --echo # (f_int1 and f_int2) within the partitioning function --echo #------------------------------------------------------------------------ # Rule: f_int1 and f_int2 is used within the partitioning function -# ---> include/partition_alter_13.inc +# ---> inc/partition_alter_13.inc if ($do_pk_tests) { --echo # 1.2.1 PRIMARY KEY consisting of two columns let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } --echo # 1.2.2 UNIQUE INDEX consisting of two columns let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc if ($do_pk_tests) { --echo # 1.2.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $alter= ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= ; --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # # @@ -122,7 +107,7 @@ if ($do_pk_tests) --echo # 2.1 Partitioning function contains one column(f_int1) --echo #------------------------------------------------------------------------ # Rule: Only f_int1 is used within the partitioning function -# ---> include/partition_alter_11.inc +# ---> inc/partition_alter_11.inc # The value of the following test is maybe covered by 2.1.5. if ($more_pk_ui_tests) { @@ -132,14 +117,12 @@ if ($more_pk_ui_tests) let $unique= , PRIMARY KEY(f_int1); let $alter= ALTER TABLE t1 DROP PRIMARY KEY; --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # --echo # 2.1.2 DROP UNIQUE INDEX consisting of one column let $unique= , UNIQUE INDEX uidx1 (f_int1); let $alter= ALTER TABLE t1 DROP INDEX uidx1; --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc # if ($do_pk_tests) { @@ -147,20 +130,16 @@ if ($more_pk_ui_tests) let $alter= ALTER TABLE t1 DROP PRIMARY KEY; let $unique= , PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # --echo # 2.1.4 DROP UNIQUE INDEX consisting of two columns let $alter= ALTER TABLE t1 DROP INDEX uidx1; let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # if ($do_pk_tests) @@ -169,42 +148,35 @@ if ($do_pk_tests) let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1); let $alter= ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2); let $alter= ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1); let $alter= ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc # --echo #------------------------------------------------------------------------ --echo # 2.2 Partitioning function contains two columns (f_int1,f_int2) --echo #------------------------------------------------------------------------ # Rule: f_int1 and f_int2 is used within the partitioning function -# ---> include/partition_alter_13.inc +# ---> inc/partition_alter_13.inc if ($do_pk_tests) { --echo # 2.2.1 DROP PRIMARY KEY consisting of two columns let $alter= ALTER TABLE t1 DROP PRIMARY KEY; let $unique= , PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # --echo # 2.2.2 DROP UNIQUE INDEX consisting of two columns let $alter= ALTER TABLE t1 DROP INDEX uidx1; let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc # if ($do_pk_tests) { @@ -212,26 +184,23 @@ if ($do_pk_tests) let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1); let $alter= ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2); let $alter= ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1); let $alter= ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc if (0) { --echo --echo #======================================================================== --echo # 3. ALTER TABLE "ALTER" PRIMARY KEY ---echo # ML: I think that an ALTER TABLE statement where a PRIMARY KEY is ---echo # dropped and recreated (with different layout) might be of ---echo # interest, if the tree containing the table data has to be ---echo # reorganized during this operation. +--echo # mleich: I think that an ALTER TABLE statement where a PRIMARY +--echo # KEY is dropped and recreated (with different layout) might +--echo # be of interest, if the tree containing the table data has +--echo # to be reorganized during this operation. --echo # To be implemented --echo #======================================================================== --echo diff --git a/mysql-test/suite/parts/inc/partition_alter2.inc b/mysql-test/suite/parts/inc/partition_alter2.inc index 3e01c3972bc..3960b8e8a09 100644 --- a/mysql-test/suite/parts/inc/partition_alter2.inc +++ b/mysql-test/suite/parts/inc/partition_alter2.inc @@ -1,12 +1,12 @@ ################################################################################ -# include/partition_alter2.inc # +# inc/partition_alter2.inc # # # # Purpose: # # Tests where the columns used within the partitioning function are altered. # # This routine is only useful for the partition_<feature>_<engine> tests. .# # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -22,12 +22,11 @@ --echo # 1.1 ALTER column f_int2 not used in partitioning function --echo #------------------------------------------------------------------------ # Rule: Only f_int1 is used within the partitioning function -# ---> include/partition_alter_11.inc +# ---> inc/partition_alter_11.inc let $alter= ALTER TABLE t1 MODIFY f_int2 BIGINT; --echo # 1.1.1 no PRIMARY KEY or UNIQUE INDEX exists let $unique= ; --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc # if ($do_pk_tests) { @@ -38,14 +37,11 @@ if ($do_pk_tests) { let $unique= , PRIMARY KEY (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , PRIMARY KEY (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , PRIMARY KEY (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # --echo # 1.1.3 UNIQUE INDEX exists @@ -55,14 +51,11 @@ if ($more_pk_ui_tests) { let $unique= , UNIQUE INDEX uidx1 (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc # if ($more_pk_ui_tests) { @@ -71,47 +64,35 @@ if ($more_pk_ui_tests) --echo # 1.2 ALTER column f_int1 used in partitioning function --echo #------------------------------------------------------------------------ # Rule: Only f_int1 is used within the partitioning function - # ---> include/partition_alter_11.inc + # ---> inc/partition_alter_11.inc let $alter= ALTER TABLE t1 MODIFY f_int1 BIGINT; --echo # 1.2.1 no PRIMARY KEY or UNIQUE INDEX exists let $unique= ; --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc # if ($do_pk_tests) { --echo # 1.2.2 PRIMARY KEY exists let $unique= , PRIMARY KEY (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , PRIMARY KEY (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , PRIMARY KEY (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # --echo # 1.2.3 UNIQUE INDEX exists let $unique= , UNIQUE INDEX uidx (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , UNIQUE INDEX uidx (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , UNIQUE INDEX uidx (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # --echo #------------------------------------------------------------------------ @@ -119,14 +100,12 @@ if ($more_pk_ui_tests) --echo # f_int1 or (f_int1 and f_int2) used in partitioning function --echo #------------------------------------------------------------------------ # Rule: f_int1 and f_int2 is used within the partitioning function -# ---> include/partition_alter_13.inc +# ---> inc/partition_alter_13.inc let $alter= ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; --echo # 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists let $unique= ; --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc # if ($do_pk_tests) { @@ -137,18 +116,13 @@ if ($do_pk_tests) { let $unique= , PRIMARY KEY (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , PRIMARY KEY (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , PRIMARY KEY (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # --echo # 1.3.3 UNIQUE INDEX exists @@ -158,18 +132,13 @@ if ($more_pk_ui_tests) { let $unique= , UNIQUE INDEX uidx (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , UNIQUE INDEX uidx (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc let $unique= , UNIQUE INDEX uidx (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc --echo --echo #======================================================================== @@ -180,12 +149,11 @@ let $unique= , UNIQUE INDEX uidx (f_int2,f_int1); --echo # 2.1 ALTER column f_int2 not used in partitioning function --echo #------------------------------------------------------------------------ # Rule: Only f_int1 is used within the partitioning function -# ---> include/partition_alter_11.inc +# ---> inc/partition_alter_11.inc let $alter= ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; --echo # 2.1.1 no PRIMARY KEY or UNIQUE INDEX exists let $unique= ; --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc # if ($do_pk_tests) { @@ -196,14 +164,11 @@ if ($do_pk_tests) --echo # 2.1.2 PRIMARY KEY exists let $unique= , PRIMARY KEY (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , PRIMARY KEY (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , PRIMARY KEY (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } # --echo # 2.1.3 UNIQUE INDEX exists @@ -213,14 +178,11 @@ if ($more_pk_ui_tests) { let $unique= , UNIQUE INDEX uidx1 (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc # if ($more_pk_ui_tests) { @@ -229,61 +191,47 @@ if ($more_pk_ui_tests) --echo # 2.2 ALTER column f_int1 used in partitioning function --echo #------------------------------------------------------------------------ # Rule: Only f_int1 is used within the partitioning function - # ---> include/partition_alter_11.inc + # ---> inc/partition_alter_11.inc let $alter= ALTER TABLE t1 MODIFY f_int1 MEDIUMINT; --echo # 2.2.1 no PRIMARY KEY or UNIQUE INDEX exists let $unique= ; --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc # if ($do_pk_tests) { --echo # 2.2.2 PRIMARY KEY exists let $unique= , PRIMARY KEY (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , PRIMARY KEY (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , PRIMARY KEY (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # --echo # 2.2.3 UNIQUE INDEX exists let $unique= , UNIQUE INDEX uidx (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc let $unique= , UNIQUE INDEX uidx (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , UNIQUE INDEX uidx (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # --echo #------------------------------------------------------------------------ --echo # 2.3 ALTER column f_int1 and f_int2 used in partitioning function --echo #------------------------------------------------------------------------ # Rule: f_int1 and f_int2 is used within the partitioning function -# ---> include/partition_alter_13.inc +# ---> inc/partition_alter_13.inc let $alter= ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; --echo # 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists let $unique= ; --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc # if ($do_pk_tests) { @@ -295,17 +243,12 @@ if ($do_pk_tests) let $unique= , PRIMARY KEY (f_int1); --source suite/parts/inc/partition_alter_11.inc } - # --source include/partition_alter_11.inc let $unique= , PRIMARY KEY (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc let $unique= , PRIMARY KEY (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc - # --source include/partition_alter_13.inc } # --echo # 2.3.3 UNIQUE INDEX exists @@ -315,18 +258,13 @@ if ($more_pk_ui_tests) { let $unique= , UNIQUE INDEX uidx (f_int1); --source suite/parts/inc/partition_alter_11.inc - # --source include/partition_alter_11.inc } let $unique= , UNIQUE INDEX uidx (f_int1,f_int2); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc let $unique= , UNIQUE INDEX uidx (f_int2,f_int1); --source suite/parts/inc/partition_alter_11.inc -# --source include/partition_alter_11.inc --source suite/parts/inc/partition_alter_13.inc -# --source include/partition_alter_13.inc # if (0) @@ -338,8 +276,8 @@ if (0) --echo # INTEGER --> FLOAT --echo # INTEGER --> DECIMAL --echo # INTEGER --> VARCHAR ---echo # ML: I assume that at least the first two variants are of some ---echo # interest. But I am unsure if the server allows such +--echo # mleich: I assume that at least the first two variants are of +--echo # some interest. But I am unsure if the server allows such --echo # conversions. I also think that such operations have a --echo # conversions very small likelihood. --echo # To be implemented. diff --git a/mysql-test/suite/parts/inc/partition_alter3.inc b/mysql-test/suite/parts/inc/partition_alter3.inc index 4b1539f4260..1fad361b371 100644 --- a/mysql-test/suite/parts/inc/partition_alter3.inc +++ b/mysql-test/suite/parts/inc/partition_alter3.inc @@ -1,11 +1,11 @@ ################################################################################ -# include/partition_alter3.inc # +# inc/partition_alter3.inc # # # # Purpose: # # Tests for partition management commands for HASH and KEY partitioning # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # @@ -32,7 +32,7 @@ SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1) INTO @exp_row_count; # DEBUG SELECT @exp_row_count; # 4. Print the layout, check Readability ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc # --echo #------------------------------------------------------------------------ @@ -44,16 +44,16 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2); # --echo # 1.1.2 Assign HASH partitioning ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc # --echo # 1.1.3 Assign other HASH partitioning to already partitioned table --echo # + test and switch back + test ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date)); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc # --echo # 1.1.4 Add PARTITIONS not fitting to HASH --> must fail @@ -64,7 +64,7 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN (0)); # --echo # 1.1.5 Add two named partitions + test ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc # --echo # 1.1.6 Add two named partitions, name clash --> must fail @@ -73,12 +73,12 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); # --echo # 1.1.7 Add one named partition + test ALTER TABLE t1 ADD PARTITION (PARTITION part2); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc # --echo # 1.1.8 Add four not named partitions + test ALTER TABLE t1 ADD PARTITION PARTITIONS 4; ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc --echo #------------------------------------------------------------------------ @@ -89,7 +89,7 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 4; ALTER TABLE t1 DROP PARTITION part1; # --echo # 1.2.2 COALESCE PARTITION partitionname is not supported ---error 1064 +--error ER_PARSE_ERROR ALTER TABLE t1 COALESCE PARTITION part1; # --echo # 1.2.3 Decrease by 0 is non sense --> must fail @@ -101,7 +101,7 @@ let $loop= 7; while ($loop) { ALTER TABLE t1 COALESCE PARTITION 1; - --source include/partition_layout.inc + --source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc dec $loop; } @@ -111,14 +111,13 @@ ALTER TABLE t1 COALESCE PARTITION 1; # --echo # 1.2.6 Remove partitioning ALTER TABLE t1 REMOVE PARTITIONING; ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc # --echo # 1.2.7 Remove partitioning from not partitioned table --> ???? ALTER TABLE t1 REMOVE PARTITIONING; DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc -# --source suite/parts/inc/partition_check_drop.inc --echo --echo #======================================================================== @@ -134,7 +133,7 @@ $column_list # 2. Fill the table t1 with some records eval $insert_all; # 4. Print the layout, check Readability ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read2.inc # --echo #------------------------------------------------------------------------ @@ -143,7 +142,7 @@ eval $insert_all; --echo #------------------------------------------------------------------------ --echo # 2.1.1 Assign KEY partitioning ALTER TABLE t1 PARTITION BY KEY(f_int1); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read2.inc # --echo # 2.1.2 Add PARTITIONS not fitting to KEY --> must fail @@ -154,17 +153,17 @@ ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN (0)); # --echo # 2.1.3 Add two named partitions + test ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read2.inc # --echo # 2.1.4 Add one named partition + test ALTER TABLE t1 ADD PARTITION (PARTITION part2); ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read2.inc # --echo # 2.1.5 Add four not named partitions + test ALTER TABLE t1 ADD PARTITION PARTITIONS 4; ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read2.inc --echo #------------------------------------------------------------------------ @@ -180,7 +179,7 @@ let $loop= 7; while ($loop) { ALTER TABLE t1 COALESCE PARTITION 1; - --source include/partition_layout.inc + --source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read2.inc dec $loop; } @@ -190,12 +189,11 @@ ALTER TABLE t1 COALESCE PARTITION 1; # --echo # 2.2.6 Remove partitioning ALTER TABLE t1 REMOVE PARTITIONING; ---source include/partition_layout.inc +--source suite/parts/inc/partition_layout.inc --source suite/parts/inc/partition_check_read2.inc # --echo # 2.2.7 Remove partitioning from not partitioned table --> ???? ALTER TABLE t1 REMOVE PARTITIONING; DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc -# --source suite/parts/inc/partition_check_drop.inc diff --git a/mysql-test/suite/parts/inc/partition_alter4.inc b/mysql-test/suite/parts/inc/partition_alter4.inc index e6f5dadbcca..040c13d69d6 100644 --- a/mysql-test/suite/parts/inc/partition_alter4.inc +++ b/mysql-test/suite/parts/inc/partition_alter4.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_alter1.inc # +# inc/partition_alter1.inc # # # # Purpose: # # Execute ALTER ... OPTIMIZE/CHECK/REBUID/ANALYZE statements (maintenance) # @@ -22,19 +22,15 @@ --echo # 1.1 ALTER ... ANALYZE PARTITION part_1; let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 1.2 ALTER ... ANALYZE PARTITION part_1,part_2; let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 1.3 ALTER ... ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 2 ALTER ... CHECK PARTITION @@ -42,19 +38,15 @@ let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; --echo # 2.1 ALTER ... CHECK PARTITION part_1; let $alter= ALTER TABLE t1 CHECK PARTITION part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 2.2 ALTER ... CHECK PARTITION part_1,part_2; let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_2; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 2.3 ALTER ... CHECK PARTITION part_1,part_2,part_5,part_6,part_10; let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 2.4 ALTER ... CHECK PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 3 ALTER ... OPTIMIZE PARTITION @@ -62,19 +54,15 @@ let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; --echo # 3.1 ALTER ... OPTIMIZE PARTITION part_1; let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 3.2 ALTER ... OPTIMIZE PARTITION part_1,part_2; let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 3.3 ALTER ... OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 3.4 ALTER ... OPTIMIZE PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 4 ALTER ... REBUILD PARTITION @@ -82,19 +70,15 @@ let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; --echo # 4.1 ALTER ... REBUILD PARTITION part_1; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 4.2 ALTER ... REBUILD PARTITION part_1,part_2; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 4.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 5 ALTER ... REPAIR PARTITION @@ -102,19 +86,15 @@ let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; --echo # 5.1 ALTER ... REBUILD PARTITION part_1; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 5.2 ALTER ... REBUILD PARTITION part_1,part_2; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 5.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo # 5.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 6 ALTER ... REMOVE PARTITIONING @@ -122,5 +102,4 @@ let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; --echo # 6.1 ALTER ... REMOVE PARTITIONING; let $alter= ALTER TABLE t1 REMOVE PARTITIONING; --source suite/parts/inc/partition_alter_41.inc -# --source include/partition_alter_41.inc diff --git a/mysql-test/suite/parts/inc/partition_alter_1.inc b/mysql-test/suite/parts/inc/partition_alter_1.inc index 206073d6775..b62efd24072 100644 --- a/mysql-test/suite/parts/inc/partition_alter_1.inc +++ b/mysql-test/suite/parts/inc/partition_alter_1.inc @@ -1,17 +1,17 @@ ################################################################################ -# include/partition_alter_1.inc # +# inc/partition_alter_1.inc # # # # Purpose: # # Alter a partioned table and check the usability afterwards # # This script is only usefule when sourced by # -# include/partition_alter_1[1|3].inc # +# inc/partition_alter_1[1|3].inc # # # # 0. Expect there is a table t1 # # 1. Insert the first half of the table t0_template into t1 # # 2. Execute the ALTER TABLE statement within the variable $alter # # Case SQL code in # # 0: 1. Insert the second half of the table t0_template into t1 # -# 2. Execute the usability test include/partition_check.inc # +# 2. Execute the usability test inc/partition_check.inc # # >0, but expected: nothing # # >0 and unexpected: abort # # 3. DROP the table t1 # @@ -20,10 +20,10 @@ # Example: # # CREATE TABLE t1 (f_int1 INT,f_int2 INT, .... ); # # let $alter= ALTER TABLE t1 ADD PRIMARY KEY(f_int2); # -# include/partition_alter_1.inc # +# inc/partition_alter_1.inc # # # # The parameters $insert_first_half and $insert_second_half # -# are also to be set outside (source ./include/partition.pre). # +# are also to be set outside (source ./inc/partition.pre). # # # #------------------------------------------------------------------------------# # Original Author: mleich # @@ -50,13 +50,15 @@ if ($no_debug) } eval SET @my_errno = $mysql_errno; let $run_test= `SELECT @my_errno = 0`; -let $unexpected_error= `SELECT @my_errno NOT IN (0,1030,1502,1506)`; -if ($unexpected_error) +if (`SELECT @my_errno NOT IN (0,$ER_GET_ERRNO, + $ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF, + $ER_DROP_PARTITION_NON_EXISTENT)`); { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1030,1502,1506 + --echo # Expected/handled SQL codes are 0,$ER_GET_ERRNO,$ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF,$ER_DROP_PARTITION_NON_EXISTENT SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. + --echo # Please check the error name to number mapping in inc/partition.pre. exit; --echo } @@ -66,6 +68,5 @@ if ($run_test) { eval $insert_second_half; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc } DROP TABLE t1; diff --git a/mysql-test/suite/parts/inc/partition_alter_11.inc b/mysql-test/suite/parts/inc/partition_alter_11.inc index f26d8e822ae..c7dd2d1d15f 100644 --- a/mysql-test/suite/parts/inc/partition_alter_11.inc +++ b/mysql-test/suite/parts/inc/partition_alter_11.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_alter_11.inc # +# inc/partition_alter_11.inc # # # # Purpose: # # Check ALTER partitioned table and the state of the table afterwards # @@ -10,7 +10,7 @@ # PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... # # do # # 1. Create the partitioned table # -# 2. Execute include/partition_alter_1.inc, which will # +# 2. Execute inc/partition_alter_1.inc, which will # # - Insert the first half of the table t0_template into t1 # # - Execute the ALTER TABLE statement # # - Insert the second half of the table t0_template into t1 # @@ -26,14 +26,14 @@ # Example: # # let $unique= , UNIQUE INDEX uidx1 (f_int1); # # let $alter= ALTER TABLE t1 DROP UNIQUE INDEX uidx1; # -# include/partition_alter1.inc # +# inc/partition_alter1.inc # # # # Attention: The routine include/partition_alter_13.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -56,7 +56,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY KEY if ($with_partitioning) @@ -69,7 +68,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST if ($with_partitioning) @@ -90,7 +88,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE if ($with_partitioning) @@ -112,7 +109,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH if ($with_partitioning) @@ -133,7 +129,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY if ($with_partitioning) @@ -157,7 +152,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST -- SUBPARTITION BY HASH if ($with_partitioning) @@ -178,7 +172,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST -- SUBPARTITION BY KEY if ($with_partitioning) @@ -199,4 +192,3 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc diff --git a/mysql-test/suite/parts/inc/partition_alter_13.inc b/mysql-test/suite/parts/inc/partition_alter_13.inc index 5152230795a..cfc622a7c82 100644 --- a/mysql-test/suite/parts/inc/partition_alter_13.inc +++ b/mysql-test/suite/parts/inc/partition_alter_13.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_alter_13.inc # +# inc/partition_alter_13.inc # # # # Purpose: # # Check ALTER partitioned table and the state of the table afterwards # @@ -10,7 +10,7 @@ # PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... # # do # # 1. Create the partitioned table # -# 2. Execute include/partition_alter_1.inc, which will # +# 2. Execute inc/partition_alter_1.inc, which will # # - Insert the first half of the table t0_template into t1 # # - Execute the ALTER TABLE statement # # - Insert the second half of the table t0_template into t1 # @@ -26,14 +26,14 @@ # Example: # # let $unique= , UNIQUE INDEX uidx1 (f_int1); # # let $alter= ALTER TABLE t1 DROP UNIQUE INDEX uidx1; # -# include/partition_alter1.inc # +# inc/partition_alter1.inc # # # # Attention: The routine include/partition_alter_11.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -56,7 +56,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY KEY if ($with_partitioning) @@ -69,7 +68,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST if ($with_partitioning) @@ -90,7 +88,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE if ($with_partitioning) @@ -112,7 +109,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH if ($with_partitioning) @@ -133,7 +129,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY if ($with_partitioning) @@ -157,7 +152,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST -- SUBPARTITION BY HASH if ($with_partitioning) @@ -178,7 +172,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST -- SUBPARTITION BY KEY if ($with_partitioning) @@ -199,4 +192,3 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc diff --git a/mysql-test/suite/parts/inc/partition_alter_41.inc b/mysql-test/suite/parts/inc/partition_alter_41.inc index 303ec8c2062..53469c08a19 100644 --- a/mysql-test/suite/parts/inc/partition_alter_41.inc +++ b/mysql-test/suite/parts/inc/partition_alter_41.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_alter_11.inc # +# inc/partition_alter_11.inc # # # # Purpose: # # Check ALTER partitioned table and the state of the table afterwards # @@ -10,11 +10,11 @@ # PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... # # do # # 1. Create the partitioned table # -# 2. Execute include/partition_alter_1.inc, which will # +# 2. Execute inc/partition_alter_1.inc, which will # # - Insert the first half of the table t0_template into t1 # # - Execute the ALTER TABLE statement # # - Insert the second half of the table t0_template into t1 # -# - Execute the usability test include/partition_check.inc # +# - Execute the usability test inc/partition_check.inc # # - Drop the table t1 # # done # # # @@ -26,14 +26,14 @@ # Example: # # let $unique= , UNIQUE INDEX uidx1 (f_int1); # # let $alter= ALTER TABLE t1 DROP UNIQUE INDEX uidx1; # -# include/partition_alter1.inc # +# inc/partition_alter1.inc # # # -# Attention: The routine include/partition_alter_13.inc is very similar # +# Attention: The routine inc/partition_alter_13.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -56,7 +56,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY KEY if ($with_partitioning) @@ -69,7 +68,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST if ($with_partitioning) @@ -90,7 +88,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE if ($with_partitioning) @@ -112,7 +109,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH if ($with_partitioning) @@ -133,7 +129,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY if ($with_partitioning) @@ -157,7 +152,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST -- SUBPARTITION BY HASH if ($with_partitioning) @@ -178,7 +172,6 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc #----------- PARTITION BY LIST -- SUBPARTITION BY KEY if ($with_partitioning) @@ -199,4 +192,3 @@ $unique ) $partitioning; --source suite/parts/inc/partition_alter_1.inc -# --source include/partition_alter_1.inc diff --git a/mysql-test/suite/parts/inc/partition_basic.inc b/mysql-test/suite/parts/inc/partition_basic.inc index 9854edab634..a5815d3b71c 100644 --- a/mysql-test/suite/parts/inc/partition_basic.inc +++ b/mysql-test/suite/parts/inc/partition_basic.inc @@ -1,12 +1,12 @@ ################################################################################ -# include/partition_basic.inc # +# inc/partition_basic.inc # # # # Purpose: # # Basic tests around create partitioned table with/without PRIMARY KEY and # # /or UNIQUE INDEX # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -29,7 +29,6 @@ --echo # 1.1 The partitioning function contains one column. let $unique= ; --source suite/parts/inc/partition_methods1.inc -# --source include/partition_methods1.inc # --echo # 1.1.1 with DATA DIECTORY/INDEX DIRECTORY # @@ -50,16 +49,13 @@ let $unique= ; let $with_directories= 1; --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc --source suite/parts/inc/partition_directory.inc - # --source include/partition_methods1.inc let $with_directories= 0; --enable_query_log # --echo # 1.2 The partitioning function contains two columns. let $unique= ; --source suite/parts/inc/partition_methods2.inc -# --source include/partition_methods2.inc # --echo #------------------------------------------------------------------------ --echo # 2 Tables with PRIMARY KEY and/or UNIQUE INDEXes @@ -72,12 +68,10 @@ if ($more_pk_ui_tests) --echo # 2.1 PRIMARY KEY consisting of one column let $unique= , PRIMARY KEY(f_int1); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc } --echo # 2.2 UNIQUE INDEX consisting of one column let $unique= , UNIQUE INDEX uidx1 (f_int1); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc --echo # 2.2.1 with DATA DIECTORY/INDEX DIRECTORY # @@ -98,7 +92,6 @@ if ($more_pk_ui_tests) let $with_directories= TRUE; --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc let $with_directories= FALSE; --enable_query_log # @@ -107,19 +100,15 @@ if ($more_pk_ui_tests) --echo # 2.3 PRIMARY KEY consisting of two columns let $unique= , PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc let $unique= , PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc } # --echo # 2.4 UNIQUE INDEX consisting of two columns let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc # } --echo # 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns @@ -127,14 +116,11 @@ if ($do_pk_tests) { let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_methods1.inc - # --source include/partition_methods1.inc } let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1); --source suite/parts/inc/partition_methods1.inc -# --source include/partition_methods1.inc --echo #------------------------------------------------------------------------ --echo # 3 Tables with PRIMARY KEY and/or UNIQUE INDEXes @@ -148,20 +134,16 @@ if ($more_pk_ui_tests) --echo # 3.1 PRIMARY KEY consisting of two columns let $unique= , PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_methods2.inc - # --source include/partition_methods2.inc let $unique= , PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_methods2.inc - # --source include/partition_methods2.inc } # --echo # 3.2 UNIQUE INDEX consisting of two columns let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); --source suite/parts/inc/partition_methods2.inc - # --source include/partition_methods2.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); --source suite/parts/inc/partition_methods2.inc - # --source include/partition_methods2.inc } # --echo # 3.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns @@ -169,11 +151,8 @@ if ($do_pk_tests) { let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1); --source suite/parts/inc/partition_methods2.inc - # --source include/partition_methods2.inc let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2); --source suite/parts/inc/partition_methods2.inc - # --source include/partition_methods2.inc } let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1); --source suite/parts/inc/partition_methods2.inc -# --source include/partition_methods2.inc diff --git a/mysql-test/suite/parts/inc/partition_binary.inc b/mysql-test/suite/parts/inc/partition_binary.inc index 7243d6c2ce7..3ee363927c4 100644 --- a/mysql-test/suite/parts/inc/partition_binary.inc +++ b/mysql-test/suite/parts/inc/partition_binary.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and binary data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = @@ -43,6 +45,9 @@ select count(*) from t2; select hex(a) from t2; drop table t2; +# mleich: Several partitioning functions are no more allowed. +if (0) +{ eval create table t3 (a binary(255) not null, primary key(a)) engine=$engine partition by range (ascii(a)) subpartition by key (a) subpartitions 4 ( partition pa16 values less than (16), @@ -66,6 +71,7 @@ select count(*) from t3; select hex(a) from t3; drop table t3; + eval create table t4 (a binary(255) not null, primary key(a)) engine=$engine partition by list (ascii(a)) subpartition by key (a) subpartitions 4 ( partition pa16 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), @@ -86,6 +92,9 @@ eval insert into t4 values (repeat(char(ascii('a')+$letter),$count+54)); dec $count; inc $letter; } + select count(*) from t4; select hex(a) from t4; drop table t4; +} +# End of tests with disallowed partitioning functions. diff --git a/mysql-test/suite/parts/inc/partition_bit.inc b/mysql-test/suite/parts/inc/partition_bit.inc index 3dd880595a3..6fcf3b208bb 100644 --- a/mysql-test/suite/parts/inc/partition_bit.inc +++ b/mysql-test/suite/parts/inc/partition_bit.inc @@ -14,7 +14,7 @@ let $index_directory = `select @indx_dir`; drop table if exists t1; --enable_warnings ---error 1439 +--error ER_TOO_BIG_DISPLAYWIDTH eval create table t1 (a bit(65), primary key (a)) engine=$engine partition by key (a); eval create table t1 (a bit(0), primary key (a)) engine=$engine partition by key (a); diff --git a/mysql-test/suite/parts/inc/partition_blob.inc b/mysql-test/suite/parts/inc/partition_blob.inc index ccff06ba633..b22693c9f3d 100644 --- a/mysql-test/suite/parts/inc/partition_blob.inc +++ b/mysql-test/suite/parts/inc/partition_blob.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and blob data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = diff --git a/mysql-test/suite/parts/inc/partition_char.inc b/mysql-test/suite/parts/inc/partition_char.inc index 4e330b122e3..b3d7ae3c2a1 100644 --- a/mysql-test/suite/parts/inc/partition_char.inc +++ b/mysql-test/suite/parts/inc/partition_char.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and char data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = @@ -42,6 +44,7 @@ select count(*) from t2; select * from t2; drop table t2; +# mleich: Several partitioning functions are no more allowed. if (0) { eval create table t3 (a char(255) not null, primary key(a)) engine=$engine @@ -91,5 +94,4 @@ select count(*) from t4; select a from t4; drop table t4; } -#if (0) - +# End of tests with disallowed partitioning functions. diff --git a/mysql-test/suite/parts/inc/partition_check.inc b/mysql-test/suite/parts/inc/partition_check.inc index 87d8c5a3c5a..19d548cc8ef 100644 --- a/mysql-test/suite/parts/inc/partition_check.inc +++ b/mysql-test/suite/parts/inc/partition_check.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_check.inc # +# inc/partition_check.inc # # # # Purpose: # # Do some basic usability checks on table t1. # @@ -27,7 +27,7 @@ # Records can be deleted or inserted, but the content of the # # records after a test/testsequence should follow this scheme. # # # -# All checks of preceeding statements via Select are so written, # +# All checks of preceding statements via Select are so written, # # that they deliver a # # # check <n> success: 1 # # when everything is like expected. # @@ -47,10 +47,9 @@ ################################################################################ ---echo # Start usability test (include/partition_check.inc) +--echo # Start usability test (inc/partition_check.inc) # Print the CREATE TABLE STATEMENT and store the current layout of the table --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc #------------------------------------------------------------------------------- @@ -160,8 +159,7 @@ if ($run) # partitioning mechanism. # Sideeffect: Attempt to INSERT one record # DUPLICATE KEY will appear if we have UNIQUE columns -# 1022: ER_DUP_KEY -# 1062: ER_DUP_ENTRY +# ER_DUP_KEY, ER_DUP_ENTRY --disable_abort_on_error INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), @@ -174,14 +172,13 @@ if ($no_debug) } eval SET @my_errno = $mysql_errno; let $run_delete= `SELECT @my_errno = 0`; -let $any_unique= `SELECT @my_errno IN (1022,1062)`; -let $unexpected_error= `SELECT @my_errno NOT IN (0,1022,1062)`; +let $any_unique= `SELECT @my_errno IN ($ER_DUP_KEY,$ER_DUP_ENTRY)`; # DEBUG eval SELECT $run_delete AS run_delete, $any_unique AS any_unique, -# $unexpected_error AS unexpected_error; -if ($unexpected_error) +# @my_errno AS sql_errno; +if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1022,1062 + --echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; @@ -204,8 +201,7 @@ if ($any_unique) ## 1.3.1 Check, if f_int1 is UNIQUE # Sideeffect: Attempt to INSERT one record # DUPLICATE KEY will appear if we have UNIQUE columns - # 1022: ER_DUP_KEY - # 1062: ER_DUP_ENTRY + # ER_DUP_KEY, ER_DUP_ENTRY --disable_abort_on_error INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), @@ -218,14 +214,13 @@ if ($any_unique) } eval SET @my_errno = $mysql_errno; let $run_delete= `SELECT @my_errno = 0`; - let $f_int1_is_unique= `SELECT @my_errno IN (1022,1062)`; - let $unexpected_error= `SELECT @my_errno NOT IN (0,1022,1062)`; + let $f_int1_is_unique= `SELECT @my_errno IN ($ER_DUP_KEY,$ER_DUP_ENTRY)`; # DEBUG eval SELECT $run_delete AS run_delete, $f_int1_is_unique AS any_unique, - # $unexpected_error AS unexpected_error; - if ($unexpected_error) + # @my_errno AS sql_errno; + if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1022,1062 + --echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; @@ -242,7 +237,7 @@ if ($any_unique) DELETE FROM t1 WHERE f_charbig = 'delete me'; } - ## 1.3.2 Check, if f_int2 is UNIQUE + ## 1.3.2 Check, if f_int2 is UNIQUE (get ER_DUP_KEY or ER_DUP_ENTRY --disable_abort_on_error INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), @@ -255,14 +250,13 @@ if ($any_unique) } eval SET @my_errno = $mysql_errno; let $run_delete= `SELECT @my_errno = 0`; - let $f_int1_is_unique= `SELECT @my_errno IN (1022,1062)`; - let $unexpected_error= `SELECT @my_errno NOT IN (0,1022,1062)`; + let $f_int1_is_unique= `SELECT @my_errno IN ($ER_DUP_KEY,$ER_DUP_ENTRY)`; # DEBUG eval SELECT $run_delete AS run_delete, $f_int1_is_unique AS any_unique, - # $unexpected_error AS unexpected_error; - if ($unexpected_error) + # @my_errno AS sql_errno; + if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1022,1062 + --echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; @@ -289,14 +283,11 @@ if ($any_unique) # per f_int1 used in partitioning function let $col_to_check= f_int1; --source suite/parts/inc/partition_check_read.inc -# --source include/partition_check_read.inc ## 2.2 Read all existing and some not existing records of table # per f_int2 used in partitioning function let $col_to_check= f_int2; --source suite/parts/inc/partition_check_read.inc -if ($fixed_bug18735) -{ #------------------------------------------------------------------------------- # 3 Some operations with multiple records @@ -321,7 +312,7 @@ SELECT '# check multiple-2 success: ' AS "",COUNT(*) = @max_row - @max_row_div3 # (Insert the records deleted in 3.2) INSERT INTO t1 SELECT * FROM t0_template WHERE MOD(f_int1,3) = 0; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -337,7 +328,7 @@ FROM t1; UPDATE t1 SET f_int1 = f_int1 + @max_row WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 AND @max_row_div2 + @max_row_div4; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -352,7 +343,7 @@ SELECT '# check multiple-4 success: ' AS "",(COUNT(*) = @max_row) AND (MIN(f_int DELETE FROM t1 WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row AND @max_row_div2 + @max_row_div4 + @max_row; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -405,7 +396,7 @@ INSERT INTO t1 SET f_int1 = @cur_value , f_int2 = @cur_value, f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), f_charbig = '#SINGLE#'; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -423,7 +414,7 @@ INSERT INTO t1 SET f_int1 = @cur_value , f_int2 = @cur_value, f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), f_charbig = '#SINGLE#'; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -443,7 +434,7 @@ SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; # Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response UPDATE t1 SET f_int1 = @cur_value2 WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -464,7 +455,7 @@ SELECT MAX(f_int1) INTO @cur_value2 FROM t1; # Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response UPDATE t1 SET f_int1 = @cur_value1 WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -476,7 +467,7 @@ WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; # 4.5 Delete the record with the highest value of f_int1. SELECT MAX(f_int1) INTO @cur_value FROM t1; DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; -# Check of preceeding statements via Select +# Check of preceding statements via Select if ($no_debug) { --disable_query_log @@ -487,7 +478,7 @@ WHERE f_charbig = '#SINGLE#' AND f_int1 = f_int1 = @cur_value; # # 4.6 Delete the record with f_int1 = -1 DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; -# Check of preceeding statements via Select +# Check of preceding statements via Select if ($no_debug) { --disable_query_log @@ -499,9 +490,9 @@ WHERE f_charbig = '#SINGLE#' AND f_int1 IN (-1,@cur_value); # 4.7 Insert one record with such a big value for f_int1, so that in case # - f_int1 is used within the partitioning algorithm # - we use range partitioning -# we get error ER_NO_PARTITION_FOR_GIVEN_VALUE (1525) +# we get error ER_NO_PARTITION_FOR_GIVEN_VALUE # "Table has no partition for value ...." -# or ER_SAME_NAME_PARTITION (1514) +# or ER_SAME_NAME_PARTITION --disable_abort_on_error eval INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#$max_int_4##'; --enable_abort_on_error @@ -510,17 +501,16 @@ if ($no_debug) --disable_query_log } eval SET @my_errno = $mysql_errno; -let $unexpected_error= `SELECT @my_errno NOT IN (0,1514,1525)`; -if ($unexpected_error) +if (`SELECT @my_errno NOT IN (0,$ER_SAME_NAME_PARTITION,$ER_NO_PARTITION_FOR_GIVEN_VALUE)`) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1514,1525 + --echo # Expected/handled SQL codes are 0,$ER_SAME_NAME_PARTITION,$ER_NO_PARTITION_FOR_GIVEN_VALUE SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; --echo } -# Check of preceeding statement via Select, if the INSERT was successful +# Check of preceding statement via Select, if the INSERT was successful let $run= `SELECT @my_errno = 0`; if ($run) { @@ -538,8 +528,6 @@ eval DELETE FROM t1 WHERE f_charbig = '#$max_int_4##'; } --enable_query_log -} -# End workaround for Bug#18735 #------------------------------------------------------------------------------- # 5 Experiments with NULL @@ -562,14 +550,13 @@ INSERT t1 SET f_int1 = 0 , f_int2 = 0, # mechanism if the result of the expression in the partitioning algorithm # becomes NULL. # This INSERT will fail, if f_int1 is PRIMARY KEY or UNIQUE INDEX -# 1048: ER_BAD_NULL_ERROR +# with ER_BAD_NULL_ERROR. --disable_abort_on_error - INSERT INTO t1 SET f_int1 = NULL , f_int2 = -@max_row, f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), f_charbig = '#NULL#'; -# Some other NULL experiments if preceeding INSERT was successfull +# Some other NULL experiments if preceding INSERT was successfull --enable_abort_on_error if ($no_debug) { @@ -577,13 +564,13 @@ if ($no_debug) } eval SET @my_errno = $mysql_errno; let $run= `SELECT @my_errno = 0`; -let $unexpected_error= `SELECT @my_errno NOT IN (0,1048)`; -if ($unexpected_error) +if (`SELECT @my_errno NOT IN (0,$ER_BAD_NULL_ERROR)`) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1048 + --echo # Expected/handled SQL codes are 0,$ER_BAD_NULL_ERROR SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. + --echo # Please check the error name to number mapping in inc/partition.pre. exit; --echo } @@ -593,7 +580,7 @@ if ($unexpected_error) # The following checks do not make sense if f_int1 cannot be NULL if ($run) { -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -612,7 +599,7 @@ if ($no_debug) { --disable_query_log } -# Check of preceeding statement via Select +# Check of preceding statement via Select SELECT '# check null-2 success: ' AS "",COUNT(*) = 1 AS "" FROM t1 WHERE f_int1 = -@max_row AND f_charbig = '#NULL#'; --enable_query_log @@ -624,7 +611,7 @@ if ($no_debug) { --disable_query_log } -# Check of preceeding statement via Select +# Check of preceding statement via Select SELECT '# check null-3 success: ' AS "",COUNT(*) = 1 AS "" FROM t1 WHERE f_int1 IS NULL AND f_charbig = '#NULL#'; --enable_query_log @@ -632,7 +619,7 @@ WHERE f_int1 IS NULL AND f_charbig = '#NULL#'; DELETE FROM t1 WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -697,7 +684,6 @@ if ($any_unique) UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, f_charbig = 'was updated'; --source suite/parts/inc/partition_20.inc - # --source include/partition_20.inc } if ($f_int2_is_unique) @@ -713,7 +699,6 @@ if ($any_unique) UPDATE f_int2 = 2 * @max_row + source_tab.f_int1, f_charbig = 'was updated'; --source suite/parts/inc/partition_20.inc - # --source include/partition_20.inc } ## 6.3 f_int1, f_int2 is UNIQUE, UPDATE f_int1, f_int2 when DUPLICATE KEY @@ -727,7 +712,6 @@ if ($any_unique) f_int2 = 2 * @max_row + source_tab.f_int1, f_charbig = 'was updated'; --source suite/parts/inc/partition_20.inc - # --source include/partition_20.inc ## 6.4 REPLACE # Bug#16782: Partitions: crash, REPLACE .. on table with PK, DUPLICATE KEY @@ -736,7 +720,7 @@ if ($any_unique) FROM t0_template source_tab WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; # DEBUG SELECT * FROM t1 ORDER BY f_int1, f_int2; - # Check of preceeding statement via Select + # Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -763,10 +747,6 @@ if ($any_unique) # DEBUG SELECT * FROM t1 ORDER BY f_int1, f_int2; } -if ($fixed_bug18735) -{ - # The following tests work cannot like intended, if we had to omit - # tests because of Bug#18735 #------------------------------------------------------------------------------- # 7 Transactions @@ -943,14 +923,12 @@ if ($debug) SELECT * FROM t1 ORDER BY f_int1; } -} -# End workaround for Bug#18735 #------------------------------------------------------------------------------- # 8 Some special cases # 8.1 Dramatic increase of the record/partition/subpartition/table sizes UPDATE t1 SET f_charbig = REPEAT('b', 1000); -# partial check of preceeding statement via Select +# partial check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -961,7 +939,7 @@ WHERE f_int1 = 1 AND f_charbig = REPEAT('b', 1000); # # 8.2 Dramatic decrease of the record/partition/subpartition/table sizes UPDATE t1 SET f_charbig = ''; -# partial check of preceeding statement via Select +# partial check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -977,8 +955,7 @@ if ($debug) SELECT * FROM t1 ORDER BY f_int1; } -if ($fixed_bug18735) -{ + #------------------------------------------------------------------------------- # 9 TRIGGERs let $num= 1; @@ -998,28 +975,22 @@ SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; let $event= BEFORE INSERT; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $event= AFTER INSERT; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $statement= UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); let $event= BEFORE UPDATE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $event= AFTER UPDATE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $statement= DELETE FROM t0_aux WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); let $event= BEFORE DELETE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $event= AFTER DELETE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc # Cleanup eval DELETE FROM $tab_in_trigg @@ -1052,28 +1023,22 @@ SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; let $event= BEFORE INSERT; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $event= AFTER INSERT; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $statement= UPDATE t1 SET f_int1 = - f_int1, f_int2 = - f_int2 WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); let $event= BEFORE UPDATE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $event= AFTER UPDATE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $statement= DELETE FROM t1 WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); let $event= BEFORE DELETE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc let $event= AFTER DELETE; --source suite/parts/inc/partition_trigg1.inc -# --source include/partition_trigg1.inc eval DELETE FROM $tab_in_trigg WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; } @@ -1095,7 +1060,6 @@ SET f_charbig = '####updated per update statement itself####'; let $source= old; let $event= BEFORE UPDATE; --source suite/parts/inc/partition_trigg2.inc -# --source include/partition_trigg2.inc # FIXME when AFTER TRIGGER can be used # Currently (2006-02-23) a AFTER TRIGGER is not allowed to modify a row, which # was just modified: 1362: Updating of NEW row is not allowed in after trigger @@ -1111,7 +1075,6 @@ f_charbig = '####updated per update statement itself####'; let $source= old; let $event= BEFORE UPDATE; --source suite/parts/inc/partition_trigg2.inc -# --source include/partition_trigg2.inc # FIXME when AFTER TRIGGER can be used # Currently (2006-02-23) a AFTER TRIGGER is not allowed to modify a row, which # was just modified: 1362: Updating of NEW row is not allowed in after trigger @@ -1119,7 +1082,6 @@ let $event= BEFORE UPDATE; let $source= new; let $event= BEFORE UPDATE; --source suite/parts/inc/partition_trigg2.inc -# --source include/partition_trigg2.inc # FIXME when AFTER TRIGGER can be used if ($debug) @@ -1138,7 +1100,6 @@ ORDER BY f_int1; let $event= BEFORE INSERT; let $source= new; --source suite/parts/inc/partition_trigg3.inc -# --source include/partition_trigg3.inc # FIXME when AFTER TRIGGER can be used # 9.4.2 INSERT assigns no values to the recalculate columns @@ -1150,7 +1111,6 @@ ORDER BY f_int1; let $event= BEFORE INSERT; let $source= new; --source suite/parts/inc/partition_trigg3.inc -# --source include/partition_trigg3.inc # FIXME when AFTER TRIGGER can be used if ($debug) @@ -1158,8 +1118,6 @@ if ($debug) SELECT * FROM t1 ORDER BY f_int1; } -} -# End workaround for Bug#18735 #------------------------------------------------------------------------------- # 10 ANALYZE/CHECK/CHECKSUM @@ -1181,17 +1139,15 @@ CHECKSUM TABLE t1 EXTENDED; # FIXME What will happen with NDB ? OPTIMIZE TABLE t1; --source suite/parts/inc/partition_layout_check2.inc -# --source include/partition_layout_check2.inc # 10.2 REPAIR TABLE REPAIR TABLE t1 EXTENDED; --source suite/parts/inc/partition_layout_check2.inc -# --source include/partition_layout_check2.inc # # 11.3 Truncate # Manual about TRUNCATE on tables ( != InnoDB table with FOREIGN KEY ): # Truncate operations drop and re-create the table .... TRUNCATE t1; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -1199,6 +1155,5 @@ if ($no_debug) SELECT '# check TRUNCATE success: ' AS "",COUNT(*) = 0 AS "" FROM t1; --enable_query_log --source suite/parts/inc/partition_layout_check2.inc -# --source include/partition_layout_check2.inc ---echo # End usability test (include/partition_check.inc) +--echo # End usability test (inc/partition_check.inc) diff --git a/mysql-test/suite/parts/inc/partition_check_drop.inc b/mysql-test/suite/parts/inc/partition_check_drop.inc index 825ebecba24..88ebdb7ad48 100644 --- a/mysql-test/suite/parts/inc/partition_check_drop.inc +++ b/mysql-test/suite/parts/inc/partition_check_drop.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_check_drop.inc # +# inc/partition_check_drop.inc # # # # Purpose: # # Check that a drop table removes all files belonging to this table. # @@ -9,7 +9,7 @@ # This routine is only useful for the partition_<feature>_<engine> tests. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-05-12 # # Change Author: # # Change Date: # @@ -52,7 +52,7 @@ if ($found_garbage) if ($ls) { --echo # Attention: There are unused files. - --echo # Either the DROP TABLE or a preceeding ALTER TABLE + --echo # Either the DROP TABLE or a preceding ALTER TABLE --echo # <alter partitioning> worked incomplete. --echo # We found: # Print the list of files into the protocol diff --git a/mysql-test/suite/parts/inc/partition_check_read.inc b/mysql-test/suite/parts/inc/partition_check_read.inc index 14bbd46ac7f..e42bb9c90ab 100644 --- a/mysql-test/suite/parts/inc/partition_check_read.inc +++ b/mysql-test/suite/parts/inc/partition_check_read.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_check_read.inc # +# inc/partition_check_read.inc # # # # Purpose: # # Read table t1 row by row # @@ -10,7 +10,7 @@ # - the table contains all expected rows # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -80,7 +80,7 @@ if ($no_debug) --disable_query_log } --echo # check read via $col_to_check success: $success -# ML: The following is omitted because of not reported mysqltest bug +# mleich: The following is omitted because of not reported mysqltest bug # (@max_row time the success message) if (0) { diff --git a/mysql-test/suite/parts/inc/partition_check_read1.inc b/mysql-test/suite/parts/inc/partition_check_read1.inc index dad5c347052..0b8b800a371 100644 --- a/mysql-test/suite/parts/inc/partition_check_read1.inc +++ b/mysql-test/suite/parts/inc/partition_check_read1.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_check_read1.inc # +# inc/partition_check_read1.inc # # # # Purpose: # # Read rows from table t1 in different ways # @@ -10,7 +10,7 @@ # must be set before sourcing this routine. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # diff --git a/mysql-test/suite/parts/inc/partition_check_read2.inc b/mysql-test/suite/parts/inc/partition_check_read2.inc index 4c32456a31e..60964355d14 100644 --- a/mysql-test/suite/parts/inc/partition_check_read2.inc +++ b/mysql-test/suite/parts/inc/partition_check_read2.inc @@ -1,12 +1,12 @@ ################################################################################ -# include/partition_check_read2.inc # +# inc/partition_check_read2.inc # # # # Purpose: # # Read rows from table t1 in different ways # # This routine is only useful for the partition_<feature>_<engine> tests. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # diff --git a/mysql-test/suite/parts/inc/partition_cleanup.inc b/mysql-test/suite/parts/inc/partition_cleanup.inc index dcd6005287e..34d3e435509 100644 --- a/mysql-test/suite/parts/inc/partition_cleanup.inc +++ b/mysql-test/suite/parts/inc/partition_cleanup.inc @@ -1,12 +1,12 @@ ################################################################################ -# include/partition_cleanup.inc # +# inc/partition_cleanup.inc # # # # Purpose: # # Removal of the objects created by the t/partition_<feature>_<engine>.test # # scripts. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # diff --git a/mysql-test/suite/parts/inc/partition_directory.inc b/mysql-test/suite/parts/inc/partition_directory.inc index 17748df4f4d..5acdf13a8f9 100644 --- a/mysql-test/suite/parts/inc/partition_directory.inc +++ b/mysql-test/suite/parts/inc/partition_directory.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_rectory.inc # +# inc/partition_directory.inc # # # # Purpose: # # Create and check partitioned tables # @@ -9,7 +9,7 @@ # do # # 1. Create the partitioned table # # 2 Insert the content of the table t0_template into t1 # -# 3. Execute include/partition_check.inc # +# 3. Execute inc/partition_check.inc # # 4. Drop the table t1 # # done # #------------------------------------------------------------------------------# @@ -49,7 +49,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -86,7 +85,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -122,7 +120,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -153,7 +150,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -181,7 +177,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -212,7 +207,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -256,7 +250,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc diff --git a/mysql-test/suite/parts/inc/partition_engine.inc b/mysql-test/suite/parts/inc/partition_engine.inc index 2beb08e7626..769e3d71530 100644 --- a/mysql-test/suite/parts/inc/partition_engine.inc +++ b/mysql-test/suite/parts/inc/partition_engine.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_engine.inc # +# inc/partition_engine.inc # # # # Purpose: # # Tests around Create/Alter partitioned tables and storage engine settings # @@ -17,7 +17,7 @@ # storage engine to use. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -45,7 +45,6 @@ $column_list INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; # --echo #------------------------------------------------------------------------ @@ -62,7 +61,6 @@ PARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; eval CREATE TABLE t1 ( $column_list @@ -79,7 +77,6 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; # --echo #------------------------------------------------------------------------ @@ -96,7 +93,6 @@ PARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; eval CREATE TABLE t1 ( $column_list @@ -108,7 +104,6 @@ PARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; eval CREATE TABLE t1 ( $column_list @@ -125,7 +120,6 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; eval CREATE TABLE t1 ( $column_list @@ -142,7 +136,6 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; # --echo #------------------------------------------------------------------------ @@ -164,7 +157,6 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; eval CREATE TABLE t1 ( $column_list @@ -181,7 +173,6 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; # --echo #------------------------------------------------------------------------ @@ -199,7 +190,6 @@ PARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; eval CREATE TABLE t1 ( $column_list @@ -216,7 +206,6 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --echo # 6.2 Storage engine assignment after partition name + after --echo # subpartition name @@ -236,7 +225,6 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --echo #------------------------------------------------------------------------ @@ -252,7 +240,6 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 ENGINE = $engine); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; # Bug#15966 Partitions: crash if session default engine <> engine used in create table eval CREATE TABLE t1 ( @@ -266,6 +253,5 @@ SUBPARTITION BY HASH(f_int1) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; eval SET SESSION storage_engine=$engine; diff --git a/mysql-test/suite/parts/inc/partition_enum.inc b/mysql-test/suite/parts/inc/partition_enum.inc index 67e790743f0..886ab6a5f97 100644 --- a/mysql-test/suite/parts/inc/partition_enum.inc +++ b/mysql-test/suite/parts/inc/partition_enum.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and enum data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = @@ -47,6 +49,9 @@ select count(*) from t2; select * from t2; drop table t2; +# mleich: Several partitioning functions are no more allowed. +if (0) +{ eval create table t3 (a enum ( '1','2','3','4','5','6','7','8','9','0', 'A','B','C','D','E','F','G','H','I','J','K','L', @@ -71,4 +76,5 @@ dec $letter; select count(*) from t3; select * from t3; drop table t3; - +} +# End of tests with disallowed partitioning functions. diff --git a/mysql-test/include/partition_layout.inc b/mysql-test/suite/parts/inc/partition_layout.inc index e8d2b0f9123..c4181ef1cfd 100644 --- a/mysql-test/include/partition_layout.inc +++ b/mysql-test/suite/parts/inc/partition_layout.inc @@ -1,4 +1,4 @@ -# include/partition_layout.inc +# inc/partition_layout.inc # # Print partitioning related informations about the table t1 # diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc index d3441b3d886..9989f4ed9e3 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check1.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc @@ -1,17 +1,17 @@ ################################################################################ -# include/partition_layout_check1.inc # +# inc/partition_layout_check1.inc # # # # Purpose: # # Store the SHOW CREATE TABLE output and the list of files belonging to # # this table + print this into the protocol # # This script is only usefule when sourced within the partitioning tests. # # # -# Attention: The routine include/partition_layout_check2.inc is very similar # +# Attention: The routine inc/partition_layout_check2.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc index 8a45613559d..05c44a73a7f 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check2.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc @@ -1,18 +1,18 @@ ################################################################################ -# include/partition_layout_check2.inc # +# inc/partition_layout_check2.inc # # # # Purpose: # # Store the SHOW CREATE TABLE output and the list of files belonging to # # this table + Check if the layout of the table was not modified # -# since the call of include/partition_layout_check1.inc # +# since the call of inc/partition_layout_check1.inc # # This script is only usefule when sourced within the partitioning tests. # # # -# Attention: The routine include/partition_layout_check1.inc is very similar # +# Attention: The routine inc/partition_layout_check1.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # diff --git a/mysql-test/suite/parts/inc/partition_methods1.inc b/mysql-test/suite/parts/inc/partition_methods1.inc index 6e49c51cc3d..1edcdcb3743 100644 --- a/mysql-test/suite/parts/inc/partition_methods1.inc +++ b/mysql-test/suite/parts/inc/partition_methods1.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_methods1.inc # +# inc/partition_methods1.inc # # # # Purpose: # # Create and check partitioned tables # @@ -11,7 +11,7 @@ # do # # 1. Create the partitioned table # # 2 Insert the content of the table t0_template into t1 # -# 3. Execute include/partition_check.inc # +# 3. Execute inc/partition_check.inc # # 4. Drop the table t1 # # done # # # @@ -21,14 +21,14 @@ # has to be set before sourcing this routine. # # Example: # # let $unique= , UNIQUE INDEX uidx1 (f_int1); # -# include/partition_method1s.inc # +# inc/partition_method1s.inc # # # -# Attention: The routine include/partition_methods2.inc is very similar # +# Attention: The routine inc/partition_methods2.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: HH # # Change Date: 2006-05-12 # @@ -66,7 +66,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -107,7 +106,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -143,7 +141,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -180,7 +177,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -212,7 +208,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -247,7 +242,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -299,7 +293,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc @@ -329,7 +322,6 @@ $partitioning; --enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc let $with_directories= FALSE; diff --git a/mysql-test/suite/parts/inc/partition_methods2.inc b/mysql-test/suite/parts/inc/partition_methods2.inc index 31b083bfa7a..91821d620b6 100644 --- a/mysql-test/suite/parts/inc/partition_methods2.inc +++ b/mysql-test/suite/parts/inc/partition_methods2.inc @@ -1,5 +1,5 @@ ################################################################################ -# include/partition_methods2.inc # +# inc/partition_methods2.inc # # # # Purpose: # # Create and check partitioned tables # @@ -10,7 +10,7 @@ # do # # 1. Create the partitioned table # # 2 Insert the content of the table t0_template into t1 # -# 3. Execute include/partition_check.inc # +# 3. Execute inc/partition_check.inc # # 4. Drop the table t1 # # done # # # @@ -20,14 +20,14 @@ # has to be set before sourcing this routine. # # Example: # # let $unique= , UNIQUE INDEX uidx1 (f_int1); # -# include/partition_methods2.inc # +# inc/partition_methods2.inc # # # -# Attention: The routine include/partition_methods1.inc is very similar # +# Attention: The routine inc/partition_methods1.inc is very similar # # to this one. So if something has to be changed here it # # might be necessary to do it also there # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -51,7 +51,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY KEY @@ -66,7 +65,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY LIST @@ -89,7 +87,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY RANGE @@ -113,7 +110,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH @@ -136,7 +132,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY @@ -162,7 +157,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY LIST -- SUBPARTITION BY HASH @@ -185,7 +179,6 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; #----------- PARTITION BY LIST -- SUBPARTITION BY KEY @@ -208,5 +201,4 @@ $unique $partitioning; eval $insert_all; --source suite/parts/inc/partition_check.inc -# --source include/partition_check.inc DROP TABLE t1; diff --git a/mysql-test/suite/parts/inc/partition_set.inc b/mysql-test/suite/parts/inc/partition_set.inc index 292a28e7e1a..b9501ad04b6 100644 --- a/mysql-test/suite/parts/inc/partition_set.inc +++ b/mysql-test/suite/parts/inc/partition_set.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and set data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = diff --git a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc index 0f30fd199f8..d9c1f5836f0 100644 --- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc +++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc @@ -234,7 +234,6 @@ subpartition by hash($sqlfunc) subpartitions 5 let $t5=t5; let $t6=t6; --source suite/parts/inc/part_supported_sql_funcs_delete.inc - # --source include/part_supported_sql_funcs_delete.inc let $t1=t11; let $t2=t22; @@ -243,7 +242,6 @@ subpartition by hash($sqlfunc) subpartitions 5 let $t5=t55; let $t6=t66; --source suite/parts/inc/part_supported_sql_funcs_delete.inc - # --source include/part_supported_sql_funcs_delete.inc --echo ------------------------- --echo ---- some alter table end --echo ------------------------- diff --git a/mysql-test/suite/parts/inc/partition_syntax.inc b/mysql-test/suite/parts/inc/partition_syntax.inc index 26bf57f3ef2..e72aad80f0a 100644 --- a/mysql-test/suite/parts/inc/partition_syntax.inc +++ b/mysql-test/suite/parts/inc/partition_syntax.inc @@ -1,11 +1,11 @@ ################################################################################ -# include/partition_syntax.inc # +# inc/partition_syntax.inc # # # # Purpose: # # Tests around Create partitioned tables syntax # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -107,17 +107,13 @@ let $unique_index= UNIQUE INDEX (f_int2); #----------- PARTITION BY HASH let $partition_scheme= PARTITION BY HASH(f_int1) PARTITIONS 2; --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc let $partition_scheme= PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2; --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc #----------- PARTITION BY KEY let $partition_scheme= PARTITION BY KEY(f_int1) PARTITIONS 2; --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc let $partition_scheme= PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2; --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc #----------- PARTITION BY LIST let $partition_scheme= PARTITION BY LIST(MOD(f_int1,3)) (PARTITION partN VALUES IN (NULL), @@ -125,25 +121,21 @@ let $partition_scheme= PARTITION BY LIST(MOD(f_int1,3)) PARTITION part1 VALUES IN (1), PARTITION part2 VALUES IN (2)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc let $partition_scheme= PARTITION BY LIST(MOD(f_int1 + f_int2,3)) (PARTITION partN VALUES IN (NULL), PARTITION part0 VALUES IN (0), PARTITION part1 VALUES IN (1), PARTITION part2 VALUES IN (2)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc #----------- PARTITION BY RANGE let $partition_scheme= PARTITION BY RANGE(f_int1) (PARTITION part1 VALUES LESS THAN (1), PARTITION part2 VALUES LESS THAN (2147483646)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc let $partition_scheme= PARTITION BY RANGE(f_int1 + f_int2) (PARTITION part1 VALUES LESS THAN (1), PARTITION part2 VALUES LESS THAN (2147483646)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc # --echo #------------------------------------------------------------------------ @@ -200,14 +192,12 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES LESS THAN (1), PARTITION part2 VALUES LESS THAN (2147483646)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY let $partition_scheme= PARTITION BY RANGE(f_int2) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES LESS THAN (1), PARTITION part2 VALUES LESS THAN (2147483646)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc #----------- PARTITION BY LIST -- SUBPARTITION BY HASH let $partition_scheme= PARTITION BY LIST(MOD(f_int2,3)) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 @@ -216,7 +206,6 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 PARTITION part1 VALUES IN (1), PARTITION part2 VALUES IN (2)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc #----------- PARTITION BY LIST -- SUBPARTITION BY KEY let $partition_scheme= PARTITION BY LIST(MOD(f_int2,3)) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 2 @@ -225,7 +214,6 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 2 PARTITION part1 VALUES IN (1), PARTITION part2 VALUES IN (2)); --source suite/parts/inc/partition_syntax_2.inc -# --source include/partition_syntax_2.inc --echo --echo #======================================================================== @@ -359,7 +347,6 @@ PARTITION BY LIST(MOD(f_int1,2)) ( PARTITION part1 VALUES IN (NULL), PARTITION part3 VALUES IN (1)); --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc DROP TABLE t1; --echo # 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0) # Bug#15447: Partitions: NULL is treated as zero @@ -372,7 +359,6 @@ PARTITION BY LIST(MOD(f_int1,2)) PARTITION part2 VALUES IN (0), PARTITION part3 VALUES IN (1)); --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc DROP TABLE t1; # FIXME Implement some non integer constant tests @@ -395,7 +381,6 @@ $column_list ) PARTITION BY HASH(f_int1); --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc DROP TABLE t1; --echo # 4.1.2 no partition number, named partitions eval CREATE TABLE t1 ( @@ -403,7 +388,6 @@ $column_list ) PARTITION BY HASH(f_int1) (PARTITION part1, PARTITION part2); --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc DROP TABLE t1; # Attention: Several combinations are impossible # If subpartitioning exists @@ -470,7 +454,6 @@ eval $part01 $column_list $part02 $part1_Y $part2_N $part3_Y ; eval $part01 $column_list $part02 $part1_Y $part2_Y $part3_N ; eval $part01 $column_list $part02 $part1_Y $part2_Y $part3_Y ; --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc DROP TABLE t1; --echo #------------------------------------------------------------------------ @@ -480,163 +463,119 @@ DROP TABLE t1; DROP TABLE IF EXISTS t1; --enable_warnings --echo # 4.2.1 partition/subpartition numbers INTEGER notation -# ML: "positive/negative" is my private judgement. It need no to correspond -# with the server response. +# mleich: "positive/negative" is my private judgement. It need not to +# correspond with the server response. # (positive) number = 2 let $part_number= 2; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (positive) special case number = 1 let $part_number= 1; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) 0 is non sense let $part_number= 0; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) -1 is non sense let $part_number= -1; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) 1000000 is too huge let $part_number= 1000000; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc --echo # 4.2.2 partition/subpartition numbers DECIMAL notation # (positive) number = 2.0 let $part_number= 2.0; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) -2.0 is non sense let $part_number= -2.0; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) case number = 0.0 is non sense let $part_number= 0.0; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -if ($fixed_bug15890) -{ # Bug#15890 Partitions: Strange interpretation of partition number # (negative) number = 1.6 is non sense let $part_number= 1.6; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -} # (negative) number is too huge let $part_number= 999999999999999999999999999999.999999999999999999999999999999; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) number is nearly zero let $part_number= 0.000000000000000000000000000001; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc --echo # 4.2.3 partition/subpartition numbers FLOAT notation ##### FLOAT notation # (positive) number = 2.0E+0 let $part_number= 2.0E+0; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -if ($fixed_bug15890) -{ # Bug#15890 Partitions: Strange interpretation of partition number # (positive) number = 0.2E+1 let $part_number= 0.2E+1; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -} # (negative) -2.0E+0 is non sense let $part_number= -2.0E+0; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -if ($fixed_bug15890) -{ # Bug#15890 Partitions: Strange interpretation of partition number # (negative) 0.16E+1 is non sense let $part_number= 0.16E+1; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -} # (negative) 0.0E+300 is zero let $part_number= 0.0E+300; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -if ($fixed_bug15890) -{ # Bug#15890 Partitions: Strange interpretation of partition number # (negative) 1E+300 is too huge let $part_number= 1E+300; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) 1E-300 is nearly zero let $part_number= 1E-300; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc -} --echo # 4.2.4 partition/subpartition numbers STRING notation ##### STRING notation # (negative?) case number = '2' let $part_number= '2'; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative?) case number = '2.0' let $part_number= '2.0'; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative?) case number = '0.2E+1' let $part_number= '0.2E+1'; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) Strings starts with digit, but 'A' follows let $part_number= '2A'; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) Strings starts with 'A', but digit follows let $part_number= 'A2'; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) empty string let $part_number= ''; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) string without any digits let $part_number= 'GARBAGE'; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc --echo # 4.2.5 partition/subpartition numbers other notations # (negative) Strings starts with digit, but 'A' follows let $part_number= 2A; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) Strings starts with 'A', but digit follows let $part_number= A2; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) string without any digits let $part_number= GARBAGE; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative?) double quotes let $part_number= "2"; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) Strings starts with digit, but 'A' follows let $part_number= "2A"; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) Strings starts with 'A', but digit follows let $part_number= "A2"; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc # (negative) string without any digits let $part_number= "GARBAGE"; --source suite/parts/inc/partition_syntax_1.inc -# --source include/partition_syntax_1.inc --echo # 4.2.6 (negative) partition/subpartition numbers per @variables SET @aux = 5; @@ -665,7 +604,6 @@ $column_list ) PARTITION BY HASH(f_int1) PARTITIONS 2 ( PARTITION part1, PARTITION part2 ) ; --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc DROP TABLE t1; eval CREATE TABLE t1 ( $column_list @@ -678,7 +616,6 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 (SUBPARTITION subpart21, SUBPARTITION subpart22) ); --source suite/parts/inc/partition_layout_check1.inc -# --source include/partition_layout_check1.inc DROP TABLE t1; --echo # 4.3.2 (positive) number of partition/subpartition , --echo # 0 (= no) named partition/subpartition diff --git a/mysql-test/suite/parts/inc/partition_syntax_1.inc b/mysql-test/suite/parts/inc/partition_syntax_1.inc index 79fdcdf1b91..a7168b6af3b 100644 --- a/mysql-test/suite/parts/inc/partition_syntax_1.inc +++ b/mysql-test/suite/parts/inc/partition_syntax_1.inc @@ -1,8 +1,8 @@ ################################################################################ -# include/partition_syntax_1.inc # +# inc/partition_syntax_1.inc # # # # Purpose: # -# Auxiliary script, only useful when sourced by include/partition_syntax.inc # +# Auxiliary script, only useful when sourced by inc/partition_syntax.inc # # # # Try to create a table with number of partitions/subpartitions # # = $part_number. Print the layout of the table and drop it. # @@ -29,16 +29,13 @@ PARTITION BY HASH(f_int1) PARTITIONS $part_number; eval SET @my_errno= $mysql_errno ; let $run= `SELECT @my_errno = 0`; # Expected error codes are -# 0 -# 1064 ER_PARSE_ERROR -# Reason: assign -1 partitions -# 1498 ER_TOO_MANY_PARTITIONS_ERROR -# 1503 ER_NO_PARTS_ERROR -let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1498,1503)`; -if ($unexpected_error) +# 0, ER_PARSE_ERROR (Reason: assign -1 partitions), ER_TOO_MANY_PARTITIONS_ERROR +# and ER_NO_PARTS_ERROR +if (`SELECT @my_errno NOT IN (0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR, + $ER_NO_PARTS_ERROR)`) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1064,1498,1503 + --echo # Expected/handled SQL codes are 0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,$ER_NO_PARTS_ERROR SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; @@ -50,7 +47,6 @@ if ($unexpected_error) if ($run) { --source suite/parts/inc/partition_layout_check1.inc - # --source include/partition_layout_check1.inc eval DROP TABLE t1; } #### Try to create a table with the given subpartition number @@ -67,16 +63,13 @@ SUBPARTITIONS $part_number eval SET @my_errno= $mysql_errno ; let $run= `SELECT @my_errno = 0`; # Expected error codes are -# 0 -# 1064 ER_PARSE_ERROR -# Reason: assign -1 partitions -# 1498 ER_TOO_MANY_PARTITIONS_ERROR -# 1503 ER_NO_PARTS_ERROR -let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1498,1503)`; -if ($unexpected_error) +# 0, ER_PARSE_ERROR (Reason: assign -1 partitions), ER_TOO_MANY_PARTITIONS_ERROR +# and ER_NO_PARTS_ERROR +if (`SELECT @my_errno NOT IN (0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR, + $ER_NO_PARTS_ERROR)`) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1064,1498,1503 + --echo # Expected/handled SQL codes are 0,$ER_PARSE_ERROR,$ER_TOO_MANY_PARTITIONS_ERROR,$ER_NO_PARTS_ERROR SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; @@ -88,6 +81,5 @@ if ($unexpected_error) if ($run) { --source suite/parts/inc/partition_layout_check1.inc - # --source include/partition_layout_check1.inc eval DROP TABLE t1; } diff --git a/mysql-test/suite/parts/inc/partition_syntax_2.inc b/mysql-test/suite/parts/inc/partition_syntax_2.inc index 9adf1c9b2a0..b8e728ee79b 100644 --- a/mysql-test/suite/parts/inc/partition_syntax_2.inc +++ b/mysql-test/suite/parts/inc/partition_syntax_2.inc @@ -1,11 +1,11 @@ ################################################################################ -# include/partition_syntax_2.inc # +# inc/partition_syntax_2.inc # # # # Purpose: # -# Auxiliary script, only useful when sourced by include/partition_syntax.inc.# +# Auxiliary script, only useful when sourced by inc/partition_syntax.inc. # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-05-11 # # Change Author: # # Change Date: # @@ -35,11 +35,7 @@ if (`SELECT @@session.storage_engine IN('ndbcluster')`) ) $partition_scheme; eval $insert_all; - if ($fixed_bug18735) - { --source suite/parts/inc/partition_check.inc - # --source include/partition_check.inc - } DROP TABLE t1; eval CREATE TABLE t1 ( $column_list, @@ -47,10 +43,6 @@ if (`SELECT @@session.storage_engine IN('ndbcluster')`) ) $partition_scheme; eval $insert_all; - if ($fixed_bug18735) - { --source suite/parts/inc/partition_check.inc - # --source include/partition_check.inc - } DROP TABLE t1; } diff --git a/mysql-test/suite/parts/inc/partition_text.inc b/mysql-test/suite/parts/inc/partition_text.inc index a655552c457..761f5dfb118 100644 --- a/mysql-test/suite/parts/inc/partition_text.inc +++ b/mysql-test/suite/parts/inc/partition_text.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and text data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = @@ -53,4 +55,3 @@ partition by key (a) partitions 30; #select count(*) from t2; #select * from t2; #drop table t2; - diff --git a/mysql-test/suite/parts/inc/partition_trigg1.inc b/mysql-test/suite/parts/inc/partition_trigg1.inc index 7ebf2f411d3..7bb5aa162a9 100644 --- a/mysql-test/suite/parts/inc/partition_trigg1.inc +++ b/mysql-test/suite/parts/inc/partition_trigg1.inc @@ -1,8 +1,8 @@ ################################################################################ -# include/partition_trigg1.inc # +# inc/partition_trigg1.inc # # # # Purpose: # -# Auxiliary script, only useful when sourced by include/partition_check.inc. # +# Auxiliary script, only useful when sourced by inc/partition_check.inc. # # One trigger uses new values (--> event UPDATE, INSERT only) # # One trigger uses old values (--> event UPDATE, DELETE only) # # # @@ -12,7 +12,7 @@ # 4. Revert the modifications # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -45,7 +45,7 @@ if ($run1) eval $statement; - # Check of preceeding statement via Select + # Check of preceding statement via Select if ($no_debug) { --disable_query_log @@ -94,7 +94,7 @@ if ($run1) eval $statement; - # Check of preceeding statement via Select + # Check of preceding statement via Select if ($no_debug) { --disable_query_log diff --git a/mysql-test/suite/parts/inc/partition_trigg2.inc b/mysql-test/suite/parts/inc/partition_trigg2.inc index 767dbd52e47..2849ca21ff0 100644 --- a/mysql-test/suite/parts/inc/partition_trigg2.inc +++ b/mysql-test/suite/parts/inc/partition_trigg2.inc @@ -1,8 +1,8 @@ ################################################################################ -# include/partition_trigg2.inc # +# inc/partition_trigg2.inc # # # # Purpose: # -# Auxiliary script, only useful when sourced by include/partition_check.inc. # +# Auxiliary script, only useful when sourced by inc/partition_check.inc. # # The trigger uses new values (--> event UPDATE, INSERT only) # # # # 1. Create a trigger # @@ -11,7 +11,7 @@ # 4. Revert the modifications # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -27,7 +27,7 @@ BEGIN END| delimiter ;| eval $statement; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log diff --git a/mysql-test/suite/parts/inc/partition_trigg3.inc b/mysql-test/suite/parts/inc/partition_trigg3.inc index a129cf75a1d..b56847ada44 100644 --- a/mysql-test/suite/parts/inc/partition_trigg3.inc +++ b/mysql-test/suite/parts/inc/partition_trigg3.inc @@ -1,8 +1,8 @@ -############################################################################### -# include/partition_trigg3.inc # +################################################################################ +# inc/partition_trigg3.inc # # # # Purpose: # -# Auxiliary script, only useful when sourced by include/partition_check.inc. # +# Auxiliary script, only useful when sourced by inc/partition_check.inc. # # The trigger uses new values (--> event UPDATE, INSERT only) # # # # 1. Create a trigger # @@ -11,23 +11,13 @@ # 4. Revert the modifications # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # # Change: # ################################################################################ -# include/partition_trigg3.inc -# -# Auxiliary script, only useful when sourced by include/partition_check.inc. -# -# 1. Create a trigger -# 2. Execute a statement, which activates the trigger -# 3. Check the results of the trigger activity -# 4. Revert the modifications -# - delimiter |; # Original version of the trigger # eval CREATE TRIGGER trg_3 $event ON t1 FOR EACH ROW @@ -55,20 +45,12 @@ END| delimiter ;| # Additional statements because of Bug(limitation)#17704 SET @counter = 1; -if ($fixed_bug18730) -{ # Bug#18730 Partitions: NDB, crash on SELECT MIN(<unique column>) SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -} -if (!$fixed_bug18730) -{ -# Bug#18730 Partitions: NDB, crash on SELECT MIN(<unique column>) -SELECT @max_row, 1 INTO @my_max1,@my_min2; -} # Additional statements end eval $statement; DROP TRIGGER trg_3; -# Check of preceeding statement via Select +# Check of preceding statement via Select if ($no_debug) { --disable_query_log diff --git a/mysql-test/suite/parts/inc/partition_value.inc b/mysql-test/suite/parts/inc/partition_value.inc index 58691752bdf..3e25e740de6 100644 --- a/mysql-test/suite/parts/inc/partition_value.inc +++ b/mysql-test/suite/parts/inc/partition_value.inc @@ -1,11 +1,11 @@ ################################################################################ -# include/partition_value.inc # +# inc/partition_value.inc # # # # Purpose: # # Tests around "exotic" values calculated by the partitioning function # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # diff --git a/mysql-test/suite/parts/inc/partition_varbinary.inc b/mysql-test/suite/parts/inc/partition_varbinary.inc index b112cbe312e..48fd6d890d8 100644 --- a/mysql-test/suite/parts/inc/partition_varbinary.inc +++ b/mysql-test/suite/parts/inc/partition_varbinary.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and varbinary data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = diff --git a/mysql-test/suite/parts/inc/partition_varchar.inc b/mysql-test/suite/parts/inc/partition_varchar.inc index 1cd33fa49da..c018a16e919 100644 --- a/mysql-test/suite/parts/inc/partition_varchar.inc +++ b/mysql-test/suite/parts/inc/partition_varchar.inc @@ -1,3 +1,5 @@ +--echo ---- Partitioning and varchar data type + --disable_query_log # DATA DIRECTORY eval SET @data_dir = 'DATA DIRECTORY = diff --git a/mysql-test/suite/parts/r/partition_alter1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_innodb.result index 84765c14e16..a1d40af196c 100644 --- a/mysql-test/suite/parts/r/partition_alter1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_innodb.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -386,7 +381,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -857,7 +852,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -875,7 +870,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1346,7 +1341,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1372,7 +1367,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1843,7 +1838,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1867,7 +1862,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2336,7 +2331,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2358,7 +2353,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2829,7 +2824,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2855,7 +2850,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3324,7 +3319,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3350,7 +3345,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3821,7 +3816,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3843,7 +3838,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4314,7 +4309,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -4333,7 +4328,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4804,7 +4799,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4822,7 +4817,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5293,7 +5288,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5319,7 +5314,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5790,7 +5785,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5814,7 +5809,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6283,7 +6278,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6305,7 +6300,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6776,7 +6771,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6802,7 +6797,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7271,7 +7266,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7297,7 +7292,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7768,7 +7763,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7790,7 +7785,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8261,7 +8256,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.1.4 UNIQUE INDEX consisting of two columns DROP TABLE IF EXISTS t1; @@ -8281,7 +8276,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8768,7 +8763,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8786,7 +8781,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9273,7 +9268,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9299,7 +9294,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9786,7 +9781,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9810,7 +9805,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10295,7 +10290,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10317,7 +10312,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10804,7 +10799,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10830,7 +10825,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11315,7 +11310,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11341,7 +11336,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11828,7 +11823,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11850,7 +11845,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12337,7 +12332,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -12356,7 +12351,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12843,7 +12838,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12861,7 +12856,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13348,7 +13343,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13374,7 +13369,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13861,7 +13856,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13885,7 +13880,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14370,7 +14365,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14392,7 +14387,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14879,7 +14874,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14905,7 +14900,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15390,7 +15385,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15416,7 +15411,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15903,7 +15898,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15925,7 +15920,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16412,7 +16407,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 1.2 ADD PRIMARY KEY or UNIQUE INDEX to table with two columns @@ -16436,7 +16431,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16907,7 +16902,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16925,7 +16920,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17396,7 +17391,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17422,7 +17417,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17893,7 +17888,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17917,7 +17912,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18386,7 +18381,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18408,7 +18403,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18877,7 +18872,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18903,7 +18898,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19372,7 +19367,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19398,7 +19393,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19869,7 +19864,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19891,7 +19886,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20362,7 +20357,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -20381,7 +20376,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20852,7 +20847,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20870,7 +20865,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21341,7 +21336,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21367,7 +21362,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21838,7 +21833,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21862,7 +21857,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22331,7 +22326,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22353,7 +22348,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22822,7 +22817,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22848,7 +22843,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23317,7 +23312,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23343,7 +23338,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23814,7 +23809,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23836,7 +23831,7 @@ ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24307,7 +24302,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.2.2 UNIQUE INDEX consisting of two columns DROP TABLE IF EXISTS t1; @@ -24327,7 +24322,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24814,7 +24809,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24832,7 +24827,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25319,7 +25314,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25345,7 +25340,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25832,7 +25827,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25856,7 +25851,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26341,7 +26336,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26363,7 +26358,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26848,7 +26843,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26874,7 +26869,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27359,7 +27354,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27385,7 +27380,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27872,7 +27867,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27894,7 +27889,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28381,7 +28376,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -28400,7 +28395,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28887,7 +28882,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28905,7 +28900,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29392,7 +29387,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29418,7 +29413,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29905,7 +29900,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29929,7 +29924,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30414,7 +30409,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30436,7 +30431,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30921,7 +30916,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30947,7 +30942,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31432,7 +31427,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31458,7 +31453,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31945,7 +31940,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31967,7 +31962,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32454,7 +32449,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.2.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns DROP TABLE IF EXISTS t1; @@ -32474,7 +32469,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32946,7 +32941,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32964,7 +32959,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33436,7 +33431,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33462,7 +33457,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33934,7 +33929,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33958,7 +33953,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34428,7 +34423,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34450,7 +34445,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34920,7 +34915,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34946,7 +34941,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35416,7 +35411,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35442,7 +35437,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35914,7 +35909,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35936,7 +35931,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36408,7 +36403,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -36427,7 +36422,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36899,7 +36894,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36917,7 +36912,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37389,7 +37384,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37415,7 +37410,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37887,7 +37882,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37911,7 +37906,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38381,7 +38376,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -38403,7 +38398,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38873,7 +38868,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -38899,7 +38894,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39369,7 +39364,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39395,7 +39390,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39867,7 +39862,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39889,7 +39884,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40361,7 +40356,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -40380,7 +40375,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40852,7 +40847,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -40870,7 +40865,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41342,7 +41337,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41368,7 +41363,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41840,7 +41835,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41864,7 +41859,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42334,7 +42329,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -42356,7 +42351,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42826,7 +42821,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -42852,7 +42847,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43322,7 +43317,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -43348,7 +43343,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43820,7 +43815,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -43842,7 +43837,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -44314,7 +44309,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #======================================================================== @@ -44341,7 +44336,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -44760,7 +44755,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -44778,7 +44773,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -45197,7 +45192,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -45223,7 +45218,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -45642,7 +45637,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -45666,7 +45661,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -46083,7 +46078,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -46105,7 +46100,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -46524,7 +46519,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -46550,7 +46545,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -46967,7 +46962,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -46993,7 +46988,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -47412,7 +47407,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -47434,7 +47429,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -47853,7 +47848,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -47872,7 +47867,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -48291,7 +48286,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -48309,7 +48304,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -48728,7 +48723,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -48754,7 +48749,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -49173,7 +49168,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -49197,7 +49192,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -49614,7 +49609,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -49636,7 +49631,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -50055,7 +50050,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -50081,7 +50076,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -50498,7 +50493,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -50524,7 +50519,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -50943,7 +50938,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -50965,7 +50960,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -51384,7 +51379,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -51403,7 +51398,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -51838,7 +51833,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -51856,7 +51851,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -52291,7 +52286,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -52317,7 +52312,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -52752,7 +52747,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -52776,7 +52771,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -53209,7 +53204,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -53231,7 +53226,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -53666,7 +53661,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -53692,7 +53687,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -54125,7 +54120,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -54151,7 +54146,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -54586,7 +54581,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -54608,7 +54603,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -55043,7 +55038,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2.2 Partitioning function contains two columns (f_int1,f_int2) @@ -55066,7 +55061,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -55485,7 +55480,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -55503,7 +55498,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -55922,7 +55917,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -55948,7 +55943,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -56367,7 +56362,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -56391,7 +56386,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -56808,7 +56803,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -56830,7 +56825,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -57247,7 +57242,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -57273,7 +57268,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -57690,7 +57685,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -57716,7 +57711,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -58135,7 +58130,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -58157,7 +58152,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -58576,7 +58571,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -58595,7 +58590,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -59014,7 +59009,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -59032,7 +59027,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -59451,7 +59446,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -59477,7 +59472,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -59896,7 +59891,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -59920,7 +59915,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -60337,7 +60332,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -60359,7 +60354,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -60776,7 +60771,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -60802,7 +60797,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -61219,7 +61214,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -61245,7 +61240,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -61664,7 +61659,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -61686,7 +61681,7 @@ ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -62105,7 +62100,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.2.2 DROP UNIQUE INDEX consisting of two columns DROP TABLE IF EXISTS t1; @@ -62125,7 +62120,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -62560,7 +62555,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -62578,7 +62573,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -63013,7 +63008,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -63039,7 +63034,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -63474,7 +63469,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -63498,7 +63493,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -63931,7 +63926,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -63953,7 +63948,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -64386,7 +64381,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -64412,7 +64407,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -64845,7 +64840,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -64871,7 +64866,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -65306,7 +65301,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -65328,7 +65323,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -65763,7 +65758,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -65782,7 +65777,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -66217,7 +66212,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -66235,7 +66230,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -66670,7 +66665,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -66696,7 +66691,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -67131,7 +67126,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -67155,7 +67150,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -67588,7 +67583,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -67610,7 +67605,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -68043,7 +68038,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -68069,7 +68064,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -68502,7 +68497,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -68528,7 +68523,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -68963,7 +68958,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -68985,7 +68980,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -69420,7 +69415,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.2.3 DROP PRIMARY KEY + UNIQUE INDEX consisting of two columns DROP TABLE IF EXISTS t1; @@ -69440,7 +69435,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -69859,7 +69854,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -69877,7 +69872,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -70296,7 +70291,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -70322,7 +70317,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -70741,7 +70736,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -70765,7 +70760,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -71182,7 +71177,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -71204,7 +71199,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -71621,7 +71616,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -71647,7 +71642,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -72064,7 +72059,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -72090,7 +72085,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -72509,7 +72504,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -72531,7 +72526,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -72950,7 +72945,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -72969,7 +72964,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -73388,7 +73383,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -73406,7 +73401,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -73825,7 +73820,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -73851,7 +73846,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -74270,7 +74265,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -74294,7 +74289,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -74711,7 +74706,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -74733,7 +74728,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -75150,7 +75145,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -75176,7 +75171,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -75593,7 +75588,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -75619,7 +75614,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -76038,7 +76033,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -76060,7 +76055,7 @@ ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -76479,7 +76474,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -76498,7 +76493,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -76933,7 +76928,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -76951,7 +76946,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -77386,7 +77381,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -77412,7 +77407,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -77847,7 +77842,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -77871,7 +77866,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -78304,7 +78299,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -78326,7 +78321,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -78759,7 +78754,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -78785,7 +78780,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -79218,7 +79213,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -79244,7 +79239,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -79679,7 +79674,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -79701,7 +79696,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -80136,7 +80131,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_alter1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_myisam.result index 29c5f09eb3b..1058342aa8d 100644 --- a/mysql-test/suite/parts/r/partition_alter1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_myisam.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -227,7 +222,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -724,7 +719,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -742,7 +737,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1245,7 +1240,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1271,7 +1266,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1780,7 +1775,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1804,7 +1799,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2307,7 +2302,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2329,7 +2324,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2838,7 +2833,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2864,7 +2859,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3371,7 +3366,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3397,7 +3392,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3906,7 +3901,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3928,7 +3923,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4439,7 +4434,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -4458,7 +4453,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4955,7 +4950,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4973,7 +4968,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5476,7 +5471,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5502,7 +5497,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6011,7 +6006,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6035,7 +6030,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6538,7 +6533,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6560,7 +6555,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7069,7 +7064,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7095,7 +7090,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7602,7 +7597,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7628,7 +7623,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8137,7 +8132,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8159,7 +8154,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8670,7 +8665,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 1.2 ADD PRIMARY KEY or UNIQUE INDEX to table with two columns @@ -8694,7 +8689,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9191,7 +9186,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9209,7 +9204,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9712,7 +9707,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9738,7 +9733,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10247,7 +10242,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10271,7 +10266,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10774,7 +10769,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10796,7 +10791,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11303,7 +11298,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11329,7 +11324,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11836,7 +11831,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11862,7 +11857,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12371,7 +12366,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12393,7 +12388,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12904,7 +12899,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -12923,7 +12918,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13420,7 +13415,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13438,7 +13433,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13941,7 +13936,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13967,7 +13962,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14476,7 +14471,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14500,7 +14495,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15003,7 +14998,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15025,7 +15020,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15532,7 +15527,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15558,7 +15553,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16065,7 +16060,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16091,7 +16086,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16600,7 +16595,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16622,7 +16617,7 @@ ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17133,7 +17128,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #======================================================================== @@ -17159,7 +17154,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17604,7 +17599,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17622,7 +17617,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18073,7 +18068,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18099,7 +18094,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18556,7 +18551,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18580,7 +18575,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19031,7 +19026,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19053,7 +19048,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19510,7 +19505,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19536,7 +19531,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19991,7 +19986,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20017,7 +20012,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20474,7 +20469,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20496,7 +20491,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20955,7 +20950,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2.2 Partitioning function contains two columns (f_int1,f_int2) @@ -20978,7 +20973,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21423,7 +21418,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21441,7 +21436,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21892,7 +21887,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21918,7 +21913,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22375,7 +22370,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22399,7 +22394,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22850,7 +22845,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22872,7 +22867,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23327,7 +23322,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23353,7 +23348,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23808,7 +23803,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23834,7 +23829,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24291,7 +24286,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24313,7 +24308,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24772,7 +24767,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -24791,7 +24786,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25236,7 +25231,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25254,7 +25249,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25705,7 +25700,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25731,7 +25726,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26188,7 +26183,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26212,7 +26207,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26663,7 +26658,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26685,7 +26680,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27140,7 +27135,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27166,7 +27161,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27621,7 +27616,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27647,7 +27642,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28104,7 +28099,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28126,7 +28121,7 @@ ALTER TABLE t1 DROP INDEX uidx1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28585,7 +28580,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -28604,7 +28599,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29049,7 +29044,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29067,7 +29062,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29518,7 +29513,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29544,7 +29539,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30001,7 +29996,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30025,7 +30020,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30476,7 +30471,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30498,7 +30493,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30953,7 +30948,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30979,7 +30974,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31434,7 +31429,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31460,7 +31455,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31917,7 +31912,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31939,7 +31934,7 @@ ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32398,7 +32393,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_alter2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_innodb.result index 833e82c6a89..0bb44bb2a1d 100644 --- a/mysql-test/suite/parts/r/partition_alter2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_innodb.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -68,7 +63,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -503,7 +498,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -521,7 +516,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -956,7 +951,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -982,7 +977,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1417,7 +1412,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1441,7 +1436,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1874,7 +1869,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1896,7 +1891,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2331,7 +2326,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2357,7 +2352,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2790,7 +2785,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2816,7 +2811,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3251,7 +3246,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3273,7 +3268,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3708,7 +3703,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.1.2 PRIMARY KEY exists DROP TABLE IF EXISTS t1; @@ -3728,7 +3723,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4199,7 +4194,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4217,7 +4212,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4688,7 +4683,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4714,7 +4709,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5185,7 +5180,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5209,7 +5204,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5678,7 +5673,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5700,7 +5695,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6171,7 +6166,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6197,7 +6192,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6666,7 +6661,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6692,7 +6687,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7163,7 +7158,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7185,7 +7180,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7656,7 +7651,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -7675,7 +7670,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8146,7 +8141,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8164,7 +8159,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8635,7 +8630,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8661,7 +8656,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9132,7 +9127,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9156,7 +9151,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9625,7 +9620,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9647,7 +9642,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10118,7 +10113,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10144,7 +10139,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10613,7 +10608,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10639,7 +10634,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11110,7 +11105,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11132,7 +11127,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11603,7 +11598,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.1.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -11623,7 +11618,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12110,7 +12105,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12128,7 +12123,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12615,7 +12610,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12641,7 +12636,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13128,7 +13123,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13152,7 +13147,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13637,7 +13632,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13659,7 +13654,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14146,7 +14141,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14172,7 +14167,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14657,7 +14652,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14683,7 +14678,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15170,7 +15165,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15192,7 +15187,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15679,7 +15674,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -15698,7 +15693,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16185,7 +16180,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16203,7 +16198,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16690,7 +16685,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16716,7 +16711,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17203,7 +17198,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17227,7 +17222,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17712,7 +17707,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17734,7 +17729,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18221,7 +18216,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18247,7 +18242,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18732,7 +18727,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18758,7 +18753,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19245,7 +19240,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19267,7 +19262,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19754,7 +19749,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 1.3 ALTER column f_int1 and f_int2 @@ -19778,7 +19773,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20213,7 +20208,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20231,7 +20226,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20666,7 +20661,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20692,7 +20687,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21127,7 +21122,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21151,7 +21146,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21584,7 +21579,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21606,7 +21601,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22041,7 +22036,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22067,7 +22062,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22500,7 +22495,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22526,7 +22521,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22961,7 +22956,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22983,7 +22978,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23418,7 +23413,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -23437,7 +23432,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23872,7 +23867,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23890,7 +23885,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24325,7 +24320,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24351,7 +24346,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24786,7 +24781,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24810,7 +24805,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25243,7 +25238,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25265,7 +25260,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25698,7 +25693,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25724,7 +25719,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26157,7 +26152,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26183,7 +26178,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26618,7 +26613,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26640,7 +26635,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27075,7 +27070,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.3.2 PRIMARY KEY exists DROP TABLE IF EXISTS t1; @@ -27095,7 +27090,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27566,7 +27561,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27584,7 +27579,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28055,7 +28050,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28081,7 +28076,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28552,7 +28547,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28576,7 +28571,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29045,7 +29040,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29067,7 +29062,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29538,7 +29533,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29564,7 +29559,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30033,7 +30028,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30059,7 +30054,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30530,7 +30525,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30552,7 +30547,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31023,7 +31018,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -31042,7 +31037,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31513,7 +31508,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31531,7 +31526,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32002,7 +31997,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32028,7 +32023,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32499,7 +32494,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32523,7 +32518,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32992,7 +32987,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33014,7 +33009,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33483,7 +33478,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33509,7 +33504,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33978,7 +33973,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34004,7 +33999,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34475,7 +34470,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34497,7 +34492,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34968,7 +34963,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -34987,7 +34982,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35458,7 +35453,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35476,7 +35471,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35947,7 +35942,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35973,7 +35968,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36444,7 +36439,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36468,7 +36463,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36937,7 +36932,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36959,7 +36954,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37430,7 +37425,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37456,7 +37451,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37925,7 +37920,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37951,7 +37946,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38422,7 +38417,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -38444,7 +38439,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38915,7 +38910,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -38934,7 +38929,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39405,7 +39400,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39423,7 +39418,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39894,7 +39889,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39920,7 +39915,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40391,7 +40386,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -40415,7 +40410,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40884,7 +40879,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -40906,7 +40901,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41375,7 +41370,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41401,7 +41396,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41870,7 +41865,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41896,7 +41891,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42367,7 +42362,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -42389,7 +42384,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42860,7 +42855,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.3.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -42880,7 +42875,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43367,7 +43362,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -43385,7 +43380,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43872,7 +43867,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -43898,7 +43893,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -44385,7 +44380,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -44409,7 +44404,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -44894,7 +44889,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -44916,7 +44911,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -45403,7 +45398,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -45429,7 +45424,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -45914,7 +45909,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -45940,7 +45935,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -46427,7 +46422,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -46449,7 +46444,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -46936,7 +46931,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -46955,7 +46950,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -47442,7 +47437,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -47460,7 +47455,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -47947,7 +47942,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -47973,7 +47968,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -48460,7 +48455,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -48484,7 +48479,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -48969,7 +48964,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -48991,7 +48986,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -49476,7 +49471,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -49502,7 +49497,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -49987,7 +49982,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -50013,7 +50008,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -50500,7 +50495,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -50522,7 +50517,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -51009,7 +51004,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -51028,7 +51023,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -51515,7 +51510,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -51533,7 +51528,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -52020,7 +52015,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -52046,7 +52041,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -52533,7 +52528,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -52557,7 +52552,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -53042,7 +53037,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -53064,7 +53059,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -53551,7 +53546,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -53577,7 +53572,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -54062,7 +54057,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -54088,7 +54083,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -54575,7 +54570,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -54597,7 +54592,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -55084,7 +55079,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -55103,7 +55098,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -55590,7 +55585,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -55608,7 +55603,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -56095,7 +56090,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -56121,7 +56116,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -56608,7 +56603,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -56632,7 +56627,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -57117,7 +57112,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -57139,7 +57134,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -57624,7 +57619,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -57650,7 +57645,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -58135,7 +58130,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -58161,7 +58156,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -58648,7 +58643,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -58670,7 +58665,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -59157,7 +59152,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #======================================================================== @@ -59185,7 +59180,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -59622,7 +59617,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -59640,7 +59635,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -60077,7 +60072,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -60103,7 +60098,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -60540,7 +60535,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -60564,7 +60559,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -60997,7 +60992,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -61019,7 +61014,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -61456,7 +61451,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -61482,7 +61477,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -61915,7 +61910,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -61941,7 +61936,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -62378,7 +62373,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -62400,7 +62395,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -62837,7 +62832,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -62856,7 +62851,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -63329,7 +63324,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -63347,7 +63342,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -63820,7 +63815,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -63846,7 +63841,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -64319,7 +64314,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -64343,7 +64338,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -64812,7 +64807,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -64834,7 +64829,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -65307,7 +65302,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -65333,7 +65328,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -65802,7 +65797,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -65828,7 +65823,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -66301,7 +66296,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -66323,7 +66318,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -66796,7 +66791,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -66815,7 +66810,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -67288,7 +67283,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -67306,7 +67301,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -67779,7 +67774,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -67805,7 +67800,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -68278,7 +68273,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -68302,7 +68297,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -68771,7 +68766,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -68793,7 +68788,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -69266,7 +69261,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -69292,7 +69287,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -69761,7 +69756,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -69787,7 +69782,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -70260,7 +70255,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -70282,7 +70277,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -70755,7 +70750,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.1.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -70775,7 +70770,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -71264,7 +71259,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -71282,7 +71277,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -71771,7 +71766,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -71797,7 +71792,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -72286,7 +72281,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -72310,7 +72305,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -72795,7 +72790,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -72817,7 +72812,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -73306,7 +73301,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -73332,7 +73327,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -73817,7 +73812,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -73843,7 +73838,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -74332,7 +74327,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -74354,7 +74349,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -74843,7 +74838,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -74862,7 +74857,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -75351,7 +75346,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -75369,7 +75364,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -75858,7 +75853,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -75884,7 +75879,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -76373,7 +76368,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -76397,7 +76392,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -76882,7 +76877,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -76904,7 +76899,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -77393,7 +77388,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -77419,7 +77414,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -77904,7 +77899,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -77930,7 +77925,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -78419,7 +78414,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -78441,7 +78436,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -78930,7 +78925,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2.3 ALTER column f_int1 and f_int2 used in partitioning function @@ -78953,7 +78948,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -79391,7 +79386,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -79409,7 +79404,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -79847,7 +79842,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -79873,7 +79868,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -80311,7 +80306,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -80335,7 +80330,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -80773,7 +80768,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -80795,7 +80790,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -81233,7 +81228,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -81259,7 +81254,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -81697,7 +81692,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -81723,7 +81718,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -82161,7 +82156,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -82183,7 +82178,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -82621,7 +82616,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -82640,7 +82635,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -83078,7 +83073,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -83096,7 +83091,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -83534,7 +83529,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -83560,7 +83555,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -83998,7 +83993,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -84022,7 +84017,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -84460,7 +84455,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -84482,7 +84477,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -84920,7 +84915,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -84946,7 +84941,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -85384,7 +85379,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -85410,7 +85405,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -85848,7 +85843,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -85870,7 +85865,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -86308,7 +86303,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.3.2 PRIMARY KEY exists DROP TABLE IF EXISTS t1; @@ -86328,7 +86323,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -86802,7 +86797,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -86820,7 +86815,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -87294,7 +87289,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -87320,7 +87315,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -87794,7 +87789,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -87818,7 +87813,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -88292,7 +88287,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -88314,7 +88309,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -88788,7 +88783,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -88814,7 +88809,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -89288,7 +89283,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -89314,7 +89309,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -89788,7 +89783,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -89810,7 +89805,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -90284,7 +90279,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -90303,7 +90298,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -90777,7 +90772,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -90795,7 +90790,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -91269,7 +91264,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -91295,7 +91290,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -91769,7 +91764,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -91793,7 +91788,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -92267,7 +92262,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -92289,7 +92284,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -92763,7 +92758,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -92789,7 +92784,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -93263,7 +93258,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -93289,7 +93284,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -93763,7 +93758,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -93785,7 +93780,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -94259,7 +94254,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -94278,7 +94273,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -94752,7 +94747,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -94770,7 +94765,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -95244,7 +95239,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -95270,7 +95265,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -95744,7 +95739,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -95768,7 +95763,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -96242,7 +96237,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -96264,7 +96259,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -96738,7 +96733,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -96764,7 +96759,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -97238,7 +97233,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -97264,7 +97259,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -97738,7 +97733,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -97760,7 +97755,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -98234,7 +98229,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -98253,7 +98248,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -98727,7 +98722,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -98745,7 +98740,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -99219,7 +99214,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -99245,7 +99240,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -99719,7 +99714,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -99743,7 +99738,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -100217,7 +100212,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -100239,7 +100234,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -100713,7 +100708,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -100739,7 +100734,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -101213,7 +101208,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -101239,7 +101234,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -101713,7 +101708,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -101735,7 +101730,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -102209,7 +102204,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.3.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -102229,7 +102224,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -102719,7 +102714,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -102737,7 +102732,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -103227,7 +103222,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -103253,7 +103248,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -103743,7 +103738,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -103767,7 +103762,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -104257,7 +104252,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -104279,7 +104274,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -104769,7 +104764,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -104795,7 +104790,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -105285,7 +105280,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -105311,7 +105306,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -105801,7 +105796,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -105823,7 +105818,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -106313,7 +106308,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -106332,7 +106327,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -106822,7 +106817,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -106840,7 +106835,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -107330,7 +107325,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -107356,7 +107351,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -107846,7 +107841,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -107870,7 +107865,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -108360,7 +108355,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -108382,7 +108377,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -108872,7 +108867,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -108898,7 +108893,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -109388,7 +109383,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -109414,7 +109409,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -109904,7 +109899,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -109926,7 +109921,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -110416,7 +110411,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -110435,7 +110430,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -110925,7 +110920,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -110943,7 +110938,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -111433,7 +111428,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -111459,7 +111454,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -111949,7 +111944,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -111973,7 +111968,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -112463,7 +112458,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -112485,7 +112480,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -112975,7 +112970,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -113001,7 +112996,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -113491,7 +113486,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -113517,7 +113512,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -114007,7 +114002,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -114029,7 +114024,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -114519,7 +114514,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -114538,7 +114533,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -115028,7 +115023,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -115046,7 +115041,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -115536,7 +115531,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -115562,7 +115557,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -116052,7 +116047,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -116076,7 +116071,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -116566,7 +116561,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -116588,7 +116583,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -117078,7 +117073,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -117104,7 +117099,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -117594,7 +117589,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -117620,7 +117615,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -118110,7 +118105,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -118132,7 +118127,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -118622,7 +118617,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_alter2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_myisam.result index 65bf85e61e5..18abf7380c3 100644 --- a/mysql-test/suite/parts/r/partition_alter2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_myisam.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -68,7 +63,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -513,7 +508,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -531,7 +526,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -982,7 +977,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1008,7 +1003,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1465,7 +1460,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1489,7 +1484,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1940,7 +1935,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1962,7 +1957,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2419,7 +2414,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2445,7 +2440,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2900,7 +2895,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2926,7 +2921,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3383,7 +3378,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3405,7 +3400,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3864,7 +3859,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.1.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -3884,7 +3879,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4381,7 +4376,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4399,7 +4394,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4902,7 +4897,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4928,7 +4923,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5437,7 +5432,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5461,7 +5456,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5964,7 +5959,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5986,7 +5981,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6495,7 +6490,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6521,7 +6516,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7028,7 +7023,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7054,7 +7049,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7563,7 +7558,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7585,7 +7580,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8096,7 +8091,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -8115,7 +8110,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8612,7 +8607,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8630,7 +8625,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9133,7 +9128,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9159,7 +9154,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9668,7 +9663,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9692,7 +9687,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10195,7 +10190,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10217,7 +10212,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10726,7 +10721,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10752,7 +10747,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11259,7 +11254,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11285,7 +11280,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11794,7 +11789,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11816,7 +11811,7 @@ ALTER TABLE t1 MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12327,7 +12322,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 1.3 ALTER column f_int1 and f_int2 @@ -12351,7 +12346,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12796,7 +12791,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12814,7 +12809,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13265,7 +13260,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13291,7 +13286,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13748,7 +13743,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13772,7 +13767,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14223,7 +14218,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14245,7 +14240,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14702,7 +14697,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14728,7 +14723,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15183,7 +15178,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15209,7 +15204,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15666,7 +15661,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15688,7 +15683,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16147,7 +16142,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -16166,7 +16161,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16611,7 +16606,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16629,7 +16624,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17080,7 +17075,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17106,7 +17101,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17563,7 +17558,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17587,7 +17582,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18038,7 +18033,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18060,7 +18055,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18515,7 +18510,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18541,7 +18536,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18996,7 +18991,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19022,7 +19017,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19479,7 +19474,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19501,7 +19496,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19960,7 +19955,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.3.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -19980,7 +19975,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20477,7 +20472,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20495,7 +20490,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20998,7 +20993,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21024,7 +21019,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21533,7 +21528,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21557,7 +21552,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22060,7 +22055,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22082,7 +22077,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22591,7 +22586,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22617,7 +22612,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23124,7 +23119,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23150,7 +23145,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23659,7 +23654,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23681,7 +23676,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24192,7 +24187,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -24211,7 +24206,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24708,7 +24703,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24726,7 +24721,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25229,7 +25224,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25255,7 +25250,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25764,7 +25759,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25788,7 +25783,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26291,7 +26286,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26313,7 +26308,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26820,7 +26815,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26846,7 +26841,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27353,7 +27348,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27379,7 +27374,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27888,7 +27883,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27910,7 +27905,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28421,7 +28416,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -28440,7 +28435,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28937,7 +28932,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28955,7 +28950,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29458,7 +29453,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29484,7 +29479,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29993,7 +29988,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30017,7 +30012,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30520,7 +30515,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30542,7 +30537,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31051,7 +31046,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31077,7 +31072,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31584,7 +31579,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31610,7 +31605,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32119,7 +32114,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32141,7 +32136,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32652,7 +32647,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -32671,7 +32666,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33168,7 +33163,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33186,7 +33181,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33689,7 +33684,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33715,7 +33710,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34224,7 +34219,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34248,7 +34243,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34751,7 +34746,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34773,7 +34768,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35280,7 +35275,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35306,7 +35301,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35813,7 +35808,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35839,7 +35834,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36348,7 +36343,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36370,7 +36365,7 @@ ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36881,7 +36876,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #======================================================================== @@ -36909,7 +36904,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37356,7 +37351,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37374,7 +37369,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37827,7 +37822,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37853,7 +37848,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38312,7 +38307,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -38336,7 +38331,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38787,7 +38782,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -38809,7 +38804,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39268,7 +39263,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39294,7 +39289,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39749,7 +39744,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39775,7 +39770,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40234,7 +40229,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -40256,7 +40251,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40717,7 +40712,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.1.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -40737,7 +40732,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41236,7 +41231,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41254,7 +41249,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41759,7 +41754,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41785,7 +41780,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42296,7 +42291,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -42320,7 +42315,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42823,7 +42818,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -42845,7 +42840,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43356,7 +43351,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -43382,7 +43377,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43889,7 +43884,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -43915,7 +43910,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -44426,7 +44421,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -44448,7 +44443,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -44961,7 +44956,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -44980,7 +44975,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -45479,7 +45474,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -45497,7 +45492,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -46002,7 +45997,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -46028,7 +46023,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -46539,7 +46534,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -46563,7 +46558,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -47066,7 +47061,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -47088,7 +47083,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -47599,7 +47594,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -47625,7 +47620,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -48132,7 +48127,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -48158,7 +48153,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -48669,7 +48664,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -48691,7 +48686,7 @@ ALTER TABLE t1 MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -49204,7 +49199,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2.3 ALTER column f_int1 and f_int2 used in partitioning function @@ -49227,7 +49222,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -49675,7 +49670,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -49693,7 +49688,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -50147,7 +50142,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -50173,7 +50168,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -50633,7 +50628,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -50657,7 +50652,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -51113,7 +51108,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -51135,7 +51130,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -51595,7 +51590,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -51621,7 +51616,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -52081,7 +52076,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -52107,7 +52102,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -52567,7 +52562,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -52589,7 +52584,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -53051,7 +53046,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -53070,7 +53065,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -53518,7 +53513,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -53536,7 +53531,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -53990,7 +53985,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -54016,7 +54011,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -54476,7 +54471,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -54500,7 +54495,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -54956,7 +54951,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -54978,7 +54973,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -55438,7 +55433,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -55464,7 +55459,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -55924,7 +55919,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -55950,7 +55945,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -56410,7 +56405,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -56432,7 +56427,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -56894,7 +56889,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.3.3 UNIQUE INDEX exists DROP TABLE IF EXISTS t1; @@ -56914,7 +56909,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -57414,7 +57409,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -57432,7 +57427,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -57938,7 +57933,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -57964,7 +57959,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -58476,7 +58471,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -58500,7 +58495,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -59008,7 +59003,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -59030,7 +59025,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -59542,7 +59537,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -59568,7 +59563,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -60080,7 +60075,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -60106,7 +60101,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -60618,7 +60613,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -60640,7 +60635,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -61154,7 +61149,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -61173,7 +61168,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -61673,7 +61668,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -61691,7 +61686,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -62197,7 +62192,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -62223,7 +62218,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -62735,7 +62730,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -62759,7 +62754,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -63267,7 +63262,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -63289,7 +63284,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -63801,7 +63796,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -63827,7 +63822,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -64339,7 +64334,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -64365,7 +64360,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -64877,7 +64872,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -64899,7 +64894,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -65413,7 +65408,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -65432,7 +65427,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -65932,7 +65927,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -65950,7 +65945,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -66456,7 +66451,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -66482,7 +66477,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -66994,7 +66989,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -67018,7 +67013,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -67526,7 +67521,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -67548,7 +67543,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -68060,7 +68055,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -68086,7 +68081,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -68598,7 +68593,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -68624,7 +68619,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -69136,7 +69131,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -69158,7 +69153,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -69672,7 +69667,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -69691,7 +69686,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -70191,7 +70186,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -70209,7 +70204,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -70715,7 +70710,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -70741,7 +70736,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -71253,7 +71248,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -71277,7 +71272,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -71785,7 +71780,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -71807,7 +71802,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -72319,7 +72314,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -72345,7 +72340,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -72857,7 +72852,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -72883,7 +72878,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -73395,7 +73390,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -73417,7 +73412,7 @@ ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -73931,7 +73926,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result index 3cff9aa3b0a..2ca1e783839 100644 --- a/mysql-test/suite/parts/r/partition_alter3_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -318,7 +313,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra ALTER TABLE t1 REMOVE PARTITIONING; DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist @@ -597,7 +592,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra ALTER TABLE t1 REMOVE PARTITIONING; DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result index 8e93af1f3d0..5684ca89b1c 100644 --- a/mysql-test/suite/parts/r/partition_alter3_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result index aa8ba992808..0e6f0c22f93 100644 --- a/mysql-test/suite/parts/r/partition_alter4_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -67,7 +62,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -502,7 +497,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -520,7 +515,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -955,7 +950,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -981,7 +976,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1416,7 +1411,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1440,7 +1435,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1873,7 +1868,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1895,7 +1890,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2330,7 +2325,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2356,7 +2351,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2789,7 +2784,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2815,7 +2810,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3250,7 +3245,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3272,7 +3267,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3707,7 +3702,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.2 ALTER ... ANALYZE PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -3727,7 +3722,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4162,7 +4157,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4180,7 +4175,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4615,7 +4610,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4641,7 +4636,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5076,7 +5071,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5100,7 +5095,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5533,7 +5528,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5555,7 +5550,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5990,7 +5985,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6016,7 +6011,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6449,7 +6444,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6475,7 +6470,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6910,7 +6905,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6932,7 +6927,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7367,7 +7362,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.3 ALTER ... ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -7710,7 +7705,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8145,7 +8140,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8163,7 +8158,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8598,7 +8593,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8624,7 +8619,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9059,7 +9054,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9083,7 +9078,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9516,7 +9511,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9538,7 +9533,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9973,7 +9968,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9999,7 +9994,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10432,7 +10427,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10458,7 +10453,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10893,7 +10888,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10915,7 +10910,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11350,7 +11345,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.2 ALTER ... CHECK PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -11370,7 +11365,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11805,7 +11800,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11823,7 +11818,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12258,7 +12253,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12284,7 +12279,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12719,7 +12714,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12743,7 +12738,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13176,7 +13171,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13198,7 +13193,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13633,7 +13628,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13659,7 +13654,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14092,7 +14087,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14118,7 +14113,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14553,7 +14548,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14575,7 +14570,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15010,7 +15005,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.3 ALTER ... CHECK PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -15996,7 +15991,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16431,7 +16426,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16449,7 +16444,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16884,7 +16879,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16910,7 +16905,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17345,7 +17340,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17369,7 +17364,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17802,7 +17797,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17824,7 +17819,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18259,7 +18254,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18285,7 +18280,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18718,7 +18713,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18744,7 +18739,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19179,7 +19174,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19201,7 +19196,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19636,7 +19631,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 4.2 ALTER ... REBUILD PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -19656,7 +19651,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20091,7 +20086,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20109,7 +20104,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20544,7 +20539,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20570,7 +20565,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21005,7 +21000,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21029,7 +21024,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21462,7 +21457,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21484,7 +21479,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21919,7 +21914,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21945,7 +21940,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22378,7 +22373,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22404,7 +22399,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22839,7 +22834,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22861,7 +22856,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23296,7 +23291,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 4.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -23639,7 +23634,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24074,7 +24069,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24092,7 +24087,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24527,7 +24522,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24553,7 +24548,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24988,7 +24983,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25012,7 +25007,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25445,7 +25440,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25467,7 +25462,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25902,7 +25897,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25928,7 +25923,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26361,7 +26356,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26387,7 +26382,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26822,7 +26817,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26844,7 +26839,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27279,7 +27274,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 5.2 ALTER ... REBUILD PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -27299,7 +27294,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27734,7 +27729,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27752,7 +27747,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28187,7 +28182,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28213,7 +28208,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28648,7 +28643,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28672,7 +28667,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29105,7 +29100,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29127,7 +29122,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29562,7 +29557,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29588,7 +29583,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30021,7 +30016,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30047,7 +30042,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30482,7 +30477,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30504,7 +30499,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30939,7 +30934,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 5.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -31282,7 +31277,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31717,7 +31712,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31735,7 +31730,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32170,7 +32165,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32196,7 +32191,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32631,7 +32626,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32655,7 +32650,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33090,7 +33085,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33112,7 +33107,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33547,7 +33542,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33573,7 +33568,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34008,7 +34003,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34034,7 +34029,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34469,7 +34464,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34491,7 +34486,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34926,7 +34921,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result index 6697bb9805c..8eac8d414de 100644 --- a/mysql-test/suite/parts/r/partition_alter4_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -67,7 +62,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -512,7 +507,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -530,7 +525,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -981,7 +976,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1007,7 +1002,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1464,7 +1459,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1488,7 +1483,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1939,7 +1934,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1961,7 +1956,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2418,7 +2413,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2444,7 +2439,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2899,7 +2894,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2925,7 +2920,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3382,7 +3377,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3404,7 +3399,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3863,7 +3858,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.2 ALTER ... ANALYZE PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -3883,7 +3878,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4328,7 +4323,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4346,7 +4341,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4797,7 +4792,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4823,7 +4818,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5280,7 +5275,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5304,7 +5299,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5755,7 +5750,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5777,7 +5772,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6234,7 +6229,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6260,7 +6255,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6715,7 +6710,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6741,7 +6736,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7198,7 +7193,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7220,7 +7215,7 @@ ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7679,7 +7674,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.3 ALTER ... ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -8022,7 +8017,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8467,7 +8462,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8485,7 +8480,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8936,7 +8931,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -8962,7 +8957,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9419,7 +9414,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9443,7 +9438,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9894,7 +9889,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -9916,7 +9911,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10373,7 +10368,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10399,7 +10394,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10854,7 +10849,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10880,7 +10875,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11337,7 +11332,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11359,7 +11354,7 @@ ALTER TABLE t1 CHECK PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11818,7 +11813,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.2 ALTER ... CHECK PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -11838,7 +11833,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12283,7 +12278,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12301,7 +12296,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12752,7 +12747,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12778,7 +12773,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13235,7 +13230,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13259,7 +13254,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13710,7 +13705,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13732,7 +13727,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14189,7 +14184,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14215,7 +14210,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14670,7 +14665,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14696,7 +14691,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15153,7 +15148,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15175,7 +15170,7 @@ ALTER TABLE t1 CHECK PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15634,7 +15629,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.3 ALTER ... CHECK PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -15977,7 +15972,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16422,7 +16417,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16440,7 +16435,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16891,7 +16886,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -16917,7 +16912,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17374,7 +17369,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17398,7 +17393,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17849,7 +17844,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -17871,7 +17866,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18328,7 +18323,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18354,7 +18349,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18809,7 +18804,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -18835,7 +18830,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19292,7 +19287,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19314,7 +19309,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19773,7 +19768,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 3.2 ALTER ... OPTIMIZE PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -19793,7 +19788,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20238,7 +20233,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20256,7 +20251,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20707,7 +20702,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20733,7 +20728,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21190,7 +21185,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21214,7 +21209,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21665,7 +21660,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21687,7 +21682,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22144,7 +22139,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22170,7 +22165,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22625,7 +22620,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22651,7 +22646,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23108,7 +23103,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23130,7 +23125,7 @@ ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23589,7 +23584,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 3.3 ALTER ... OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -23932,7 +23927,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24377,7 +24372,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24395,7 +24390,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24846,7 +24841,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -24872,7 +24867,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25329,7 +25324,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25353,7 +25348,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25804,7 +25799,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -25826,7 +25821,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26283,7 +26278,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26309,7 +26304,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26764,7 +26759,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26790,7 +26785,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27247,7 +27242,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27269,7 +27264,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27728,7 +27723,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 4.2 ALTER ... REBUILD PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -27748,7 +27743,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28193,7 +28188,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28211,7 +28206,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28662,7 +28657,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28688,7 +28683,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29145,7 +29140,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29169,7 +29164,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29620,7 +29615,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29642,7 +29637,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30099,7 +30094,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30125,7 +30120,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30580,7 +30575,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30606,7 +30601,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31063,7 +31058,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31085,7 +31080,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31544,7 +31539,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 4.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -31887,7 +31882,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32332,7 +32327,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32350,7 +32345,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32801,7 +32796,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32827,7 +32822,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33284,7 +33279,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33308,7 +33303,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33759,7 +33754,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33781,7 +33776,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34238,7 +34233,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34264,7 +34259,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34719,7 +34714,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34745,7 +34740,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35202,7 +35197,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35224,7 +35219,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35683,7 +35678,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 5.2 ALTER ... REBUILD PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -35703,7 +35698,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36148,7 +36143,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36166,7 +36161,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36617,7 +36612,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36643,7 +36638,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37100,7 +37095,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37124,7 +37119,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37575,7 +37570,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -37597,7 +37592,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38054,7 +38049,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -38080,7 +38075,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -38535,7 +38530,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -38561,7 +38556,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39018,7 +39013,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39040,7 +39035,7 @@ ALTER TABLE t1 REBUILD PARTITION part_1,part_2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -39499,7 +39494,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 5.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -39842,7 +39837,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40284,7 +40279,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -40302,7 +40297,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -40744,7 +40739,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -40770,7 +40765,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41212,7 +41207,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41236,7 +41231,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -41678,7 +41673,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -41700,7 +41695,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42142,7 +42137,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -42168,7 +42163,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -42610,7 +42605,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -42636,7 +42631,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43078,7 +43073,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -43100,7 +43095,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -43542,7 +43537,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index adcac5cccad..b9097e33ce0 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -58,7 +53,7 @@ SET @@session.sql_mode= ''; DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -493,17 +488,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -938,17 +933,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1383,17 +1378,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1826,17 +1821,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2271,17 +2266,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2714,17 +2709,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3159,17 +3154,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3604,10 +3599,10 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist @@ -3615,7 +3610,7 @@ unified filelist # 1.1.1 with DATA DIECTORY/INDEX DIRECTORY INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4050,17 +4045,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4495,17 +4490,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4940,17 +4935,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5383,17 +5378,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5828,17 +5823,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6271,17 +6266,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6716,17 +6711,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7161,10 +7156,10 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist @@ -7172,7 +7167,7 @@ unified filelist DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7607,17 +7602,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8052,17 +8047,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8497,17 +8492,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8940,17 +8935,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9385,17 +9380,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9828,17 +9823,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10273,10 +10268,10 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist @@ -10294,7 +10289,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10729,7 +10724,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -10742,7 +10737,7 @@ f_charbig VARCHAR(1000) PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11177,7 +11172,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11198,7 +11193,7 @@ PARTITION part2 VALUES IN (2), PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11633,7 +11628,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11652,7 +11647,7 @@ PARTITION parte VALUES LESS THAN (20), PARTITION partf VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12085,7 +12080,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12102,7 +12097,7 @@ PARTITION partc VALUES LESS THAN (10), PARTITION partd VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12535,7 +12530,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12556,7 +12551,7 @@ PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41, SUBPARTITION subpart42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12989,7 +12984,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13010,7 +13005,7 @@ PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41, SUBPARTITION sp42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13445,7 +13440,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13462,7 +13457,7 @@ SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13897,7 +13892,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2 Tables with PRIMARY KEY and/or UNIQUE INDEXes @@ -13907,7 +13902,7 @@ DROP TABLE t1; DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14379,17 +14374,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14861,17 +14856,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15343,17 +15338,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15823,17 +15818,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16305,17 +16300,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16785,17 +16780,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17267,17 +17262,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17749,10 +17744,10 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist @@ -17760,7 +17755,7 @@ unified filelist DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18232,17 +18227,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18714,17 +18709,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19196,17 +19191,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19676,17 +19671,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20158,17 +20153,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20638,17 +20633,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21120,17 +21115,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21602,10 +21597,10 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist @@ -21613,7 +21608,7 @@ unified filelist DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22101,17 +22096,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22599,17 +22594,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23097,17 +23092,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -23593,17 +23588,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24091,17 +24086,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -24587,17 +24582,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25085,17 +25080,17 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist --- not determined --- INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -25583,10 +25578,10 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # Attention: There are unused files. -# Either the DROP TABLE or a preceeding ALTER TABLE +# Either the DROP TABLE or a preceding ALTER TABLE # <alter partitioning> worked incomplete. # We found: unified filelist @@ -25608,7 +25603,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26080,7 +26075,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26093,7 +26088,7 @@ f_charbig VARCHAR(1000) PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -26565,7 +26560,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -26586,7 +26581,7 @@ PARTITION part2 VALUES IN (2), PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27058,7 +27053,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27077,7 +27072,7 @@ PARTITION parte VALUES LESS THAN (20), PARTITION partf VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -27547,7 +27542,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27564,7 +27559,7 @@ PARTITION partc VALUES LESS THAN (10), PARTITION partd VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28034,7 +28029,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28055,7 +28050,7 @@ PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41, SUBPARTITION subpart42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -28525,7 +28520,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -28546,7 +28541,7 @@ PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41, SUBPARTITION sp42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29018,7 +29013,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -29035,7 +29030,7 @@ SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29507,7 +29502,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -29521,7 +29516,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -29993,7 +29988,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30006,7 +30001,7 @@ f_charbig VARCHAR(1000) PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30478,7 +30473,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30499,7 +30494,7 @@ PARTITION part2 VALUES IN (2), PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -30971,7 +30966,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30990,7 +30985,7 @@ PARTITION parte VALUES LESS THAN (20), PARTITION partf VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31460,7 +31455,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31477,7 +31472,7 @@ PARTITION partc VALUES LESS THAN (10), PARTITION partd VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -31947,7 +31942,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31968,7 +31963,7 @@ PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41, SUBPARTITION subpart42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32438,7 +32433,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32459,7 +32454,7 @@ PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41, SUBPARTITION sp42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -32931,7 +32926,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -32948,7 +32943,7 @@ SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33420,7 +33415,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -33434,7 +33429,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -33922,7 +33917,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -33935,7 +33930,7 @@ f_charbig VARCHAR(1000) PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34423,7 +34418,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34444,7 +34439,7 @@ PARTITION part2 VALUES IN (2), PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -34932,7 +34927,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -34951,7 +34946,7 @@ PARTITION parte VALUES LESS THAN (20), PARTITION partf VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35437,7 +35432,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35454,7 +35449,7 @@ PARTITION partc VALUES LESS THAN (10), PARTITION partd VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -35940,7 +35935,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35961,7 +35956,7 @@ PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41, SUBPARTITION subpart42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36447,7 +36442,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36468,7 +36463,7 @@ PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41, SUBPARTITION sp42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -36956,7 +36951,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -36973,7 +36968,7 @@ SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -37461,7 +37456,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result index db8918029f1..7e0d5bcd62a 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -58,7 +53,7 @@ SET @@session.sql_mode= ''; DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -503,11 +498,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -958,11 +953,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1419,11 +1414,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1874,11 +1869,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2335,11 +2330,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2794,11 +2789,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3255,11 +3250,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3718,12 +3713,12 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.1.1 with DATA DIECTORY/INDEX DIRECTORY INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3733,7 +3728,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD @@ -4164,37 +4159,37 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4204,7 +4199,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD @@ -4647,37 +4642,37 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4687,7 +4682,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD @@ -5142,37 +5137,37 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5182,7 +5177,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD @@ -5627,37 +5622,37 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5667,7 +5662,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD @@ -6122,37 +6117,37 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6162,7 +6157,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD @@ -6615,37 +6610,37 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6655,7 +6650,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD @@ -7110,37 +7105,37 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -7150,7 +7145,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD @@ -7609,38 +7604,38 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI # check layout success: 0 TRUNCATE t1; # check TRUNCATE success: 1 state new -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par state old -Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +Table definition SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_int1` int(11) DEFAULT NULL, `f_int2` int(11) DEFAULT NULL, `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI # check layout success: 0 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8085,11 +8080,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8540,11 +8535,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -8554,7 +8549,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD @@ -9001,11 +8996,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9015,7 +9010,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD @@ -9456,11 +9451,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9470,7 +9465,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD @@ -9917,11 +9912,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -9931,7 +9926,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD @@ -10376,11 +10371,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -10390,7 +10385,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD @@ -10837,7 +10832,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.2 The partitioning function contains two columns. DROP TABLE IF EXISTS t1; @@ -10852,7 +10847,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11297,7 +11292,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11310,7 +11305,7 @@ f_charbig VARCHAR(1000) PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -11761,7 +11756,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -11782,7 +11777,7 @@ PARTITION part2 VALUES IN (2), PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12239,7 +12234,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12258,7 +12253,7 @@ PARTITION parte VALUES LESS THAN (20), PARTITION partf VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -12709,7 +12704,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -12726,7 +12721,7 @@ PARTITION partc VALUES LESS THAN (10), PARTITION partd VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13181,7 +13176,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13202,7 +13197,7 @@ PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41, SUBPARTITION subpart42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -13657,7 +13652,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -13678,7 +13673,7 @@ PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41, SUBPARTITION sp42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14135,7 +14130,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -14152,7 +14147,7 @@ SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -14611,7 +14606,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2 Tables with PRIMARY KEY and/or UNIQUE INDEXes @@ -14621,7 +14616,7 @@ DROP TABLE t1; DROP TABLE IF EXISTS t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15119,11 +15114,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15627,11 +15622,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -15643,7 +15638,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD @@ -16141,11 +16136,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16157,7 +16152,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD @@ -16649,11 +16644,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -16665,7 +16660,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD @@ -17163,11 +17158,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17179,7 +17174,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD @@ -17675,11 +17670,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -17691,7 +17686,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD @@ -18189,11 +18184,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -18205,7 +18200,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/master-data/test/data/' INDEX DIRECTORY='MYSQLTEST_VARDIR/master-data/test/index/' /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD @@ -18705,7 +18700,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 3 Tables with PRIMARY KEY and/or UNIQUE INDEXes @@ -18724,7 +18719,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19222,7 +19217,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19235,7 +19230,7 @@ f_charbig VARCHAR(1000) PARTITION BY KEY(f_int1,f_int2) PARTITIONS 5; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -19739,7 +19734,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -19760,7 +19755,7 @@ PARTITION part2 VALUES IN (2), PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20270,7 +20265,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20289,7 +20284,7 @@ PARTITION parte VALUES LESS THAN (20), PARTITION partf VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -20793,7 +20788,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -20810,7 +20805,7 @@ PARTITION partc VALUES LESS THAN (10), PARTITION partd VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21318,7 +21313,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21339,7 +21334,7 @@ PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41, SUBPARTITION subpart42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -21847,7 +21842,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -21868,7 +21863,7 @@ PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41, SUBPARTITION sp42)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22378,7 +22373,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -22395,7 +22390,7 @@ SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -22907,7 +22902,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; DROP VIEW IF EXISTS v1; DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result index 2bd1b1afd2c..e5b31e0c154 100644 --- a/mysql-test/suite/parts/r/partition_bit_myisam.result +++ b/mysql-test/suite/parts/r/partition_bit_myisam.result @@ -23,7 +23,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL DEFAULT '\0', PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ drop table t1; create table t1 (a bit(64), primary key (a)) engine='MyISAM' partition by key (a) partitions 2; @@ -66,7 +66,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), diff --git a/mysql-test/suite/parts/r/partition_char_innodb.result b/mysql-test/suite/parts/r/partition_char_innodb.result index 27399a0ad41..c9609537f08 100644 --- a/mysql-test/suite/parts/r/partition_char_innodb.result +++ b/mysql-test/suite/parts/r/partition_char_innodb.result @@ -1,3 +1,4 @@ +---- Partitioning and char data type create table t1 (a char(255) not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -12,14 +13,12 @@ partition pa3 DATA DIRECTORY = partition pa4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' max_rows=40 min_rows=2); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(255) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select * from t1; a @@ -40,14 +39,12 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb drop table t1; create table t2 (a char(255) not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 27; -Warnings: -Warning 1266 Using storage engine MyISAM for table 't2' show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` char(255) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ 26 inserts; insert into t2 values (repeat(char(ascii('a')+0),26+54)); insert into t2 values (repeat(char(ascii('a')+1),25+54)); @@ -107,6 +104,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz drop table t2; +---- Partitioning and binary data type create table t1 (a binary(255) not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -121,14 +119,12 @@ partition pa3 DATA DIRECTORY = partition pa4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' max_rows=40 min_rows=2); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` binary(255) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select hex(a) from t1; hex(a) @@ -152,14 +148,12 @@ hex(a) drop table t1; create table t2 (a binary(255) not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 27; -Warnings: -Warning 1266 Using storage engine MyISAM for table 't2' show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` binary(255) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ 26 inserts; insert into t2 values (repeat(char(ascii('a')+0),26+54)); insert into t2 values (repeat(char(ascii('a')+1),25+54)); @@ -219,157 +213,7 @@ hex(a) 797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 drop table t2; -create table t3 (a binary(255) not null, primary key(a)) engine='InnoDB' -partition by range (ascii(a)) subpartition by key (a) subpartitions 4 ( -partition pa16 values less than (16), -partition pa32 values less than (32), -partition pa64 values less than (64), -partition pa128 values less than (128), -partition pa256 values less than (256) -); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't3' -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` binary(255) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (ascii(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 4 (PARTITION pa16 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION pa32 VALUES LESS THAN (32) ENGINE = MyISAM, PARTITION pa64 VALUES LESS THAN (64) ENGINE = MyISAM, PARTITION pa128 VALUES LESS THAN (128) ENGINE = MyISAM, PARTITION pa256 VALUES LESS THAN (256) ENGINE = MyISAM) */ -26 inserts; -insert into t3 values (repeat(char(ascii('a')+0),26+54)); -insert into t3 values (repeat(char(ascii('a')+1),25+54)); -insert into t3 values (repeat(char(ascii('a')+2),24+54)); -insert into t3 values (repeat(char(ascii('a')+3),23+54)); -insert into t3 values (repeat(char(ascii('a')+4),22+54)); -insert into t3 values (repeat(char(ascii('a')+5),21+54)); -insert into t3 values (repeat(char(ascii('a')+6),20+54)); -insert into t3 values (repeat(char(ascii('a')+7),19+54)); -insert into t3 values (repeat(char(ascii('a')+8),18+54)); -insert into t3 values (repeat(char(ascii('a')+9),17+54)); -insert into t3 values (repeat(char(ascii('a')+10),16+54)); -insert into t3 values (repeat(char(ascii('a')+11),15+54)); -insert into t3 values (repeat(char(ascii('a')+12),14+54)); -insert into t3 values (repeat(char(ascii('a')+13),13+54)); -insert into t3 values (repeat(char(ascii('a')+14),12+54)); -insert into t3 values (repeat(char(ascii('a')+15),11+54)); -insert into t3 values (repeat(char(ascii('a')+16),10+54)); -insert into t3 values (repeat(char(ascii('a')+17),9+54)); -insert into t3 values (repeat(char(ascii('a')+18),8+54)); -insert into t3 values (repeat(char(ascii('a')+19),7+54)); -insert into t3 values (repeat(char(ascii('a')+20),6+54)); -insert into t3 values (repeat(char(ascii('a')+21),5+54)); -insert into t3 values (repeat(char(ascii('a')+22),4+54)); -insert into t3 values (repeat(char(ascii('a')+23),3+54)); -insert into t3 values (repeat(char(ascii('a')+24),2+54)); -insert into t3 values (repeat(char(ascii('a')+25),1+54)); -select count(*) from t3; -count(*) -26 -select hex(a) from t3; -hex(a) -616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -drop table t3; -create table t4 (a binary(255) not null, primary key(a)) engine='InnoDB' -partition by list (ascii(a)) subpartition by key (a) subpartitions 4 ( -partition pa16 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), -partition pa32 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32), -partition pa64 values in (33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64), -partition pa128 values in (65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128), -partition pa256 values in (129,130,131,132,133,134,135,136,137,138,139,140 -,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256) -); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't4' -show create table t4; -Table Create Table -t4 CREATE TABLE `t4` ( - `a` binary(255) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ascii(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 4 (PARTITION pa16 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ENGINE = MyISAM, PARTITION pa32 VALUES IN (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ENGINE = MyISAM, PARTITION pa64 VALUES IN (33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64) ENGINE = MyISAM, PARTITION pa128 VALUES IN (65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128) ENGINE = MyISAM, PARTITION pa256 VALUES IN (129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256) ENGINE = MyISAM) */ -26 inserts; -insert into t4 values (repeat(char(ascii('a')+0),26+54)); -insert into t4 values (repeat(char(ascii('a')+1),25+54)); -insert into t4 values (repeat(char(ascii('a')+2),24+54)); -insert into t4 values (repeat(char(ascii('a')+3),23+54)); -insert into t4 values (repeat(char(ascii('a')+4),22+54)); -insert into t4 values (repeat(char(ascii('a')+5),21+54)); -insert into t4 values (repeat(char(ascii('a')+6),20+54)); -insert into t4 values (repeat(char(ascii('a')+7),19+54)); -insert into t4 values (repeat(char(ascii('a')+8),18+54)); -insert into t4 values (repeat(char(ascii('a')+9),17+54)); -insert into t4 values (repeat(char(ascii('a')+10),16+54)); -insert into t4 values (repeat(char(ascii('a')+11),15+54)); -insert into t4 values (repeat(char(ascii('a')+12),14+54)); -insert into t4 values (repeat(char(ascii('a')+13),13+54)); -insert into t4 values (repeat(char(ascii('a')+14),12+54)); -insert into t4 values (repeat(char(ascii('a')+15),11+54)); -insert into t4 values (repeat(char(ascii('a')+16),10+54)); -insert into t4 values (repeat(char(ascii('a')+17),9+54)); -insert into t4 values (repeat(char(ascii('a')+18),8+54)); -insert into t4 values (repeat(char(ascii('a')+19),7+54)); -insert into t4 values (repeat(char(ascii('a')+20),6+54)); -insert into t4 values (repeat(char(ascii('a')+21),5+54)); -insert into t4 values (repeat(char(ascii('a')+22),4+54)); -insert into t4 values (repeat(char(ascii('a')+23),3+54)); -insert into t4 values (repeat(char(ascii('a')+24),2+54)); -insert into t4 values (repeat(char(ascii('a')+25),1+54)); -select count(*) from t4; -count(*) -26 -select hex(a) from t4; -hex(a) -616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -drop table t4; +---- Partitioning and varchar data type create table t1 (a varchar(767) not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -384,14 +228,12 @@ partition pa3 DATA DIRECTORY = partition pa4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' max_rows=40 min_rows=2); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(767) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; a @@ -412,14 +254,12 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb drop table t1; create table t2 (a varchar(767) not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 27; -Warnings: -Warning 1266 Using storage engine MyISAM for table 't2' show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` varchar(767) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ 26 inserts; insert into t2 values (repeat(char(ascii('a')+0),26*26)); insert into t2 values (repeat(char(ascii('a')+1),25*25)); @@ -479,6 +319,7 @@ xxxxxxxxx yyyy z drop table t2; +---- Partitioning and varbinary data type create table t1 (a varbinary(767) not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -493,14 +334,12 @@ partition pa3 DATA DIRECTORY = partition pa4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' max_rows=40 min_rows=2); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varbinary(767) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; a @@ -521,14 +360,12 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb drop table t1; create table t2 (a varbinary(767) not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 30; -Warnings: -Warning 1266 Using storage engine MyISAM for table 't2' show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` varbinary(767) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 30 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 30 */ 26 inserts; insert into t2 values (repeat(char(ascii('a')+0),26*26)); insert into t2 values (repeat(char(ascii('a')+1),25*25)); @@ -588,6 +425,7 @@ xxxxxxxxx yyyy z drop table t2; +---- Partitioning and enum data type create table t1 (a enum('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -602,14 +440,12 @@ partition pa3 DATA DIRECTORY = partition pa4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' max_rows=40 min_rows=2); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` enum('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ insert into t1 values ('A'),('D'),('L'),('G'); select * from t1; a @@ -641,14 +477,12 @@ create table t2 (a enum ( 'Y','Z' ) not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 27; -Warnings: -Warning 1266 Using storage engine MyISAM for table 't2' show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` enum('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ 0 inserts; insert into t2 values (char(ascii('A')+26)); Warnings: @@ -721,60 +555,7 @@ X Y Z drop table t2; -create table t3 (a enum ( -'1','2','3','4','5','6','7','8','9','0', -'A','B','C','D','E','F','G','H','I','J','K','L', -'M','N','O','P','Q','R','S','T','U','V','W','X', -'Y','Z' -) not null, primary key(a)) engine='InnoDB' -partition by range (cast(a as unsigned)) subpartition by key (a) subpartitions 3 ( -partition pa9 values less than (10), -partition pa18 values less than (19), -partition pa27 values less than (28), -partition pa36 values less than (37) -); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't3' -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` enum('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(a as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa9 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa18 VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION pa27 VALUES LESS THAN (28) ENGINE = MyISAM, PARTITION pa36 VALUES LESS THAN (37) ENGINE = MyISAM) */ -0 inserts; -select count(*) from t3; -count(*) -0 -select * from t3; -a -drop table t3; -create table t4 (a enum ( -'1','2','3','4','5','6','7','8','9','0', -'A','B','C','D','E','F','G','H','I','J','K','L', -'M','N','O','P','Q','R','S','T','U','V','W','X', -'Y','Z' -) not null, primary key(a)) engine='InnoDB' -partition by list (cast(a as unsigned)) subpartition by key (a) subpartitions 3 ( -partition pa9 values in (1,2,3,4,5,6,7,8,9), -partition pa18 values in (10,11,12,13,14,15,16,17,18), -partition pa27 values in (19,20,21,22,23,24,25,26,27), -partition pa36 values in (28,29,30,31,32,33,34,35,36) -); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't4' -show create table t4; -Table Create Table -t4 CREATE TABLE `t4` ( - `a` enum('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(a as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa9 VALUES IN (1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION pa18 VALUES IN (10,11,12,13,14,15,16,17,18) ENGINE = MyISAM, PARTITION pa27 VALUES IN (19,20,21,22,23,24,25,26,27) ENGINE = MyISAM, PARTITION pa36 VALUES IN (28,29,30,31,32,33,34,35,36) ENGINE = MyISAM) */ -0 inserts; -select count(*) from t4; -count(*) -0 -select * from t4; -a -drop table t4; +---- Partitioning and set data type create table t1 (a set('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -789,14 +570,12 @@ partition pa3 DATA DIRECTORY = partition pa4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' max_rows=40 min_rows=2); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` set('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ insert into t1 values ('A,B'),('C,D'),('E,L'),('G,H,K'); select * from t1 order by a; a @@ -828,14 +607,12 @@ create table t2 (a set ( 'Y','Z' ) not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 27; -Warnings: -Warning 1266 Using storage engine MyISAM for table 't2' show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` set('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ insert into t2 values ('A'),('B'),('C'),('D'),('E'),('F'),('G'),('H'),('I'),('K'),('L'),('M'),('N'),('O'),('P'),('Q'),('S'),('T'),('U'),('V'),('X'),('Y'),('Z'); insert into t2 values ('A,B'),('B,C'),('C,D'),('D,E'),('E,F'),('F,G'),('G,H'),('H,I'),('I,J'),('K,L'),('L,M'),('M,N'),('N,O'),('O,P'),('P,Q'),('Q,R'),('S,T'),('T,U'),('U,V'),('V,W'),('X,Y'),('Y,Z'),('Z,A'); insert into t2 values ('A,B,C'),('B,C,D'),('C,D,E'),('D,E,F'),('E,F,G'),('F,G,H'),('G,H,I'),('H,I,J'),('I,J,K'),('K,L,M'),('L,M,N'),('M,N,O'),('N,O,P'),('O,P,Q'),('P,Q,R'),('Q,R,S'),('S,T,U'),('T,U,V'),('U,V,W'),('V,W,X'),('X,Y,Z'),('Y,Z,A'),('Z,A,B'); @@ -947,56 +724,7 @@ Y,Z A,Y,Z X,Y,Z drop table t2; -create table t3 (a set ( -'1','2','3','4','5','6','7','8','9','0' -) not null, primary key(a)) engine='InnoDB' -partition by range (cast(a as unsigned)) subpartition by key (a) subpartitions 3 ( -partition pa9 values less than (10), -partition pa18 values less than (19), -partition pa27 values less than (28), -partition pa36 values less than (37), -partition pa64 values less than (65), -partition pa128 values less than (129), -partition pa256 values less than (257), -partition pa512 values less than (513), -partition pa768 values less than (769), -partition pa1024 values less than (1025) -); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't3' -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` set('1','2','3','4','5','6','7','8','9','0') NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(a as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa9 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa18 VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION pa27 VALUES LESS THAN (28) ENGINE = MyISAM, PARTITION pa36 VALUES LESS THAN (37) ENGINE = MyISAM, PARTITION pa64 VALUES LESS THAN (65) ENGINE = MyISAM, PARTITION pa128 VALUES LESS THAN (129) ENGINE = MyISAM, PARTITION pa256 VALUES LESS THAN (257) ENGINE = MyISAM, PARTITION pa512 VALUES LESS THAN (513) ENGINE = MyISAM, PARTITION pa768 VALUES LESS THAN (769) ENGINE = MyISAM, PARTITION pa1024 VALUES LESS THAN (1025) ENGINE = MyISAM) */ -select count(*) from t3; -count(*) -0 -select * from t3 order by a; -a -drop table t3; -create table t4 (a set ( -'1','2','3') not null, primary key(a)) engine='InnoDB' -partition by list (cast(a as unsigned)) subpartition by key (a) subpartitions 3 ( -partition pa9 values in (1,2,3,4,5,6,7,8,9), -partition pa18 values in (10,11,12,13,14,15,16,17,18), -partition pa27 values in (19,20,21,22,23,24,25,26,27) -); -Warnings: -Warning 1266 Using storage engine MyISAM for table 't4' -show create table t4; -Table Create Table -t4 CREATE TABLE `t4` ( - `a` set('1','2','3') NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(a as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa9 VALUES IN (1,2,3,4,5,6,7,8,9) ENGINE = MyISAM, PARTITION pa18 VALUES IN (10,11,12,13,14,15,16,17,18) ENGINE = MyISAM, PARTITION pa27 VALUES IN (19,20,21,22,23,24,25,26,27) ENGINE = MyISAM) */ -select count(*) from t4; -count(*) -0 -select * from t4 order by a; -a -drop table t4; +---- Partitioning and blob data type create table t1 (a blob not null, primary key(a(767))) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -1024,6 +752,7 @@ ERROR HY000: A BLOB field is not allowed in partition function create table t2 (a longblob not null, primary key(a(767))) engine='InnoDB' partition by key (a) partitions 30; ERROR HY000: A BLOB field is not allowed in partition function +---- Partitioning and text data type create table t1 (a text not null, primary key(a(767))) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = diff --git a/mysql-test/suite/parts/r/partition_char_myisam.result b/mysql-test/suite/parts/r/partition_char_myisam.result index 514b2dba1bf..1009f52348d 100644 --- a/mysql-test/suite/parts/r/partition_char_myisam.result +++ b/mysql-test/suite/parts/r/partition_char_myisam.result @@ -1,5 +1,6 @@ -create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w'), primary key(a,b,c,d)) engine='MyISAM' -partition by key (a,b,c,d) ( +---- Partitioning and char data type +create table t1 (a char(255) not null, primary key(a)) engine='MyISAM' +partition by key (a) ( partition pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' max_rows=20 min_rows=2, @@ -15,26 +16,764 @@ partition pa4 DATA DIRECTORY = show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` date NOT NULL, - `b` varchar(50) NOT NULL, - `c` varchar(50) NOT NULL, - `d` enum('m','w') NOT NULL DEFAULT 'm', - PRIMARY KEY (`a`,`b`,`c`,`d`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ -insert into t1 values -('1975-01-01', 'abcde', 'abcde','m'), -('1983-12-31', 'cdef', 'srtbvsr', 'w'), -('1980-10-14', 'fgbbd', 'dtzndtz', 'w'), -('2000-06-15', 'jukg','zikhuk','m'); -select * from t1; -a b c d -1975-01-01 abcde abcde m -1980-10-14 fgbbd dtzndtz w -1983-12-31 cdef srtbvsr w -2000-06-15 jukg zikhuk m -select * from t1 where a<19851231; -a b c d -1975-01-01 abcde abcde m -1980-10-14 fgbbd dtzndtz w -1983-12-31 cdef srtbvsr w + `a` char(255) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); +select * from t1; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +b +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +select * from t1 where a='b'; +a +b +update t1 set a='bb' where a='b'; +delete from t1 where a='bb'; +select * from t1; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t2 (a char(255) not null, primary key(a)) engine='MyISAM' +partition by key (a) partitions 27; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` char(255) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +26 inserts; +insert into t2 values (repeat(char(ascii('a')+0),26+54)); +insert into t2 values (repeat(char(ascii('a')+1),25+54)); +insert into t2 values (repeat(char(ascii('a')+2),24+54)); +insert into t2 values (repeat(char(ascii('a')+3),23+54)); +insert into t2 values (repeat(char(ascii('a')+4),22+54)); +insert into t2 values (repeat(char(ascii('a')+5),21+54)); +insert into t2 values (repeat(char(ascii('a')+6),20+54)); +insert into t2 values (repeat(char(ascii('a')+7),19+54)); +insert into t2 values (repeat(char(ascii('a')+8),18+54)); +insert into t2 values (repeat(char(ascii('a')+9),17+54)); +insert into t2 values (repeat(char(ascii('a')+10),16+54)); +insert into t2 values (repeat(char(ascii('a')+11),15+54)); +insert into t2 values (repeat(char(ascii('a')+12),14+54)); +insert into t2 values (repeat(char(ascii('a')+13),13+54)); +insert into t2 values (repeat(char(ascii('a')+14),12+54)); +insert into t2 values (repeat(char(ascii('a')+15),11+54)); +insert into t2 values (repeat(char(ascii('a')+16),10+54)); +insert into t2 values (repeat(char(ascii('a')+17),9+54)); +insert into t2 values (repeat(char(ascii('a')+18),8+54)); +insert into t2 values (repeat(char(ascii('a')+19),7+54)); +insert into t2 values (repeat(char(ascii('a')+20),6+54)); +insert into t2 values (repeat(char(ascii('a')+21),5+54)); +insert into t2 values (repeat(char(ascii('a')+22),4+54)); +insert into t2 values (repeat(char(ascii('a')+23),3+54)); +insert into t2 values (repeat(char(ascii('a')+24),2+54)); +insert into t2 values (repeat(char(ascii('a')+25),1+54)); +select count(*) from t2; +count(*) +26 +select * from t2; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd +eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg +hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh +iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii +jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj +kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk +lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll +mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm +nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo +ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp +qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq +rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr +ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt +uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv +wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +drop table t2; +---- Partitioning and binary data type +create table t1 (a binary(255) not null, primary key(a)) engine='MyISAM' +partition by key (a) ( +partition pa1 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=20 min_rows=2, +partition pa2 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=3, +partition pa3 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=4, +partition pa4 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` binary(255) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); +select hex(a) from t1; +hex(a) +616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 +620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +select a from t1 where substr(a,1,2)='b\0'; +a +b +update t1 set a='cc' where substr(a,1,2)= 'b\0'; +select a from t1 where substr(a,1,1)='c'; +a +cc +delete from t1 where substr(a,1,2)='cc'; +select hex(a) from t1; +hex(a) +616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 +626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +drop table t1; +create table t2 (a binary(255) not null, primary key(a)) engine='MyISAM' +partition by key (a) partitions 27; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` binary(255) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +26 inserts; +insert into t2 values (repeat(char(ascii('a')+0),26+54)); +insert into t2 values (repeat(char(ascii('a')+1),25+54)); +insert into t2 values (repeat(char(ascii('a')+2),24+54)); +insert into t2 values (repeat(char(ascii('a')+3),23+54)); +insert into t2 values (repeat(char(ascii('a')+4),22+54)); +insert into t2 values (repeat(char(ascii('a')+5),21+54)); +insert into t2 values (repeat(char(ascii('a')+6),20+54)); +insert into t2 values (repeat(char(ascii('a')+7),19+54)); +insert into t2 values (repeat(char(ascii('a')+8),18+54)); +insert into t2 values (repeat(char(ascii('a')+9),17+54)); +insert into t2 values (repeat(char(ascii('a')+10),16+54)); +insert into t2 values (repeat(char(ascii('a')+11),15+54)); +insert into t2 values (repeat(char(ascii('a')+12),14+54)); +insert into t2 values (repeat(char(ascii('a')+13),13+54)); +insert into t2 values (repeat(char(ascii('a')+14),12+54)); +insert into t2 values (repeat(char(ascii('a')+15),11+54)); +insert into t2 values (repeat(char(ascii('a')+16),10+54)); +insert into t2 values (repeat(char(ascii('a')+17),9+54)); +insert into t2 values (repeat(char(ascii('a')+18),8+54)); +insert into t2 values (repeat(char(ascii('a')+19),7+54)); +insert into t2 values (repeat(char(ascii('a')+20),6+54)); +insert into t2 values (repeat(char(ascii('a')+21),5+54)); +insert into t2 values (repeat(char(ascii('a')+22),4+54)); +insert into t2 values (repeat(char(ascii('a')+23),3+54)); +insert into t2 values (repeat(char(ascii('a')+24),2+54)); +insert into t2 values (repeat(char(ascii('a')+25),1+54)); +select count(*) from t2; +count(*) +26 +select hex(a) from t2; +hex(a) +616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868686868680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969696969000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D6D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E6E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F6F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767676767600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +drop table t2; +---- Partitioning and varchar data type +create table t1 (a varchar(767) not null, primary key(a)) engine='MyISAM' +partition by key (a) ( +partition pa1 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=20 min_rows=2, +partition pa2 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=3, +partition pa3 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=4, +partition pa4 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(767) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); +select * from t1; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +b +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +select * from t1 where a='b'; +a +b +update t1 set a='bb' where a='b'; +delete from t1 where a='bb'; +select * from t1; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t2 (a varchar(767) not null, primary key(a)) engine='MyISAM' +partition by key (a) partitions 27; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(767) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +26 inserts; +insert into t2 values (repeat(char(ascii('a')+0),26*26)); +insert into t2 values (repeat(char(ascii('a')+1),25*25)); +insert into t2 values (repeat(char(ascii('a')+2),24*24)); +insert into t2 values (repeat(char(ascii('a')+3),23*23)); +insert into t2 values (repeat(char(ascii('a')+4),22*22)); +insert into t2 values (repeat(char(ascii('a')+5),21*21)); +insert into t2 values (repeat(char(ascii('a')+6),20*20)); +insert into t2 values (repeat(char(ascii('a')+7),19*19)); +insert into t2 values (repeat(char(ascii('a')+8),18*18)); +insert into t2 values (repeat(char(ascii('a')+9),17*17)); +insert into t2 values (repeat(char(ascii('a')+10),16*16)); +insert into t2 values (repeat(char(ascii('a')+11),15*15)); +insert into t2 values (repeat(char(ascii('a')+12),14*14)); +insert into t2 values (repeat(char(ascii('a')+13),13*13)); +insert into t2 values (repeat(char(ascii('a')+14),12*12)); +insert into t2 values (repeat(char(ascii('a')+15),11*11)); +insert into t2 values (repeat(char(ascii('a')+16),10*10)); +insert into t2 values (repeat(char(ascii('a')+17),9*9)); +insert into t2 values (repeat(char(ascii('a')+18),8*8)); +insert into t2 values (repeat(char(ascii('a')+19),7*7)); +insert into t2 values (repeat(char(ascii('a')+20),6*6)); +insert into t2 values (repeat(char(ascii('a')+21),5*5)); +insert into t2 values (repeat(char(ascii('a')+22),4*4)); +insert into t2 values (repeat(char(ascii('a')+23),3*3)); +insert into t2 values (repeat(char(ascii('a')+24),2*2)); +insert into t2 values (repeat(char(ascii('a')+25),1*1)); +select count(*) from t2; +count(*) +26 +select * from t2; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd +eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg +hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh +iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii +jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj +kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk +lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll +mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm +nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo +ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp +qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq +rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr +ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +ttttttttttttttttttttttttttttttttttttttttttttttttt +uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu +vvvvvvvvvvvvvvvvvvvvvvvvv +wwwwwwwwwwwwwwww +xxxxxxxxx +yyyy +z +drop table t2; +---- Partitioning and varbinary data type +create table t1 (a varbinary(767) not null, primary key(a)) engine='MyISAM' +partition by key (a) ( +partition pa1 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=20 min_rows=2, +partition pa2 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=3, +partition pa3 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=4, +partition pa4 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varbinary(767) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); +select * from t1; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +b +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +select * from t1 where a='b'; +a +b +update t1 set a='bb' where a='b'; +delete from t1 where a='bb'; +select * from t1; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb drop table t1; +create table t2 (a varbinary(767) not null, primary key(a)) engine='MyISAM' +partition by key (a) partitions 30; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varbinary(767) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 30 */ +26 inserts; +insert into t2 values (repeat(char(ascii('a')+0),26*26)); +insert into t2 values (repeat(char(ascii('a')+1),25*25)); +insert into t2 values (repeat(char(ascii('a')+2),24*24)); +insert into t2 values (repeat(char(ascii('a')+3),23*23)); +insert into t2 values (repeat(char(ascii('a')+4),22*22)); +insert into t2 values (repeat(char(ascii('a')+5),21*21)); +insert into t2 values (repeat(char(ascii('a')+6),20*20)); +insert into t2 values (repeat(char(ascii('a')+7),19*19)); +insert into t2 values (repeat(char(ascii('a')+8),18*18)); +insert into t2 values (repeat(char(ascii('a')+9),17*17)); +insert into t2 values (repeat(char(ascii('a')+10),16*16)); +insert into t2 values (repeat(char(ascii('a')+11),15*15)); +insert into t2 values (repeat(char(ascii('a')+12),14*14)); +insert into t2 values (repeat(char(ascii('a')+13),13*13)); +insert into t2 values (repeat(char(ascii('a')+14),12*12)); +insert into t2 values (repeat(char(ascii('a')+15),11*11)); +insert into t2 values (repeat(char(ascii('a')+16),10*10)); +insert into t2 values (repeat(char(ascii('a')+17),9*9)); +insert into t2 values (repeat(char(ascii('a')+18),8*8)); +insert into t2 values (repeat(char(ascii('a')+19),7*7)); +insert into t2 values (repeat(char(ascii('a')+20),6*6)); +insert into t2 values (repeat(char(ascii('a')+21),5*5)); +insert into t2 values (repeat(char(ascii('a')+22),4*4)); +insert into t2 values (repeat(char(ascii('a')+23),3*3)); +insert into t2 values (repeat(char(ascii('a')+24),2*2)); +insert into t2 values (repeat(char(ascii('a')+25),1*1)); +select count(*) from t2; +count(*) +26 +select * from t2; +a +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd +eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg +hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh +iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii +jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj +kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk +lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll +mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm +nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo +ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp +qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq +rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr +ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss +ttttttttttttttttttttttttttttttttttttttttttttttttt +uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu +vvvvvvvvvvvvvvvvvvvvvvvvv +wwwwwwwwwwwwwwww +xxxxxxxxx +yyyy +z +drop table t2; +---- Partitioning and enum data type +create table t1 (a enum('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='MyISAM' +partition by key (a) ( +partition pa1 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=20 min_rows=2, +partition pa2 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=3, +partition pa3 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=4, +partition pa4 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +insert into t1 values ('A'),('D'),('L'),('G'); +select * from t1; +a +A +D +G +L +select * from t1 where a='A'; +a +A +update t1 set a='E' where a='L'; +select * from t1; +a +A +D +E +G +delete from t1 where a='E'; +select * from t1; +a +A +D +G +drop table t1; +create table t2 (a enum ( +'1','2','3','4','5','6','7','8','9','0', +'A','B','C','D','E','F','G','H','I','J','K','L', +'M','N','O','P','Q','R','S','T','U','V','W','X', +'Y','Z' +) not null, primary key(a)) engine='MyISAM' +partition by key (a) partitions 27; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` enum('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +0 inserts; +insert into t2 values (char(ascii('A')+26)); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +insert into t2 values (char(ascii('A')+25)); +insert into t2 values (char(ascii('A')+24)); +insert into t2 values (char(ascii('A')+23)); +insert into t2 values (char(ascii('A')+22)); +insert into t2 values (char(ascii('A')+21)); +insert into t2 values (char(ascii('A')+20)); +insert into t2 values (char(ascii('A')+19)); +insert into t2 values (char(ascii('A')+18)); +insert into t2 values (char(ascii('A')+17)); +insert into t2 values (char(ascii('A')+16)); +insert into t2 values (char(ascii('A')+15)); +insert into t2 values (char(ascii('A')+14)); +insert into t2 values (char(ascii('A')+13)); +insert into t2 values (char(ascii('A')+12)); +insert into t2 values (char(ascii('A')+11)); +insert into t2 values (char(ascii('A')+10)); +insert into t2 values (char(ascii('A')+9)); +insert into t2 values (char(ascii('A')+8)); +insert into t2 values (char(ascii('A')+7)); +insert into t2 values (char(ascii('A')+6)); +insert into t2 values (char(ascii('A')+5)); +insert into t2 values (char(ascii('A')+4)); +insert into t2 values (char(ascii('A')+3)); +insert into t2 values (char(ascii('A')+2)); +insert into t2 values (char(ascii('A')+1)); +insert into t2 values ('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'),('0'); +select count(*) from t2; +count(*) +36 +select * from t2; +a + +1 +2 +3 +4 +5 +6 +7 +8 +9 +0 +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P +Q +R +S +T +U +V +W +X +Y +Z +drop table t2; +---- Partitioning and set data type +create table t1 (a set('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='MyISAM' +partition by key (a) ( +partition pa1 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=20 min_rows=2, +partition pa2 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=3, +partition pa3 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=4, +partition pa4 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` set('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +insert into t1 values ('A,B'),('C,D'),('E,L'),('G,H,K'); +select * from t1 order by a; +a +A,B +C,D +G,H,K +E,L +select * from t1 where a='A,B'; +a +A,B +update t1 set a='A,B,C' where a='E,L'; +select * from t1 order by a; +a +A,B +A,B,C +C,D +G,H,K +delete from t1 where a='A,B'; +select * from t1 order by a; +a +A,B,C +C,D +G,H,K +drop table t1; +create table t2 (a set ( +'1','2','3','4','5','6','7','8','9','0', +'A','B','C','D','E','F','G','H','I','J','K','L', +'M','N','O','P','Q','R','S','T','U','V','W','X', +'Y','Z' +) not null, primary key(a)) engine='MyISAM' +partition by key (a) partitions 27; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` set('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 27 */ +insert into t2 values ('A'),('B'),('C'),('D'),('E'),('F'),('G'),('H'),('I'),('K'),('L'),('M'),('N'),('O'),('P'),('Q'),('S'),('T'),('U'),('V'),('X'),('Y'),('Z'); +insert into t2 values ('A,B'),('B,C'),('C,D'),('D,E'),('E,F'),('F,G'),('G,H'),('H,I'),('I,J'),('K,L'),('L,M'),('M,N'),('N,O'),('O,P'),('P,Q'),('Q,R'),('S,T'),('T,U'),('U,V'),('V,W'),('X,Y'),('Y,Z'),('Z,A'); +insert into t2 values ('A,B,C'),('B,C,D'),('C,D,E'),('D,E,F'),('E,F,G'),('F,G,H'),('G,H,I'),('H,I,J'),('I,J,K'),('K,L,M'),('L,M,N'),('M,N,O'),('N,O,P'),('O,P,Q'),('P,Q,R'),('Q,R,S'),('S,T,U'),('T,U,V'),('U,V,W'),('V,W,X'),('X,Y,Z'),('Y,Z,A'),('Z,A,B'); +insert into t2 values ('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'),('0'); +insert into t2 values ('1,2'),('2,3'),('3,4'),('4,5'),('5,6'),('6,7'),('7,8'),('8,9'),('9,0'),('0,1'); +insert into t2 values ('1,2,3'),('2,3,4'),('3,4,5'),('4,5,6'),('5,6,7'),('6,7,8'),('7,8,9'),('8,9,0'),('9,0,1'),('0,1,2'); +select count(*) from t2; +count(*) +99 +select * from t2 order by a; +a +1 +2 +1,2 +3 +2,3 +1,2,3 +4 +3,4 +2,3,4 +5 +4,5 +3,4,5 +6 +5,6 +4,5,6 +7 +6,7 +5,6,7 +8 +7,8 +6,7,8 +9 +8,9 +7,8,9 +0 +1,0 +1,2,0 +9,0 +1,9,0 +8,9,0 +A +B +A,B +C +B,C +A,B,C +D +C,D +B,C,D +E +D,E +C,D,E +F +E,F +D,E,F +G +F,G +E,F,G +H +G,H +F,G,H +I +H,I +G,H,I +I,J +H,I,J +K +I,J,K +L +K,L +M +L,M +K,L,M +N +M,N +L,M,N +O +N,O +M,N,O +P +O,P +N,O,P +Q +P,Q +O,P,Q +Q,R +P,Q,R +S +Q,R,S +T +S,T +U +T,U +S,T,U +V +U,V +T,U,V +V,W +U,V,W +X +V,W,X +Y +X,Y +Z +A,Z +A,B,Z +Y,Z +A,Y,Z +X,Y,Z +drop table t2; +---- Partitioning and blob data type +create table t1 (a blob not null, primary key(a(767))) engine='MyISAM' +partition by key (a) ( +partition pa1 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=20 min_rows=2, +partition pa2 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=3, +partition pa3 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=4, +partition pa4 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=40 min_rows=2); +ERROR HY000: A BLOB field is not allowed in partition function +create table t2 (a blob not null, primary key(a(767))) engine='MyISAM' +partition by key (a) partitions 30; +ERROR HY000: A BLOB field is not allowed in partition function +create table t2 (a tinyblob not null, primary key(a(767))) engine='MyISAM' +partition by key (a) partitions 30; +ERROR HY000: A BLOB field is not allowed in partition function +create table t2 (a mediumblob not null, primary key(a(767))) engine='MyISAM' +partition by key (a) partitions 30; +ERROR HY000: A BLOB field is not allowed in partition function +create table t2 (a longblob not null, primary key(a(767))) engine='MyISAM' +partition by key (a) partitions 30; +ERROR HY000: A BLOB field is not allowed in partition function +---- Partitioning and text data type +create table t1 (a text not null, primary key(a(767))) engine='MyISAM' +partition by key (a) ( +partition pa1 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=20 min_rows=2, +partition pa2 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=3, +partition pa3 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=30 min_rows=4, +partition pa4 DATA DIRECTORY = +'/tmp' INDEX DIRECTORY = +'/tmp' max_rows=40 min_rows=2); +ERROR HY000: A BLOB field is not allowed in partition function +create table t2 (a tinytext not null, primary key(a(767))) engine='MyISAM' +partition by key (a) partitions 30; +ERROR HY000: A BLOB field is not allowed in partition function +create table t2 (a mediumtext not null, primary key(a(767))) engine='MyISAM' +partition by key (a) partitions 30; +ERROR HY000: A BLOB field is not allowed in partition function +create table t2 (a longtext not null, primary key(a(767))) engine='MyISAM' +partition by key (a) partitions 30; +ERROR HY000: A BLOB field is not allowed in partition function diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result index 1ef281f2766..7e05d368cf8 100644 --- a/mysql-test/suite/parts/r/partition_datetime_myisam.result +++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result @@ -17,7 +17,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -298,7 +298,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` date NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t1; a @@ -625,7 +625,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` time NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59'); select * from t1; a @@ -1090,7 +1090,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -1367,7 +1367,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` year(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975'), (2020), ('1980'), ('2000'); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result index 464ac4ddaf5..4d06f4d7b38 100644 --- a/mysql-test/suite/parts/r/partition_decimal_myisam.result +++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result @@ -17,7 +17,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` decimal(10,4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result index be95f5baae5..04a5a492269 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -62,7 +57,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -497,7 +492,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2 Assignment of storage engine just after partition or subpartition @@ -516,7 +511,7 @@ PARTITION part2 STORAGE ENGINE = 'InnoDB' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -951,7 +946,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -971,7 +966,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1404,7 +1399,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 3 Some but not all named partitions or subpartitions get a storage @@ -1423,7 +1418,7 @@ PARTITION part2 ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1858,7 +1853,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1873,7 +1868,7 @@ PARTITION part2 STORAGE ENGINE = 'InnoDB' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2308,7 +2303,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2328,7 +2323,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2761,7 +2756,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2781,7 +2776,7 @@ SUBPARTITION subpart22 ) ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3214,7 +3209,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 4 Storage engine assignment after partition name + after name of @@ -3238,7 +3233,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3671,7 +3666,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3691,7 +3686,7 @@ SUBPARTITION subpart22) ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4124,7 +4119,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 5 Precedence of storage engine assignments (if there is any) @@ -4144,7 +4139,7 @@ PARTITION part2 STORAGE ENGINE = 'InnoDB' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4579,7 +4574,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4599,7 +4594,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5032,7 +5027,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 6.2 Storage engine assignment after partition name + after # subpartition name @@ -5054,7 +5049,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5487,7 +5482,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table @@ -5503,7 +5498,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) ( PARTITION part1 ENGINE = 'InnoDB'); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5938,7 +5933,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5954,7 +5949,7 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB')); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6387,7 +6382,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; SET SESSION storage_engine='InnoDB'; DROP VIEW IF EXISTS v1; diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index a61ec2e5cef..f81becc6eea 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -62,7 +57,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -507,7 +502,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2 Assignment of storage engine just after partition or subpartition @@ -526,7 +521,7 @@ PARTITION part2 STORAGE ENGINE = 'MyISAM' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -971,7 +966,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -991,7 +986,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1438,7 +1433,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 3 Some but not all named partitions or subpartitions get a storage @@ -1457,7 +1452,7 @@ PARTITION part2 ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -1902,7 +1897,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -1917,7 +1912,7 @@ PARTITION part2 STORAGE ENGINE = 'MyISAM' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2362,7 +2357,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2382,7 +2377,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2829,7 +2824,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -2849,7 +2844,7 @@ SUBPARTITION subpart22 ) ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3296,7 +3291,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 4 Storage engine assignment after partition name + after name of @@ -3320,7 +3315,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3767,7 +3762,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3787,7 +3782,7 @@ SUBPARTITION subpart22) ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4234,7 +4229,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 5 Precedence of storage engine assignments (if there is any) @@ -4254,7 +4249,7 @@ PARTITION part2 STORAGE ENGINE = 'MyISAM' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4699,7 +4694,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4719,7 +4714,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5166,7 +5161,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 6.2 Storage engine assignment after partition name + after # subpartition name @@ -5188,7 +5183,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5635,7 +5630,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table @@ -5651,7 +5646,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) ( PARTITION part1 ENGINE = 'MyISAM'); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6094,7 +6089,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -6110,7 +6105,7 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM')); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -6553,7 +6548,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; SET SESSION storage_engine='MyISAM'; DROP VIEW IF EXISTS v1; diff --git a/mysql-test/suite/parts/r/partition_float_innodb.result b/mysql-test/suite/parts/r/partition_float_innodb.result index bc30987b33f..c203fabfd87 100644 --- a/mysql-test/suite/parts/r/partition_float_innodb.result +++ b/mysql-test/suite/parts/r/partition_float_innodb.result @@ -89,152 +89,6 @@ select count(*) from t2; count(*) 3072 drop table t2; -create table t3 (a float not null, primary key(a)) engine='InnoDB' -partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` float NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (6) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */ -9*3 inserts; -insert into t3 values (9); -insert into t3 values (9+0.33); -insert into t3 values (9+0.75); -insert into t3 values (8); -insert into t3 values (8+0.33); -insert into t3 values (8+0.75); -insert into t3 values (7); -insert into t3 values (7+0.33); -insert into t3 values (7+0.75); -insert into t3 values (6); -insert into t3 values (6+0.33); -insert into t3 values (6+0.75); -insert into t3 values (5); -insert into t3 values (5+0.33); -insert into t3 values (5+0.75); -insert into t3 values (4); -insert into t3 values (4+0.33); -insert into t3 values (4+0.75); -insert into t3 values (3); -insert into t3 values (3+0.33); -insert into t3 values (3+0.75); -insert into t3 values (2); -insert into t3 values (2+0.33); -insert into t3 values (2+0.75); -insert into t3 values (1); -insert into t3 values (1+0.33); -insert into t3 values (1+0.75); -select count(*) from t3; -count(*) -27 -select * from t3; -a -1 -1.33 -1.75 -2 -2.33 -2.75 -3 -3.33 -3.75 -4 -4.33 -4.75 -5 -5.33 -5.75 -6 -6.33 -6.75 -7 -7.33 -7.75 -8 -8.33 -8.75 -9 -9.33 -9.75 -drop table t3; -create table t4 (a float not null, primary key(a)) engine='InnoDB' -partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -Table Create Table -t4 CREATE TABLE `t4` ( - `a` float NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION pa3 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = InnoDB) */ -9*3 inserts; -insert into t4 values (9); -insert into t4 values (9+0.33); -insert into t4 values (9+0.75); -insert into t4 values (8); -insert into t4 values (8+0.33); -insert into t4 values (8+0.75); -insert into t4 values (7); -insert into t4 values (7+0.33); -insert into t4 values (7+0.75); -insert into t4 values (6); -insert into t4 values (6+0.33); -insert into t4 values (6+0.75); -insert into t4 values (5); -insert into t4 values (5+0.33); -insert into t4 values (5+0.75); -insert into t4 values (4); -insert into t4 values (4+0.33); -insert into t4 values (4+0.75); -insert into t4 values (3); -insert into t4 values (3+0.33); -insert into t4 values (3+0.75); -insert into t4 values (2); -insert into t4 values (2+0.33); -insert into t4 values (2+0.75); -insert into t4 values (1); -insert into t4 values (1+0.33); -insert into t4 values (1+0.75); -select count(*) from t4; -count(*) -27 -select * from t4; -a -1 -1.33 -1.75 -2 -2.33 -2.75 -3 -3.33 -3.75 -4 -4.33 -4.75 -5 -5.33 -5.75 -6 -6.33 -6.75 -7 -7.33 -7.75 -8 -8.33 -8.75 -9 -9.33 -9.75 -drop table t4; create table t1 (a double not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -318,149 +172,3 @@ select count(*) from t2; count(*) 3072 drop table t2; -create table t3 (a double not null, primary key(a)) engine='InnoDB' -partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` double NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES LESS THAN (3) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (6) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */ -9*3 inserts; -insert into t3 values (9); -insert into t3 values (9+0.33); -insert into t3 values (9+0.75); -insert into t3 values (8); -insert into t3 values (8+0.33); -insert into t3 values (8+0.75); -insert into t3 values (7); -insert into t3 values (7+0.33); -insert into t3 values (7+0.75); -insert into t3 values (6); -insert into t3 values (6+0.33); -insert into t3 values (6+0.75); -insert into t3 values (5); -insert into t3 values (5+0.33); -insert into t3 values (5+0.75); -insert into t3 values (4); -insert into t3 values (4+0.33); -insert into t3 values (4+0.75); -insert into t3 values (3); -insert into t3 values (3+0.33); -insert into t3 values (3+0.75); -insert into t3 values (2); -insert into t3 values (2+0.33); -insert into t3 values (2+0.75); -insert into t3 values (1); -insert into t3 values (1+0.33); -insert into t3 values (1+0.75); -select count(*) from t3; -count(*) -27 -select * from t3; -a -1 -1.33 -1.75 -2 -2.33 -2.75 -3 -3.33 -3.75 -4 -4.33 -4.75 -5 -5.33 -5.75 -6 -6.33 -6.75 -7 -7.33 -7.75 -8 -8.33 -8.75 -9 -9.33 -9.75 -drop table t3; -create table t4 (a double not null, primary key(a)) engine='InnoDB' -partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -Table Create Table -t4 CREATE TABLE `t4` ( - `a` double NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION pa1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION pa3 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = InnoDB) */ -9*3 inserts; -insert into t4 values (9); -insert into t4 values (9+0.33); -insert into t4 values (9+0.75); -insert into t4 values (8); -insert into t4 values (8+0.33); -insert into t4 values (8+0.75); -insert into t4 values (7); -insert into t4 values (7+0.33); -insert into t4 values (7+0.75); -insert into t4 values (6); -insert into t4 values (6+0.33); -insert into t4 values (6+0.75); -insert into t4 values (5); -insert into t4 values (5+0.33); -insert into t4 values (5+0.75); -insert into t4 values (4); -insert into t4 values (4+0.33); -insert into t4 values (4+0.75); -insert into t4 values (3); -insert into t4 values (3+0.33); -insert into t4 values (3+0.75); -insert into t4 values (2); -insert into t4 values (2+0.33); -insert into t4 values (2+0.75); -insert into t4 values (1); -insert into t4 values (1+0.33); -insert into t4 values (1+0.75); -select count(*) from t4; -count(*) -27 -select * from t4; -a -1 -1.33 -1.75 -2 -2.33 -2.75 -3 -3.33 -3.75 -4 -4.33 -4.75 -5 -5.33 -5.75 -6 -6.33 -6.75 -7 -7.33 -7.75 -8 -8.33 -8.75 -9 -9.33 -9.75 -drop table t4; diff --git a/mysql-test/suite/parts/r/partition_float_myisam.result b/mysql-test/suite/parts/r/partition_float_myisam.result index aba62b8ba70..13881548473 100644 --- a/mysql-test/suite/parts/r/partition_float_myisam.result +++ b/mysql-test/suite/parts/r/partition_float_myisam.result @@ -17,7 +17,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` float NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a @@ -108,7 +108,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_int_myisam.result b/mysql-test/suite/parts/r/partition_int_myisam.result index d00f8e5f772..7f16cdb207a 100644 --- a/mysql-test/suite/parts/r/partition_int_myisam.result +++ b/mysql-test/suite/parts/r/partition_int_myisam.result @@ -17,7 +17,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a @@ -125,7 +125,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -233,7 +233,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a @@ -341,7 +341,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a @@ -449,7 +449,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result index f3249f49778..85e6d5445fd 100644 --- a/mysql-test/suite/parts/r/partition_special_myisam.result +++ b/mysql-test/suite/parts/r/partition_special_myisam.result @@ -20,7 +20,7 @@ t1 CREATE TABLE `t1` ( `c` varchar(50) NOT NULL, `d` enum('m','w') NOT NULL DEFAULT 'm', PRIMARY KEY (`a`,`b`,`c`,`d`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m'), ('1983-12-31', 'cdef', 'srtbvsr', 'w'), @@ -65,7 +65,7 @@ t1 CREATE TABLE `t1` ( `h` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -118,7 +118,7 @@ t1 CREATE TABLE `t1` ( `h1` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -202,7 +202,7 @@ t1 CREATE TABLE `t1` ( `h3` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), diff --git a/mysql-test/suite/parts/r/partition_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result index 402ab2f524f..a26d2ec65b9 100644 --- a/mysql-test/suite/parts/r/partition_syntax_innodb.result +++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'InnoDB'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -1058,6 +1053,29 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +PARTITION BY HASH(f_int1) PARTITIONS 1.6; +ERROR 42000: Only integers allowed as number here near '1.6' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 1.6 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '1.6 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (21' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) PARTITION BY HASH(f_int1) PARTITIONS 999999999999999999999999999999.999999999999999999999999999999; ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999' at line 8 CREATE TABLE t1 ( @@ -1127,6 +1145,29 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +PARTITION BY HASH(f_int1) PARTITIONS 0.2E+1; +ERROR 42000: Only integers allowed as number here near '0.2E+1' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 0.2E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '0.2E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN ' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) PARTITION BY HASH(f_int1) PARTITIONS -2.0E+0; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2.0E+0' at line 8 CREATE TABLE t1 ( @@ -1150,6 +1191,29 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +PARTITION BY HASH(f_int1) PARTITIONS 0.16E+1; +ERROR 42000: Only integers allowed as number here near '0.16E+1' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 0.16E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '0.16E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) PARTITION BY HASH(f_int1) PARTITIONS 0.0E+300; ERROR 42000: Only integers allowed as number here near '0.0E+300' at line 8 CREATE TABLE t1 ( @@ -1166,6 +1230,52 @@ PARTITION part2 VALUES LESS THAN (2147483646)); ERROR 42000: Only integers allowed as number here near '0.0E+300 (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THA' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY HASH(f_int1) PARTITIONS 1E+300; +ERROR 42000: Only integers allowed as number here near '1E+300' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 1E+300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '1E+300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN ' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY HASH(f_int1) PARTITIONS 1E-300; +ERROR 42000: Only integers allowed as number here near '1E-300' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 1E-300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '1E-300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN ' at line 9 # 4.2.4 partition/subpartition numbers STRING notation CREATE TABLE t1 ( f_int1 INTEGER, diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result index ceac1b4f1b9..93cb075ce2f 100644 --- a/mysql-test/suite/parts/r/partition_syntax_myisam.result +++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result @@ -2,11 +2,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'MyISAM'; #------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -#------------------------------------------------------------------------ - -#------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases #------------------------------------------------------------------------ @@ -1140,6 +1135,29 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +PARTITION BY HASH(f_int1) PARTITIONS 1.6; +ERROR 42000: Only integers allowed as number here near '1.6' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 1.6 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '1.6 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (21' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) PARTITION BY HASH(f_int1) PARTITIONS 999999999999999999999999999999.999999999999999999999999999999; ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999' at line 8 CREATE TABLE t1 ( @@ -1209,6 +1227,29 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +PARTITION BY HASH(f_int1) PARTITIONS 0.2E+1; +ERROR 42000: Only integers allowed as number here near '0.2E+1' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 0.2E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '0.2E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN ' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) PARTITION BY HASH(f_int1) PARTITIONS -2.0E+0; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2.0E+0' at line 8 CREATE TABLE t1 ( @@ -1232,6 +1273,29 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +PARTITION BY HASH(f_int1) PARTITIONS 0.16E+1; +ERROR 42000: Only integers allowed as number here near '0.16E+1' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 0.16E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '0.16E+1 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) PARTITION BY HASH(f_int1) PARTITIONS 0.0E+300; ERROR 42000: Only integers allowed as number here near '0.0E+300' at line 8 CREATE TABLE t1 ( @@ -1248,6 +1312,52 @@ PARTITION part2 VALUES LESS THAN (2147483646)); ERROR 42000: Only integers allowed as number here near '0.0E+300 (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THA' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY HASH(f_int1) PARTITIONS 1E+300; +ERROR 42000: Only integers allowed as number here near '1E+300' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 1E+300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '1E+300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN ' at line 9 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY HASH(f_int1) PARTITIONS 1E-300; +ERROR 42000: Only integers allowed as number here near '1E-300' at line 8 +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +SUBPARTITIONS 1E-300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN (2147483646)); +ERROR 42000: Only integers allowed as number here near '1E-300 +(PARTITION part1 VALUES LESS THAN (10), +PARTITION part2 VALUES LESS THAN ' at line 9 # 4.2.4 partition/subpartition numbers STRING notation CREATE TABLE t1 ( f_int1 INTEGER, diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index 1b70519b72c..85b31bb0598 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -12,9 +12,7 @@ partition_value_ndb : cannot create t1 partition_basic_ndb : cannot create t1 partition_alter1_ndb : timeout. Needs too much time. partition_alter2_ndb : cannot create t1 -partition_char_innodb : crash. Bug? More investigations partition_sessions : needs system_3_init.inc partition_engine_ndb : cannot create t1 part_supported_sql_func_ndb : cannot create t1 rpl_ndb_dd_partitions : cannot create t1 -partition_float_innodb : Bug#30583 Partition on DOUBLE key + INNODB + count(*) == crash diff --git a/mysql-test/suite/parts/t/part_blocked_sql_func_innodb.test b/mysql-test/suite/parts/t/part_blocked_sql_func_innodb.test index c2bbf6ad26c..12f5aabf59f 100644 --- a/mysql-test/suite/parts/t/part_blocked_sql_func_innodb.test +++ b/mysql-test/suite/parts/t/part_blocked_sql_func_innodb.test @@ -14,11 +14,11 @@ ################################################################################ # -# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -40,5 +40,3 @@ let $engine= 'INNODB'; #------------------------------------------------------------------------------# --source suite/parts/inc/part_blocked_sql_funcs_main.inc -# --source inc/part_blocked_sql_funcs_main.inc - diff --git a/mysql-test/suite/parts/t/part_blocked_sql_func_myisam.test b/mysql-test/suite/parts/t/part_blocked_sql_func_myisam.test index bd7247e4ba5..6478f8c9f81 100644 --- a/mysql-test/suite/parts/t/part_blocked_sql_func_myisam.test +++ b/mysql-test/suite/parts/t/part_blocked_sql_func_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -39,5 +39,3 @@ let $engine= 'MYISAM'; #------------------------------------------------------------------------------# --source suite/parts/inc/part_blocked_sql_funcs_main.inc -# --source inc/part_blocked_sql_funcs_main.inc - diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test b/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test index ee765bbe1d0..e8d263e369c 100644 --- a/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test +++ b/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test @@ -14,7 +14,7 @@ ################################################################################ # -# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # @@ -38,5 +38,3 @@ let $engine= 'INNODB'; #------------------------------------------------------------------------------# --source suite/parts/inc/part_supported_sql_funcs_main.inc -# --source inc/part_supported_sql_funcs_main.inc - diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_myisam.test b/mysql-test/suite/parts/t/part_supported_sql_func_myisam.test index 58c7d8ebfb1..4fb1e532c6b 100644 --- a/mysql-test/suite/parts/t/part_supported_sql_func_myisam.test +++ b/mysql-test/suite/parts/t/part_supported_sql_func_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -40,5 +40,3 @@ let $engine= 'MYISAM'; #------------------------------------------------------------------------------# --source suite/parts/inc/part_supported_sql_funcs_main.inc -# --source inc/part_supported_sql_funcs_main.inc - diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test b/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test index c21ffe16d19..c21649ba396 100644 --- a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test +++ b/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test @@ -30,11 +30,9 @@ let $do_long_tests= 1; #------------------------------------------------------------------------------# # Engine specific settings and requirements ---source include/have_ndb.inc ##### Storage engine to be tested +--source include/have_ndb.inc let $engine= 'NDB'; #------------------------------------------------------------------------------# --source suite/parts/inc/part_supported_sql_funcs_main.inc -# --source inc/part_supported_sql_funcs_main.inc - diff --git a/mysql-test/suite/parts/t/partition_alter1_innodb.test b/mysql-test/suite/parts/t/partition_alter1_innodb.test index 2667f1dbccd..bc07a832043 100644 --- a/mysql-test/suite/parts/t/partition_alter1_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter1_innodb.test @@ -6,7 +6,7 @@ # InnoDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -64,7 +64,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -72,7 +71,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter1.inc -# --source inc/partition_alter1.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -80,4 +78,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_myisam.test b/mysql-test/suite/parts/t/partition_alter1_myisam.test index 0959de92c15..a6a60f4a61d 100644 --- a/mysql-test/suite/parts/t/partition_alter1_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter1_myisam.test @@ -6,7 +6,7 @@ # MyISAM branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -63,7 +63,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +70,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter1.inc -# --source inc/partition_alter1.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +77,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_ndb.test b/mysql-test/suite/parts/t/partition_alter1_ndb.test index 96ea9376eb9..cb18b203d39 100644 --- a/mysql-test/suite/parts/t/partition_alter1_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter1_ndb.test @@ -6,7 +6,7 @@ # NDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'ndbcluster'; --source include/have_ndb.inc +let $engine= 'ndbcluster'; ##### Execute the test of "table" files # NDB has no files per PK, UI, ... @@ -67,7 +67,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response @@ -76,7 +75,6 @@ let $fixed_bug18735= 0; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter1.inc -# --source inc/partition_alter1.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -84,4 +82,3 @@ let $fixed_bug18735= 0; #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_innodb.test b/mysql-test/suite/parts/t/partition_alter2_innodb.test index df2b4a0e048..a5efdc71437 100644 --- a/mysql-test/suite/parts/t/partition_alter2_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter2_innodb.test @@ -6,7 +6,7 @@ # InnoDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -64,7 +64,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -72,7 +71,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter2.inc -# --source inc/partition_alter2.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -80,4 +78,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_myisam.test b/mysql-test/suite/parts/t/partition_alter2_myisam.test index b8b92d1b218..a5b6380ef15 100644 --- a/mysql-test/suite/parts/t/partition_alter2_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter2_myisam.test @@ -6,7 +6,7 @@ # MyISAM branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -63,7 +63,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +70,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter2.inc -# --source inc/partition_alter2.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +77,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter2_ndb.test b/mysql-test/suite/parts/t/partition_alter2_ndb.test index 8506ec3fea8..e9b4da93b7a 100644 --- a/mysql-test/suite/parts/t/partition_alter2_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter2_ndb.test @@ -6,7 +6,7 @@ # NDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -48,8 +48,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'ndbcluster'; --source include/have_ndb.inc +let $engine= 'ndbcluster'; ##### Execute the test of "table" files # NDB has no files per PK, UI, ... @@ -68,7 +68,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -76,7 +75,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter2.inc -# --source inc/partition_alter2.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -84,4 +82,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter3_innodb.test b/mysql-test/suite/parts/t/partition_alter3_innodb.test index 253cd7242bd..23c1a987aae 100644 --- a/mysql-test/suite/parts/t/partition_alter3_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter3_innodb.test @@ -6,7 +6,7 @@ # InnoDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-24 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -46,8 +46,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -63,7 +63,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +70,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter3.inc -# --source inc/partition_alter3.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +77,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter3_myisam.test b/mysql-test/suite/parts/t/partition_alter3_myisam.test index 894340de4db..2212065fcc1 100644 --- a/mysql-test/suite/parts/t/partition_alter3_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter3_myisam.test @@ -6,7 +6,7 @@ # MyISAM branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -62,7 +62,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -70,7 +69,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter3.inc -# --source inc/partition_alter3.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -78,4 +76,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter4_innodb.test b/mysql-test/suite/parts/t/partition_alter4_innodb.test index eea8b9997ef..3061e5c9e7f 100644 --- a/mysql-test/suite/parts/t/partition_alter4_innodb.test +++ b/mysql-test/suite/parts/t/partition_alter4_innodb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -64,7 +64,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -72,7 +71,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter4.inc -# --source inc/partition_alter4.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -80,4 +78,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_alter4_myisam.test b/mysql-test/suite/parts/t/partition_alter4_myisam.test index 064dc111ef3..3b2117a3745 100644 --- a/mysql-test/suite/parts/t/partition_alter4_myisam.test +++ b/mysql-test/suite/parts/t/partition_alter4_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -63,7 +63,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +70,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_alter4.inc -# --source inc/partition_alter4.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +77,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_basic_innodb.test b/mysql-test/suite/parts/t/partition_basic_innodb.test index 8e6f6e6d166..2c3e172014c 100644 --- a/mysql-test/suite/parts/t/partition_basic_innodb.test +++ b/mysql-test/suite/parts/t/partition_basic_innodb.test @@ -6,7 +6,7 @@ # InnoDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -64,7 +64,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -72,7 +71,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_basic.inc -# --source inc/partition_basic.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -80,4 +78,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_basic_myisam.test b/mysql-test/suite/parts/t/partition_basic_myisam.test index 4f653db88e3..c363d06b00a 100644 --- a/mysql-test/suite/parts/t/partition_basic_myisam.test +++ b/mysql-test/suite/parts/t/partition_basic_myisam.test @@ -6,7 +6,7 @@ # MyISAM branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -48,6 +48,9 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested let $engine= 'MyISAM'; +# The server uses in case of MyISAM symlinking (if available) and the expected +# results fit to symlinking support. +--source include/have_symlink.inc ##### Execute the test of "table" files # MyISAM has files per PK, UI, ... @@ -63,7 +66,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +73,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_basic.inc -# --source inc/partition_basic.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +80,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_basic_ndb.test b/mysql-test/suite/parts/t/partition_basic_ndb.test index 2e6f830eefc..273d92ac80d 100644 --- a/mysql-test/suite/parts/t/partition_basic_ndb.test +++ b/mysql-test/suite/parts/t/partition_basic_ndb.test @@ -6,7 +6,7 @@ # NDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -48,8 +48,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'ndbcluster'; --source include/have_ndb.inc +let $engine= 'ndbcluster'; ##### Execute the test of "table" files # NDB has no files per PK, UI, ... @@ -68,18 +68,16 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # Bug#18730 Partitions: NDB, crash on SELECT MIN(<unique column>) -let $fixed_bug18730= 0; +let $fixed_bug18730= 1; # Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response let $fixed_bug18735= 0; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_basic.inc -# --source inc/partition_basic.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -87,4 +85,3 @@ let $fixed_bug18735= 0; #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_bit_innodb.test b/mysql-test/suite/parts/t/partition_bit_innodb.test index 7bc74036b2e..9b8eb90bb18 100644 --- a/mysql-test/suite/parts/t/partition_bit_innodb.test +++ b/mysql-test/suite/parts/t/partition_bit_innodb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -53,5 +53,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_bit.inc -# --source inc/partition_basic.inc - diff --git a/mysql-test/suite/parts/t/partition_bit_myisam.test b/mysql-test/suite/parts/t/partition_bit_myisam.test index c21ca104ca5..d2503c4923a 100644 --- a/mysql-test/suite/parts/t/partition_bit_myisam.test +++ b/mysql-test/suite/parts/t/partition_bit_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -52,5 +52,4 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_bit.inc -# --source inc/partition_basic.inc diff --git a/mysql-test/suite/parts/t/partition_bit_ndb.test b/mysql-test/suite/parts/t/partition_bit_ndb.test index 9e21c7de158..94e4119031c 100644 --- a/mysql-test/suite/parts/t/partition_bit_ndb.test +++ b/mysql-test/suite/parts/t/partition_bit_ndb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -53,5 +53,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_bit.inc -# --source inc/partition_basic.inc - diff --git a/mysql-test/suite/parts/t/partition_char_innodb.test b/mysql-test/suite/parts/t/partition_char_innodb.test index 27295084de4..0fd74dc46bd 100644 --- a/mysql-test/suite/parts/t/partition_char_innodb.test +++ b/mysql-test/suite/parts/t/partition_char_innodb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -35,8 +35,8 @@ let $debug= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### max rows to be inserted let $maxrows=65535; @@ -51,11 +51,3 @@ let $maxrows=65535; --source suite/parts/inc/partition_set.inc --source suite/parts/inc/partition_blob.inc --source suite/parts/inc/partition_text.inc -# --source inc/partition_char.inc -# --source inc/partition_binary.inc -# --source inc/partition_varchar.inc -# --source inc/partition_varbinary.inc -# --source inc/partition_enum.inc -# --source inc/partition_set.inc -# --source inc/partition_blob.inc -# --source inc/partition_text.inc diff --git a/mysql-test/suite/parts/t/partition_char_myisam.test b/mysql-test/suite/parts/t/partition_char_myisam.test index bdcb2cd9c24..63f478ec4ba 100644 --- a/mysql-test/suite/parts/t/partition_char_myisam.test +++ b/mysql-test/suite/parts/t/partition_char_myisam.test @@ -1,9 +1,9 @@ ################################################################################ -# t/partition_special_myisam.test # +# t/partition_char_myisam.test # # # # Purpose: # -# different Tests # -# MYISAM branch # +# Tests around character types # +# MyISAM branch # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -37,7 +37,16 @@ let $debug= 0; ##### Storage engine to be tested let $engine= 'MyISAM'; +##### max rows to be inserted +let $maxrows=65535; + #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines ---source suite/parts/inc/partition_key_4col.inc -# --source inc/partition_key_4col.inc +--source suite/parts/inc/partition_char.inc +--source suite/parts/inc/partition_binary.inc +--source suite/parts/inc/partition_varchar.inc +--source suite/parts/inc/partition_varbinary.inc +--source suite/parts/inc/partition_enum.inc +--source suite/parts/inc/partition_set.inc +--source suite/parts/inc/partition_blob.inc +--source suite/parts/inc/partition_text.inc diff --git a/mysql-test/suite/parts/t/partition_datetime_innodb.test b/mysql-test/suite/parts/t/partition_datetime_innodb.test index eba0bc3e10b..ec292fa04cf 100644 --- a/mysql-test/suite/parts/t/partition_datetime_innodb.test +++ b/mysql-test/suite/parts/t/partition_datetime_innodb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -35,8 +35,8 @@ let $debug= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### max rows to be inserted let $maxrows=1024; @@ -48,8 +48,3 @@ let $maxrows=1024; --source suite/parts/inc/partition_time.inc --source suite/parts/inc/partition_datetime.inc --source suite/parts/inc/partition_year.inc -# --source inc/partition_timestamp.inc -# --source inc/partition_date.inc -# --source inc/partition_time.inc -# --source inc/partition_datetime.inc -# --source inc/partition_year.inc diff --git a/mysql-test/suite/parts/t/partition_datetime_myisam.test b/mysql-test/suite/parts/t/partition_datetime_myisam.test index 1fd6527d38e..25e304d5dcc 100644 --- a/mysql-test/suite/parts/t/partition_datetime_myisam.test +++ b/mysql-test/suite/parts/t/partition_datetime_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,3 @@ let $maxrows=65535; --source suite/parts/inc/partition_time.inc --source suite/parts/inc/partition_datetime.inc --source suite/parts/inc/partition_year.inc -# --source inc/partition_timestamp.inc -# --source inc/partition_date.inc -# --source inc/partition_time.inc -# --source inc/partition_datetime.inc -# --source inc/partition_year.inc diff --git a/mysql-test/suite/parts/t/partition_decimal_innodb.test b/mysql-test/suite/parts/t/partition_decimal_innodb.test index 22e759ec5d9..6d0aa156abe 100644 --- a/mysql-test/suite/parts/t/partition_decimal_innodb.test +++ b/mysql-test/suite/parts/t/partition_decimal_innodb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -35,8 +35,8 @@ let $debug= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### number of rows to be inserted let $maxrows=1024; @@ -44,4 +44,3 @@ let $maxrows=1024; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_decimal.inc -# --source inc/partition_decimal.inc diff --git a/mysql-test/suite/parts/t/partition_decimal_myisam.test b/mysql-test/suite/parts/t/partition_decimal_myisam.test index 9be50028647..49fc64cbd37 100644 --- a/mysql-test/suite/parts/t/partition_decimal_myisam.test +++ b/mysql-test/suite/parts/t/partition_decimal_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -42,4 +42,3 @@ let $maxrows=65535; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_decimal.inc -# --source inc/partition_decimal.inc diff --git a/mysql-test/suite/parts/t/partition_engine_innodb.test b/mysql-test/suite/parts/t/partition_engine_innodb.test index 6205c970b21..13a7b133fa1 100644 --- a/mysql-test/suite/parts/t/partition_engine_innodb.test +++ b/mysql-test/suite/parts/t/partition_engine_innodb.test @@ -6,7 +6,7 @@ # InnoDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -46,8 +46,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -63,7 +63,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +70,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_engine.inc -# --source inc/partition_engine.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +77,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_engine_myisam.test b/mysql-test/suite/parts/t/partition_engine_myisam.test index 437e20ab3ee..a7696d690db 100644 --- a/mysql-test/suite/parts/t/partition_engine_myisam.test +++ b/mysql-test/suite/parts/t/partition_engine_myisam.test @@ -6,7 +6,7 @@ # MyISAM branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -62,7 +62,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -70,7 +69,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_engine.inc -# --source inc/partition_engine.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -78,4 +76,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_engine_ndb.test b/mysql-test/suite/parts/t/partition_engine_ndb.test index 223e9b035c6..1e185c8ebaa 100644 --- a/mysql-test/suite/parts/t/partition_engine_ndb.test +++ b/mysql-test/suite/parts/t/partition_engine_ndb.test @@ -6,7 +6,7 @@ # NDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -67,7 +67,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -75,7 +74,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_engine.inc -# --source inc/partition_engine.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -83,4 +81,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_float_innodb.test b/mysql-test/suite/parts/t/partition_float_innodb.test index 3395d1812d2..2f1fe723dad 100644 --- a/mysql-test/suite/parts/t/partition_float_innodb.test +++ b/mysql-test/suite/parts/t/partition_float_innodb.test @@ -1,9 +1,9 @@ ################################################################################ -# t/partition_float_myisam.test # +# t/partition_float_innodb.test # # # # Purpose: # # Tests around float type # -# MyISAM branch # +# INNODB branch # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -14,11 +14,11 @@ ################################################################################ # -# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -35,8 +35,8 @@ let $debug= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Number of row to be inserted. let $maxrows=1024; @@ -45,5 +45,3 @@ let $maxrows=1024; # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_float.inc --source suite/parts/inc/partition_double.inc -# --source inc/partition_float.inc -# --source inc/partition_double.inc diff --git a/mysql-test/suite/parts/t/partition_float_myisam.test b/mysql-test/suite/parts/t/partition_float_myisam.test index 57ef91a3169..51e0f1f5a21 100644 --- a/mysql-test/suite/parts/t/partition_float_myisam.test +++ b/mysql-test/suite/parts/t/partition_float_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -43,5 +43,3 @@ let $maxrows=16384; # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_float.inc --source suite/parts/inc/partition_double.inc -# --source inc/partition_float.inc -# --source inc/partition_double.inc diff --git a/mysql-test/suite/parts/t/partition_int_innodb.test b/mysql-test/suite/parts/t/partition_int_innodb.test index dc14b369654..698a2c93c22 100644 --- a/mysql-test/suite/parts/t/partition_int_innodb.test +++ b/mysql-test/suite/parts/t/partition_int_innodb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -35,8 +35,8 @@ let $debug= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### max rows to be inserted let $maxrows=1024; @@ -48,8 +48,3 @@ let $maxrows=1024; --source suite/parts/inc/partition_int.inc --source suite/parts/inc/partition_mediumint.inc --source suite/parts/inc/partition_bigint.inc -# --source inc/partition_tinyint.inc -# --source inc/partition_samllint.inc -# --source inc/partition_int.inc -# --source inc/partition_mediumint.inc -# --source inc/partition_bigint.inc diff --git a/mysql-test/suite/parts/t/partition_int_myisam.test b/mysql-test/suite/parts/t/partition_int_myisam.test index c85a1471a35..b0ede4995e8 100644 --- a/mysql-test/suite/parts/t/partition_int_myisam.test +++ b/mysql-test/suite/parts/t/partition_int_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -46,8 +46,3 @@ let $maxrows=65535; --source suite/parts/inc/partition_int.inc --source suite/parts/inc/partition_mediumint.inc --source suite/parts/inc/partition_bigint.inc -# --source inc/partition_tinyint.inc -# --source inc/partition_samllint.inc -# --source inc/partition_int.inc -# --source inc/partition_mediumint.inc -# --source inc/partition_bigint.inc diff --git a/mysql-test/suite/parts/t/partition_int_ndb.test b/mysql-test/suite/parts/t/partition_int_ndb.test index dfa853bed16..0a60408292a 100644 --- a/mysql-test/suite/parts/t/partition_int_ndb.test +++ b/mysql-test/suite/parts/t/partition_int_ndb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -45,8 +45,3 @@ let $engine= 'NDB'; --source suite/parts/inc/partition_int.inc --source suite/parts/inc/partition_mediumint.inc --source suite/parts/inc/partition_bigint.inc -# --source inc/partition_tinyint.inc -# --source inc/partition_samllint.inc -# --source inc/partition_int.inc -# --source inc/partition_mediumint.inc -# --source inc/partition_bigint.inc diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test index f552d64f4e4..598dfea1e27 100644 --- a/mysql-test/suite/parts/t/partition_special_innodb.test +++ b/mysql-test/suite/parts/t/partition_special_innodb.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -35,8 +35,8 @@ let $debug= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines @@ -44,7 +44,3 @@ let $engine= 'InnoDB'; --source suite/parts/inc/partition_key_8col.inc --source suite/parts/inc/partition_key_16col.inc --source suite/parts/inc/partition_key_32col.inc -# --source inc/partition_key_4col.inc -# --source inc/partition_key_8col.inc -# --source inc/partition_key_16col.inc -# --source inc/partition_key_32col.inc diff --git a/mysql-test/suite/parts/t/partition_special_myisam.test b/mysql-test/suite/parts/t/partition_special_myisam.test index c87d39ab577..e1737ebc3c2 100644 --- a/mysql-test/suite/parts/t/partition_special_myisam.test +++ b/mysql-test/suite/parts/t/partition_special_myisam.test @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -43,7 +43,3 @@ let $engine= 'MyISAM'; --source suite/parts/inc/partition_key_8col.inc --source suite/parts/inc/partition_key_16col.inc --source suite/parts/inc/partition_key_32col.inc -# --source inc/partition_key_4col.inc -# --source inc/partition_key_8col.inc -# --source inc/partition_key_16col.inc -# --source inc/partition_key_32col.inc diff --git a/mysql-test/suite/parts/t/partition_syntax_innodb.test b/mysql-test/suite/parts/t/partition_syntax_innodb.test index ce62b06bd6f..6e65337d267 100644 --- a/mysql-test/suite/parts/t/partition_syntax_innodb.test +++ b/mysql-test/suite/parts/t/partition_syntax_innodb.test @@ -6,7 +6,7 @@ # InnoDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -46,8 +46,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -63,7 +63,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +70,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_syntax.inc -# --source inc/partition_syntax.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +77,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_syntax_myisam.test b/mysql-test/suite/parts/t/partition_syntax_myisam.test index 62396580b50..7777833f6d4 100644 --- a/mysql-test/suite/parts/t/partition_syntax_myisam.test +++ b/mysql-test/suite/parts/t/partition_syntax_myisam.test @@ -6,7 +6,7 @@ # MyISAM branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -62,7 +62,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -70,7 +69,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_syntax.inc -# --source inc/partition_syntax.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -78,4 +76,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_syntax_ndb.test b/mysql-test/suite/parts/t/partition_syntax_ndb.test index 3eb453ce7ea..90b74452ab1 100644 --- a/mysql-test/suite/parts/t/partition_syntax_ndb.test +++ b/mysql-test/suite/parts/t/partition_syntax_ndb.test @@ -6,7 +6,7 @@ # NDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-03-05 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'ndbcluster'; --source include/have_ndb.inc +let $engine= 'ndbcluster'; ##### Execute the test of "table" files # NDB has no files per PK, UI, ... @@ -67,7 +67,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response @@ -76,7 +75,6 @@ let $fixed_bug18735= 0; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_syntax.inc -# --source inc/partition_syntax.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -84,4 +82,3 @@ let $fixed_bug18735= 0; #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_value_innodb.test b/mysql-test/suite/parts/t/partition_value_innodb.test index 2e3c6ff98ad..9d59533a54e 100644 --- a/mysql-test/suite/parts/t/partition_value_innodb.test +++ b/mysql-test/suite/parts/t/partition_value_innodb.test @@ -6,7 +6,7 @@ # InnoDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -46,8 +46,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'InnoDB'; --source include/have_innodb.inc +let $engine= 'InnoDB'; ##### Execute the test of "table" files # InnoDB has no files per PK, UI, ... @@ -63,7 +63,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -71,7 +70,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_value.inc -# --source inc/partition_value.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -79,4 +77,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_value_myisam.test b/mysql-test/suite/parts/t/partition_value_myisam.test index 78e781111f7..d6020669509 100644 --- a/mysql-test/suite/parts/t/partition_value_myisam.test +++ b/mysql-test/suite/parts/t/partition_value_myisam.test @@ -6,7 +6,7 @@ # MyISAM branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -62,7 +62,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -70,7 +69,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_value.inc -# --source inc/partition_value.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -78,4 +76,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_value_ndb.test b/mysql-test/suite/parts/t/partition_value_ndb.test index 94230af131e..91497c3ec42 100644 --- a/mysql-test/suite/parts/t/partition_value_ndb.test +++ b/mysql-test/suite/parts/t/partition_value_ndb.test @@ -6,7 +6,7 @@ # NDB branch # # # #------------------------------------------------------------------------------# -# Original Author: ML # +# Original Author: mleich # # Original Date: 2006-04-11 # # Change Author: # # Change Date: # @@ -18,7 +18,7 @@ # TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN # THE SOURCED FILES ONLY. # -# Please read the README at the end of include/partition.pre before changing +# Please read the README at the end of inc/partition.pre before changing # any of the variables. # @@ -47,8 +47,8 @@ let $more_pk_ui_tests= 0; # Engine specific settings and requirements ##### Storage engine to be tested -let $engine= 'ndbcluster'; --source include/have_ndb.inc +let $engine= 'ndbcluster'; ##### Execute the test of "table" files # NDB has no files per PK, UI, ... @@ -67,7 +67,6 @@ let $MAX_VALUE= (2147483646); # Generate the prerequisites ($variables, @variables, tables) needed --source suite/parts/inc/partition.pre -# --source inc/partition.pre ##### Workarounds for known open engine specific bugs # none @@ -75,7 +74,6 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_value.inc -# --source inc/partition_value.inc #------------------------------------------------------------------------------# # Execute storage engine specific tests @@ -83,4 +81,3 @@ let $MAX_VALUE= (2147483646); #------------------------------------------------------------------------------# # Cleanup --source suite/parts/inc/partition_cleanup.inc -# --source inc/partition_cleanup.inc diff --git a/mysql-test/suite/rpl/data/rpl_bug28618.dat b/mysql-test/suite/rpl/data/rpl_bug28618.dat new file mode 100644 index 00000000000..b800c4dd39d --- /dev/null +++ b/mysql-test/suite/rpl/data/rpl_bug28618.dat @@ -0,0 +1,3 @@ +1|master only +2|master only +3|master only diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc index 5d3b80e077b..b3e0cefbbd7 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc @@ -7,15 +7,15 @@ --echo ==========MASTER========== SELECT COUNT(*) FROM t1; -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; SELECT COUNT(*) FROM t2; -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; sync_slave_with_master; --echo ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; SELECT COUNT(*) FROM t2; -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; connection master; diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc index 43feedfe64a..a9f7ad8cd68 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc @@ -7,11 +7,11 @@ --echo ==========MASTER========== SHOW CREATE VIEW v1; -SELECT * FROM v1; +SELECT * FROM v1 ORDER BY a; sync_slave_with_master; --echo ==========SLAVE=========== USE test_rpl; SHOW CREATE VIEW v1; -SELECT * FROM v1; +SELECT * FROM v1 ORDER BY a; connection master; diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc index a3ff022c43c..d7041d82a2a 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc @@ -51,10 +51,10 @@ DELETE FROM t2 WHERE a = 2; --echo --echo ******************** LOAD DATA INFILE ******************** ---exec cp ./suite/rpl/data/rpl_mixed.dat $MYSQLTEST_VARDIR/tmp/ +--copy_file ./suite/rpl/data/rpl_mixed.dat $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ; --remove_file $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; --source suite/rpl/include/rpl_mixed_check_select.inc --source suite/rpl/include/rpl_mixed_clear_tables.inc @@ -75,7 +75,7 @@ DELETE FROM t1 WHERE a = 2; --echo --echo ******************** SELECT ******************** INSERT INTO t1 VALUES(1, 't1, text 1'); -SELECT * FROM t1 WHERE b <> UUID(); +SELECT * FROM t1 WHERE b <> UUID() ORDER BY a; --source suite/rpl/include/rpl_mixed_clear_tables.inc # JOIN @@ -85,8 +85,8 @@ INSERT INTO t1 VALUES(1, 'CCC'); INSERT INTO t1 VALUES(2, 'DDD'); INSERT INTO t2 VALUES(1, 'DDD'); INSERT INTO t2 VALUES(2, 'CCC'); -SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a; -SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b; +SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a ORDER BY t1.a,t2.a; +SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b ORDER BY t1.a,t2.a; --source suite/rpl/include/rpl_mixed_clear_tables.inc # UNION diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result index 43a21913cf6..72dc58effa1 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result @@ -1,3 +1,9 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; drop database if exists d1; create database d1; use d1; diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result index 007cd5a252c..e268e4c2e51 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result @@ -615,6 +615,66 @@ c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +*** Create t14a on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='InnoDB'; +*** Create t14a on Master *** +CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='InnoDB'; +RESET MASTER; +*** Start Slave *** +START SLAVE; +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14a () VALUES(1,@b1,'Kyle'), +(2,@b1,'JOE'), +(3,@b1,'QA'); +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 +1 b1b1b1b1b1b1b1b1 Kyle +2 b1b1b1b1b1b1b1b1 JOE +3 b1b1b1b1b1b1b1b1 QA +*** Select on Slave **** +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 c6 c7 +1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP +2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP +3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +STOP SLAVE; +RESET SLAVE; +*** Master Drop c5 *** +ALTER TABLE t14a DROP COLUMN c5; +RESET MASTER; +*** Start Slave *** +START SLAVE; +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14a () VALUES(4,@b1), +(5,@b1), +(6,@b1); +SELECT * FROM t14a ORDER BY c1; +c1 c4 +1 b1b1b1b1b1b1b1b1 +2 b1b1b1b1b1b1b1b1 +3 b1b1b1b1b1b1b1b1 +4 b1b1b1b1b1b1b1b1 +5 b1b1b1b1b1b1b1b1 +6 b1b1b1b1b1b1b1b1 +*** Select on Slave **** +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 c6 c7 +1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP +2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP +3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP +5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP +6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP *** connect to master and drop columns *** ALTER TABLE t14 DROP COLUMN c2; ALTER TABLE t14 DROP COLUMN c4; @@ -707,7 +767,7 @@ Last_IO_Errno # Last_IO_Error # Last_SQL_Errno 1060 Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; *** Try to insert in master **** INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); @@ -723,6 +783,7 @@ c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP *** DROP TABLE t15 *** DROP TABLE t15; *** Create t16 on slave *** diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result index 873fc5cddbc..364354d3a17 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result @@ -615,6 +615,66 @@ c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +*** Create t14a on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='MyISAM'; +*** Create t14a on Master *** +CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='MyISAM'; +RESET MASTER; +*** Start Slave *** +START SLAVE; +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14a () VALUES(1,@b1,'Kyle'), +(2,@b1,'JOE'), +(3,@b1,'QA'); +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 +1 b1b1b1b1b1b1b1b1 Kyle +2 b1b1b1b1b1b1b1b1 JOE +3 b1b1b1b1b1b1b1b1 QA +*** Select on Slave **** +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 c6 c7 +1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP +2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP +3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +STOP SLAVE; +RESET SLAVE; +*** Master Drop c5 *** +ALTER TABLE t14a DROP COLUMN c5; +RESET MASTER; +*** Start Slave *** +START SLAVE; +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14a () VALUES(4,@b1), +(5,@b1), +(6,@b1); +SELECT * FROM t14a ORDER BY c1; +c1 c4 +1 b1b1b1b1b1b1b1b1 +2 b1b1b1b1b1b1b1b1 +3 b1b1b1b1b1b1b1b1 +4 b1b1b1b1b1b1b1b1 +5 b1b1b1b1b1b1b1b1 +6 b1b1b1b1b1b1b1b1 +*** Select on Slave **** +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 c6 c7 +1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP +2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP +3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP +5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP +6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP *** connect to master and drop columns *** ALTER TABLE t14 DROP COLUMN c2; ALTER TABLE t14 DROP COLUMN c4; @@ -707,7 +767,7 @@ Last_IO_Errno # Last_IO_Error # Last_SQL_Errno 1060 Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; *** Try to insert in master **** INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); @@ -723,6 +783,7 @@ c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP +5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP *** DROP TABLE t15 *** DROP TABLE t15; *** Create t16 on slave *** diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index a7d9e12aabd..af460ded1e7 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result @@ -440,7 +440,7 @@ f1 f2 f3 f4 select * from t4 order by f1; f1 f2 f3 f4 1 1 1 first -select * from t31 order by f1; +select * from t31 order by f3; f1 f2 f3 f4 1 1 1 first 1 1 2 second @@ -563,7 +563,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Skip_Counter 0 Exec_Master_Log_Pos # @@ -581,7 +581,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -638,7 +638,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Skip_Counter 0 Exec_Master_Log_Pos # @@ -656,7 +656,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1580,7 +1580,7 @@ f1 f2 f3 f4 select * from t4 order by f1; f1 f2 f3 f4 1 1 1 first -select * from t31 order by f1; +select * from t31 order by f3; f1 f2 f3 f4 1 1 1 first 1 1 2 second @@ -1703,7 +1703,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Skip_Counter 0 Exec_Master_Log_Pos # @@ -1721,7 +1721,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1778,7 +1778,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Skip_Counter 0 Exec_Master_Log_Pos # @@ -1796,7 +1796,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2720,7 +2720,7 @@ f1 f2 f3 f4 select * from t4 order by f1; f1 f2 f3 f4 1 1 1 first -select * from t31 order by f1; +select * from t31 order by f3; f1 f2 f3 f4 1 1 1 first 1 1 2 second @@ -2843,7 +2843,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Skip_Counter 0 Exec_Master_Log_Pos # @@ -2861,7 +2861,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2918,7 +2918,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Skip_Counter 0 Exec_Master_Log_Pos # @@ -2936,7 +2936,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index a8762d447d6..f0613c16825 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result @@ -440,7 +440,7 @@ f1 f2 f3 f4 select * from t4 order by f1; f1 f2 f3 f4 1 1 1 first -select * from t31 order by f1; +select * from t31 order by f3; f1 f2 f3 f4 1 1 1 first 1 1 2 second @@ -563,7 +563,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Skip_Counter 0 Exec_Master_Log_Pos # @@ -581,7 +581,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -638,7 +638,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Skip_Counter 0 Exec_Master_Log_Pos # @@ -656,7 +656,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1580,7 +1580,7 @@ f1 f2 f3 f4 select * from t4 order by f1; f1 f2 f3 f4 1 1 1 first -select * from t31 order by f1; +select * from t31 order by f3; f1 f2 f3 f4 1 1 1 first 1 1 2 second @@ -1703,7 +1703,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Skip_Counter 0 Exec_Master_Log_Pos # @@ -1721,7 +1721,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1778,7 +1778,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Skip_Counter 0 Exec_Master_Log_Pos # @@ -1796,7 +1796,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2720,7 +2720,7 @@ f1 f2 f3 f4 select * from t4 order by f1; f1 f2 f3 f4 1 1 1 first -select * from t31 order by f1; +select * from t31 order by f3; f1 f2 f3 f4 1 1 1 first 1 1 2 second @@ -2843,7 +2843,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 Skip_Counter 0 Exec_Master_Log_Pos # @@ -2861,7 +2861,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2918,7 +2918,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1534 +Last_Errno 1535 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 Skip_Counter 0 Exec_Master_Log_Pos # @@ -2936,7 +2936,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1534 +Last_SQL_Errno 1535 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_found_rows.result b/mysql-test/suite/rpl/r/rpl_found_rows.result new file mode 100644 index 00000000000..7e757a1d141 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_found_rows.result @@ -0,0 +1,233 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +==== 0. Setting it all up ==== +SET BINLOG_FORMAT=STATEMENT; +**** On Master **** +CREATE TABLE t1 (a INT); +CREATE TABLE logtbl (sect INT, test INT, count INT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +#### 1. Using statement mode #### +==== 1.1. Simple test ==== +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,1,@a); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +a +1 +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,2,@a); +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +sect test count +1 1 183 +1 2 3 +**** On Slave **** +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +sect test count +1 1 183 +1 2 3 +==== 1.2. Stored procedure ==== +**** On Master **** +CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN +DECLARE cnt INT; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO cnt; +INSERT INTO logtbl VALUES(sect,test,cnt); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO cnt; +INSERT INTO logtbl VALUES(sect,test+1,cnt); +END $$ +CALL calc_and_log(2,1); +a +1 +a +7 +CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN +INSERT INTO logtbl VALUES (sect,test,found_rows); +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +SELECT FOUND_ROWS() INTO @found_rows; +CALL just_log(2,3,@found_rows); +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +sect test count +2 1 3 +2 2 183 +2 3 183 +**** On Slave **** +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +sect test count +2 1 3 +2 2 183 +2 3 183 +==== 1.3. Stored functions ==== +**** On Master **** +CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT) +RETURNS INT +BEGIN +INSERT INTO logtbl VALUES(sect,test,found_rows); +RETURN found_rows; +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +SELECT FOUND_ROWS() INTO @found_rows; +SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows); +log_rows(3,1,@found_rows) log_rows(3,2,@found_rows) +183 183 +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; +sect test count +3 1 183 +3 2 183 +**** On Slave **** +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; +sect test count +3 1 183 +3 2 183 +==== 1.9. Cleanup ==== +**** On Master **** +DELETE FROM logtbl; +DROP PROCEDURE just_log; +DROP PROCEDURE calc_and_log; +DROP FUNCTION log_rows; +**** Resetting master and slave **** +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +#### 2. Using mixed mode #### +==== 2.1. Checking a procedure ==== +**** On Master **** +SET BINLOG_FORMAT=MIXED; +CREATE PROCEDURE just_log(sect INT, test INT) BEGIN +INSERT INTO logtbl VALUES (sect,test,FOUND_ROWS()); +END $$ +**** On Master 1 **** +SET BINLOG_FORMAT=MIXED; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +CALL just_log(1,1); +**** On Master **** +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +CALL just_log(1,2); +**** On Master 1 **** +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +a +1 +CALL just_log(1,3); +**** On Master **** +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +CALL just_log(1,4); +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +sect test count +1 1 183 +1 2 183 +1 3 3 +1 4 183 +**** On Slave **** +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +sect test count +1 1 183 +1 2 183 +1 3 3 +1 4 183 +==== 2.1. Checking a stored function ==== +**** On Master **** +CREATE FUNCTION log_rows(sect INT, test INT) +RETURNS INT +BEGIN +DECLARE found_rows INT; +SELECT FOUND_ROWS() INTO found_rows; +INSERT INTO logtbl VALUES(sect,test,found_rows); +RETURN found_rows; +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +a +1 +SELECT log_rows(2,1), log_rows(2,2); +log_rows(2,1) log_rows(2,2) +3 3 +CREATE TABLE t2 (a INT, b INT); +CREATE TRIGGER t2_tr BEFORE INSERT ON t2 FOR EACH ROW +BEGIN +INSERT INTO logtbl VALUES (NEW.a, NEW.b, FOUND_ROWS()); +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +a +1 +INSERT INTO t2 VALUES (2,3), (2,4); +DROP TRIGGER t2_tr; +CREATE TRIGGER t2_tr BEFORE INSERT ON t2 FOR EACH ROW +BEGIN +DECLARE dummy INT; +SELECT log_rows(NEW.a, NEW.b) INTO dummy; +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +INSERT INTO t2 VALUES (2,5), (2,6); +DROP TRIGGER t2_tr; +CREATE PROCEDURE log_me_inner(sect INT, test INT) +BEGIN +DECLARE dummy INT; +SELECT log_rows(sect, test) INTO dummy; +SELECT log_rows(sect, test+1) INTO dummy; +END $$ +CREATE PROCEDURE log_me(sect INT, test INT) +BEGIN +CALL log_me_inner(sect,test); +END $$ +CREATE TRIGGER t2_tr BEFORE INSERT ON t2 FOR EACH ROW +BEGIN +CALL log_me(NEW.a, NEW.b); +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +INSERT INTO t2 VALUES (2,5), (2,6); +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +sect test count +2 1 3 +2 2 3 +2 3 3 +2 4 3 +2 5 183 +2 5 183 +2 6 183 +2 6 0 +2 6 183 +2 7 0 +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +sect test count +2 1 3 +2 2 3 +2 3 3 +2 4 3 +2 5 183 +2 5 183 +2 6 183 +2 6 0 +2 6 183 +2 7 0 +DROP TABLE t1, logtbl; +DROP PROCEDURE just_log; +DROP PROCEDURE log_me; +DROP PROCEDURE log_me_inner; +DROP FUNCTION log_rows; diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result new file mode 100644 index 00000000000..f17fbd82c44 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -0,0 +1,71 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 (a INT PRIMARY KEY); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (-1),(-2),(-3); +INSERT INTO t2 VALUES (-1),(-2),(-3); +DELETE FROM t1 WHERE a = -2; +DELETE FROM t2 WHERE a = -2; +DELETE FROM t1 WHERE a = -2; +DELETE FROM t2 WHERE a = -2; +SELECT * FROM t1 ORDER BY a; +a +-3 +-1 +SELECT * FROM t2 ORDER BY a; +a +-3 +-1 +SELECT * FROM t1 ORDER BY a; +a +-3 +-1 +SELECT * FROM t2 ORDER BY a; +a +-3 +-1 +Last_SQL_Error +0 +INSERT IGNORE INTO t1 VALUES (-2); +INSERT IGNORE INTO t1 VALUES (-2); +SELECT * FROM t1 ORDER BY a; +a +-3 +-2 +-1 +SELECT * FROM t1 ORDER BY a; +a +-3 +-2 +-1 +Last_SQL_Error +0 +UPDATE t1 SET a = 1 WHERE a = -1; +UPDATE t2 SET a = 1 WHERE a = -1; +UPDATE t1 SET a = 1 WHERE a = -1; +UPDATE t2 SET a = 1 WHERE a = -1; +SELECT * FROM t1 ORDER BY a; +a +-3 +-2 +1 +SELECT * FROM t2 ORDER BY a; +a +-3 +1 +SELECT * FROM t1 ORDER BY a; +a +-3 +-2 +1 +SELECT * FROM t2 ORDER BY a; +a +-3 +1 +Last_SQL_Error +0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result index 99d14b638ad..e92f74e27eb 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result @@ -114,30 +114,30 @@ Create Table CREATE TABLE `byrange_tbl` ( `filler` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB, PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB, PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ -show slave status; -Slave_IO_State Waiting for master to send event +SHOW SLAVE STATUS; +Slave_IO_State # Master_Host 127.0.0.1 Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 Read_Master_Log_Pos 945470 -Relay_Log_File slave-relay-bin.000003 -Relay_Log_Pos 945616 +Relay_Log_File # +Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 Slave_IO_Running Yes Slave_SQL_Running Yes Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table -Replicate_Ignore_Table +Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 Exec_Master_Log_Pos 945470 -Relay_Log_Space 945771 +Relay_Log_Space # Until_Condition None Until_Log_File Until_Log_Pos 0 @@ -149,8 +149,8 @@ Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error +Last_IO_Errno # +Last_IO_Error # Last_SQL_Errno 0 Last_SQL_Error SELECT count(*) "Slave norm" FROM test.regular_tbl; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 19c5299df25..0e11d132cc4 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -41,26 +41,26 @@ DELETE FROM t2 WHERE b <> UUID(); SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 2 t1, text 2 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 2 t1, text 2 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b DELETE FROM t1; DELETE FROM t2; @@ -76,13 +76,13 @@ DELETE FROM t2 WHERE a = 2; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 1 SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 ==========SLAVE=========== @@ -90,13 +90,13 @@ USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 1 SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 DELETE FROM t1; @@ -104,7 +104,7 @@ DELETE FROM t2; ******************** LOAD DATA INFILE ******************** LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ; -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 10 line A 20 line B @@ -113,7 +113,7 @@ a b SELECT COUNT(*) FROM t1; COUNT(*) 3 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 10 line A 20 line B @@ -121,14 +121,14 @@ a b SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 3 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 10 line A 20 line B @@ -136,7 +136,7 @@ a b SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b DELETE FROM t1; DELETE FROM t2; @@ -153,35 +153,35 @@ DELETE FROM t1 WHERE a = 2; SELECT COUNT(*) FROM t1; COUNT(*) 2 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 11 3 t1, text 33 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 2 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 11 3 t1, text 33 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b DELETE FROM t1; DELETE FROM t2; ******************** SELECT ******************** INSERT INTO t1 VALUES(1, 't1, text 1'); -SELECT * FROM t1 WHERE b <> UUID(); +SELECT * FROM t1 WHERE b <> UUID() ORDER BY a; a b 1 t1, text 1 DELETE FROM t1; @@ -192,11 +192,11 @@ INSERT INTO t1 VALUES(1, 'CCC'); INSERT INTO t1 VALUES(2, 'DDD'); INSERT INTO t2 VALUES(1, 'DDD'); INSERT INTO t2 VALUES(2, 'CCC'); -SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a; +SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a ORDER BY t1.a,t2.a; a b a b 1 CCC 1 DDD 2 DDD 2 CCC -SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b; +SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b ORDER BY t1.a,t2.a; a b a b 1 CCC 2 CCC 2 DDD 1 DDD @@ -219,50 +219,50 @@ INSERT INTO t1 VALUES(1, 't1, text 1'); SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b TRUNCATE t1; ==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 0 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 0 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b DELETE FROM t1; DELETE FROM t2; @@ -275,13 +275,13 @@ UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 1 updated SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 ==========SLAVE=========== @@ -289,13 +289,13 @@ USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 t1, text 1 updated SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 t2, text 1 UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test'; @@ -303,13 +303,13 @@ UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test'; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 test ==========SLAVE=========== @@ -317,13 +317,13 @@ USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 test DELETE FROM t1; @@ -349,26 +349,26 @@ COMMIT; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b START TRANSACTION; INSERT INTO t1 VALUES (2, 'rollback'); @@ -377,26 +377,26 @@ ROLLBACK; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b START TRANSACTION; INSERT INTO t1 VALUES (3, 'before savepoint s1'); @@ -407,27 +407,27 @@ ROLLBACK TO SAVEPOINT s1; SELECT COUNT(*) FROM t1; COUNT(*) 2 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start 3 before savepoint s1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b START TRANSACTION; INSERT INTO t1 VALUES (5, 'before savepoint s2'); @@ -441,7 +441,7 @@ DELETE FROM t1 WHERE a = 7; SELECT COUNT(*) FROM t1; COUNT(*) 4 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start 3 before savepoint s1 @@ -450,14 +450,14 @@ a b SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 4 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 start 3 before savepoint s1 @@ -466,7 +466,7 @@ a b SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b DELETE FROM t1; DELETE FROM t2; @@ -610,28 +610,28 @@ DELETE FROM t1 WHERE a = 202; SELECT COUNT(*) FROM t1; COUNT(*) 2 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 100 test 201 test SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 2 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 100 test 201 test SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ALTER PROCEDURE p1 COMMENT 'p1'; DROP PROCEDURE p1; @@ -649,13 +649,13 @@ INSERT INTO t1 VALUES (1, 'test'); SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 test ==========SLAVE=========== @@ -663,13 +663,13 @@ USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test SELECT COUNT(*) FROM t2; COUNT(*) 1 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b 1 test DELETE FROM t1; @@ -694,51 +694,51 @@ test_rpl e1 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ALTER EVENT e1 RENAME TO e2; ==========MASTER========== @@ -754,26 +754,26 @@ test_rpl e2 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b ==========SLAVE=========== USE test_rpl; SELECT COUNT(*) FROM t1; COUNT(*) 1 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a b 1 test1 SELECT COUNT(*) FROM t2; COUNT(*) 0 -SELECT * FROM t2; +SELECT * FROM t2 ORDER BY a; a b DROP EVENT e2; ==========MASTER========== @@ -795,7 +795,7 @@ CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID(); SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci -SELECT * FROM v1; +SELECT * FROM v1 ORDER BY a; a b 1 test1 ==========SLAVE=========== @@ -803,7 +803,7 @@ USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci -SELECT * FROM v1; +SELECT * FROM v1 ORDER BY a; a b 1 test1 ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2; @@ -811,7 +811,7 @@ ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci -SELECT * FROM v1; +SELECT * FROM v1 ORDER BY a; a b 2 test2 ==========SLAVE=========== @@ -819,7 +819,7 @@ USE test_rpl; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci -SELECT * FROM v1; +SELECT * FROM v1 ORDER BY a; a b 2 test2 DROP VIEW v1; diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result index 3bcef762497..502bb040218 100644 --- a/mysql-test/suite/rpl/r/rpl_invoked_features.result +++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result @@ -17,13 +17,13 @@ DROP EVENT IF EXISTS e11; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=myisam; INSERT INTO t1 VALUES (1,1,'1'); INSERT INTO t1 VALUES (2,2,UUID()); -CREATE TABLE t2 (a INT, b INT, c VARCHAR(64)) ENGINE=myisam; +CREATE TABLE t2 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=myisam; INSERT INTO t2 VALUES (1,1,'1'); INSERT INTO t2 VALUES (2,2,UUID()); CREATE TABLE t11 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=innodb; INSERT INTO t11 VALUES (1,1,'1'); INSERT INTO t11 VALUES (2,2,UUID()); -CREATE TABLE t12 (a INT, b INT, c VARCHAR(64)) ENGINE=innodb; +CREATE TABLE t12 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=innodb; INSERT INTO t12 VALUES (1,1,'1'); INSERT INTO t12 VALUES (2,2,UUID()); @@ -49,21 +49,15 @@ BEGIN UPDATE t12 SET c = ''; UPDATE t13 SET c = ''; END| -CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND ENABLE DO +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO BEGIN -DECLARE c INT; -SELECT a INTO c FROM t1 WHERE a < 11 ORDER BY a DESC LIMIT 1; -IF c = 7 THEN +ALTER EVENT e1 DISABLE; CALL p1(10, ''); -END IF; END| -CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND ENABLE DO +CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND DISABLE DO BEGIN -DECLARE c INT; -SELECT a INTO c FROM t11 WHERE a < 11 ORDER BY a DESC LIMIT 1; -IF c = 7 THEN +ALTER EVENT e11 DISABLE; CALL p11(10, ''); -END IF; END| CREATE FUNCTION f1 (x INT) RETURNS VARCHAR(64) BEGIN @@ -78,11 +72,11 @@ RETURN f1(x); END| CREATE PROCEDURE p1 (IN x INT, IN y VARCHAR(64)) BEGIN -INSERT INTO t1 VALUES (x,x,y); +INSERT IGNORE INTO t1 VALUES (x,x,y); END| CREATE PROCEDURE p11 (IN x INT, IN y VARCHAR(64)) BEGIN -INSERT INTO t11 VALUES (x,x,y); +INSERT IGNORE INTO t11 VALUES (x,x,y); END| CREATE TABLE t3 SELECT * FROM v1; @@ -110,6 +104,8 @@ INSERT INTO t11 VALUES(7,7,f2(7)); INSERT INTO t11 VALUES (103,103,''); SET GLOBAL EVENT_SCHEDULER = on; +ALTER EVENT e1 ENABLE; +ALTER EVENT e11 ENABLE; SET GLOBAL EVENT_SCHEDULER = off; SHOW TABLES LIKE 't%'; @@ -138,8 +134,8 @@ PROCEDURE p1 PROCEDURE p11 SELECT event_name, status FROM information_schema.events WHERE event_schema='test'; event_name status -e1 ENABLED -e11 ENABLED +e1 DISABLED +e11 DISABLED SELECT COUNT(*) FROM t1; COUNT(*) @@ -438,6 +434,8 @@ UPDATE t3 SET c=''; UPDATE t11 SET c=''; UPDATE t12 SET c=''; UPDATE t13 SET c=''; +ALTER TABLE t3 ORDER BY a; +ALTER TABLE t13 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 981c234d380..dd56eb0471c 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -27,6 +27,42 @@ STOP SLAVE; START SLAVE; CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); -SHOW STATUS LIKE 'Slave_running'; -Variable_name Value -Slave_running OFF +show slave status; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running No +Slave_SQL_Running # +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno 0 +Last_IO_Error +Last_SQL_Errno 0 +Last_SQL_Error diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index 7dc9926522b..c3fd663fad8 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -242,3 +242,34 @@ a b 3 1 4 4 drop table t1,t2; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +**** On Master **** +SET SESSION BINLOG_FORMAT=ROW; +CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave')); +INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave'); +**** On Slave **** +UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1; +SELECT * FROM t1 ORDER BY a; +a b +2 master,slave +5 slave +**** On Master **** +UPDATE t1 SET a = 5, b = 'master' WHERE a = 1; +SELECT * FROM t1 ORDER BY a; +a b +2 master,slave +5 master +**** On Slave **** +Last_SQL_Error + +SELECT * FROM t1 ORDER BY a; +a b +2 master,slave +5 slave +DROP TABLE t1; +**** On Master **** +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index a6877b27b95..2efe3a3e486 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -415,4 +415,23 @@ a b c 2 4 8 3 6 9 99 99 99 +**** Test for BUG#31552 **** +**** On Master **** +DELETE FROM t1; +**** Resetting master and slave **** +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +**** On Master **** +INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); +**** On Master **** +DELETE FROM t1 WHERE C1 = 'L'; +DELETE FROM t1; +SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +COUNT(*) 0 +Last_SQL_Error +0 +SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +COUNT(*) 0 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index 4c6ec627db5..fc78abfbe2e 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -415,4 +415,23 @@ a b c 2 4 8 3 6 9 99 99 99 +**** Test for BUG#31552 **** +**** On Master **** +DELETE FROM t1; +**** Resetting master and slave **** +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +**** On Master **** +INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); +**** On Master **** +DELETE FROM t1 WHERE C1 = 'L'; +DELETE FROM t1; +SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +COUNT(*) 0 +Last_SQL_Error +0 +SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +COUNT(*) 0 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index 525909387b3..ed4c4a6b3bb 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -29,8 +29,7 @@ select * from t1; a 1 2 -3 show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 786 # # master-bin.000001 Yes Yes 0 0 786 # None 0 No # No 0 0 +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 851 # # master-bin.000001 Yes Yes 0 0 851 # None 0 No # No 0 0 drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result index 8e492fe4732..f89fa34e319 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -142,3 +142,211 @@ Last_SQL_Errno 0 Last_SQL_Error **** On Master **** DROP TABLE t1, t2; +SET SESSION BINLOG_FORMAT=ROW; +SET AUTOCOMMIT=0; +CREATE TABLE t1 (a INT, b VARCHAR(20)) ENGINE=myisam; +CREATE TABLE t2 (a INT, b VARCHAR(20)) ENGINE=myisam; +CREATE TABLE t3 (a INT, b VARCHAR(20)) ENGINE=myisam; +INSERT INTO t1 VALUES (1,'master/slave'); +INSERT INTO t2 VALUES (1,'master/slave'); +INSERT INTO t3 VALUES (1,'master/slave'); +CREATE TRIGGER tr1 AFTER UPDATE on t1 FOR EACH ROW +BEGIN +INSERT INTO t2 VALUES (NEW.a,NEW.b); +DELETE FROM t2 WHERE a < NEW.a; +END| +CREATE TRIGGER tr2 AFTER INSERT on t2 FOR EACH ROW +BEGIN +UPDATE t3 SET a =2, b = 'master only'; +END| +**** On Slave **** +STOP SLAVE; +**** On Master **** +UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1; +DROP TRIGGER tr1; +DROP TRIGGER tr2; +INSERT INTO t1 VALUES (3,'master/slave'); +INSERT INTO t2 VALUES (3,'master/slave'); +INSERT INTO t3 VALUES (3,'master/slave'); +SELECT * FROM t1 ORDER BY a; +a b +2 master only +3 master/slave +SELECT * FROM t2 ORDER BY a; +a b +2 master only +3 master/slave +SELECT * FROM t3 ORDER BY a; +a b +2 master only +3 master/slave +*** On Slave *** +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +SELECT * FROM t1 ORDER BY a; +a b +1 master/slave +3 master/slave +SELECT * FROM t2 ORDER BY a; +a b +1 master/slave +3 master/slave +SELECT * FROM t3 ORDER BY a; +a b +1 master/slave +3 master/slave +DROP TABLE t1, t2, t3; +**** Case 2: Row binlog format and transactional tables **** +*** On Master *** +CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb; +CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb; +CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb; +**** On Slave **** +STOP SLAVE; +*** On Master *** +BEGIN; +INSERT INTO t4 VALUES (2, 'master only'); +INSERT INTO t5 VALUES (2, 'master only'); +INSERT INTO t6 VALUES (2, 'master only'); +COMMIT; +BEGIN; +INSERT INTO t4 VALUES (3, 'master/slave'); +INSERT INTO t5 VALUES (3, 'master/slave'); +INSERT INTO t6 VALUES (3, 'master/slave'); +COMMIT; +SELECT * FROM t4 ORDER BY a; +a b +2 master only +3 master/slave +SELECT * FROM t5 ORDER BY a; +a b +2 master only +3 master/slave +SELECT * FROM t6 ORDER BY a; +a b +2 master only +3 master/slave +*** On Slave *** +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +SELECT * FROM t4 ORDER BY a; +a b +3 master/slave +SELECT * FROM t5 ORDER BY a; +a b +3 master/slave +SELECT * FROM t6 ORDER BY a; +a b +3 master/slave +**** On Slave **** +STOP SLAVE; +*** On Master *** +BEGIN; +INSERT INTO t4 VALUES (6, 'master only'); +INSERT INTO t5 VALUES (6, 'master only'); +INSERT INTO t6 VALUES (6, 'master only'); +COMMIT; +BEGIN; +INSERT INTO t4 VALUES (7, 'master only'); +INSERT INTO t5 VALUES (7, 'master only'); +INSERT INTO t6 VALUES (7, 'master only'); +COMMIT; +SELECT * FROM t4 ORDER BY a; +a b +2 master only +3 master/slave +6 master only +7 master only +SELECT * FROM t5 ORDER BY a; +a b +2 master only +3 master/slave +6 master only +7 master only +SELECT * FROM t6 ORDER BY a; +a b +2 master only +3 master/slave +6 master only +7 master only +*** On Slave *** +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10; +START SLAVE; +SELECT * FROM t4 ORDER BY a; +a b +3 master/slave +SELECT * FROM t5 ORDER BY a; +a b +3 master/slave +SELECT * FROM t6 ORDER BY a; +a b +3 master/slave +STOP SLAVE; +SET AUTOCOMMIT=0; +INSERT INTO t4 VALUES (4, 'master only'); +INSERT INTO t5 VALUES (4, 'master only'); +INSERT INTO t6 VALUES (4, 'master only'); +COMMIT; +INSERT INTO t4 VALUES (5, 'master/slave'); +INSERT INTO t5 VALUES (5, 'master/slave'); +INSERT INTO t6 VALUES (5, 'master/slave'); +COMMIT; +SELECT * FROM t4 ORDER BY a; +a b +2 master only +3 master/slave +4 master only +5 master/slave +6 master only +7 master only +SELECT * FROM t5 ORDER BY a; +a b +2 master only +3 master/slave +4 master only +5 master/slave +6 master only +7 master only +SELECT * FROM t6 ORDER BY a; +a b +2 master only +3 master/slave +4 master only +5 master/slave +6 master only +7 master only +*** On Slave *** +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +SELECT * FROM t4 ORDER BY a; +a b +3 master/slave +5 master/slave +SELECT * FROM t5 ORDER BY a; +a b +3 master/slave +5 master/slave +SELECT * FROM t6 ORDER BY a; +a b +3 master/slave +5 master/slave +DROP TABLE t4, t5, t6; +**** Case 3: Statement logging format and LOAD DATA with non-transactional table **** +*** On Master *** +CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam; +*** On Slave *** +STOP SLAVE; +*** On Master *** +SET SESSION BINLOG_FORMAT=STATEMENT; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|'; +SELECT * FROM t10 ORDER BY a; +a b +1 master only +2 master only +3 master only +*** On Slave *** +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +SELECT * FROM t10 ORDER BY a; +a b +DROP TABLE t10; diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result index c2c44b06972..a39d189aa3a 100644 --- a/mysql-test/suite/rpl/r/rpl_sp_effects.result +++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result @@ -235,4 +235,45 @@ drop table t1; drop function f1; drop function f2; drop procedure p1; +create table t2 (b BIT(7)); +create procedure sp_bug26199(bitvalue BIT(7)) +begin +insert into t2 set b = bitvalue; +end // +create function sf_bug26199(b BIT(7)) returns int +begin +insert into t2 values(b); +return 0; +end// +call sp_bug26199(b'1110'); +call sp_bug26199('\0'); +select sf_bug26199(b'1111111'); +sf_bug26199(b'1111111') +0 +select sf_bug26199(b'101111111'); +sf_bug26199(b'101111111') +0 +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +select sf_bug26199('\''); +sf_bug26199('\'') +0 +select hex(b) from t2; +hex(b) +E +0 +7F +7F +27 +select hex(b) from t2; +hex(b) +E +0 +7F +7F +27 +drop table t2; +drop procedure sp_bug26199; +drop function sf_bug26199; SET GLOBAL log_bin_trust_function_creators = 0; +end of the tests diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result index c3f0c07b92c..8ed9ff5dc2f 100644 --- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result @@ -405,6 +405,26 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; +CREATE FUNCTION my_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT USER() INTO user; +RETURN user; +END $$ +CREATE FUNCTION my_current_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT CURRENT_USER() INTO user; +RETURN user; +END $$ +DROP TABLE IF EXISTS t13; +CREATE TABLE t13 (data CHAR(64)); +INSERT INTO t13 VALUES (USER()); +INSERT INTO t13 VALUES (my_user()); +INSERT INTO t13 VALUES (CURRENT_USER()); +INSERT INTO t13 VALUES (my_current_user()); show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # drop database if exists mysqltest1 @@ -709,6 +729,30 @@ master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12 master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG) master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION my_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT USER() INTO user; +RETURN user; +END +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION my_current_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT CURRENT_USER() INTO user; +RETURN user; +END +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t13 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t13 (data CHAR(64)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # drop database if exists mysqltest1 @@ -1013,5 +1057,29 @@ master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t12 master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t12 (data LONG) master-bin.000001 # Table_map # # table_id: # (mysqltest1.t12) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION my_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT USER() INTO user; +RETURN user; +END +master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION my_current_user() +RETURNS CHAR(64) +BEGIN +DECLARE user CHAR(64); +SELECT CURRENT_USER() INTO user; +RETURN user; +END +master-bin.000001 # Query # # use `mysqltest1`; DROP TABLE IF EXISTS t13 +master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE t13 (data CHAR(64)) +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (mysqltest1.t13) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F drop database mysqltest1; set global binlog_format =@my_binlog_format; diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result new file mode 100644 index 00000000000..5c681683b08 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -0,0 +1,81 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +**** On Master **** +SET SESSION BINLOG_FORMAT=ROW; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +**** On Slave **** +SHOW STATUS LIKE 'Slave_retried_transactions'; +Variable_name Value +Slave_retried_transactions 0 +UPDATE t1 SET a = 5, b = 47 WHERE a = 1; +SELECT * FROM t1; +a b +5 47 +2 2 +3 3 +4 4 +**** On Master **** +UPDATE t1 SET a = 5, b = 5 WHERE a = 1; +SELECT * FROM t1; +a b +5 5 +2 2 +3 3 +4 4 +**** On Slave **** +SHOW STATUS LIKE 'Slave_retried_transactions'; +Variable_name Value +Slave_retried_transactions 0 +SELECT * FROM t1; +a b +5 47 +2 2 +3 3 +4 4 +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_PORT +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 408 +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table # +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 408 +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error +DROP TABLE t1; +**** On Master **** +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result index c7ef28ba56b..7eee31dab7a 100644 --- a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result @@ -4,6 +4,11 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -31,10 +36,17 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -62,10 +74,17 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -93,11 +112,18 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -125,10 +151,17 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Query # # use `test`; DELETE FROM t1 master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -156,10 +189,17 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Query # # use `test`; DELETE FROM t1 master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -188,9 +228,11 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; diff --git a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result index 7ce48c2e983..a6580a5685b 100644 --- a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result @@ -4,6 +4,11 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -31,12 +36,19 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -64,12 +76,19 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -97,6 +116,7 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -104,6 +124,12 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=STATEMENT; SET GLOBAL BINLOG_FORMAT=STATEMENT; @@ -131,12 +157,19 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DELETE FROM t1 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=MIXED; SET GLOBAL BINLOG_FORMAT=MIXED; @@ -164,12 +197,19 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DELETE FROM t1 master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; +STOP SLAVE; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1; +RESET SLAVE; +START SLAVE; **** On Master **** SET SESSION BINLOG_FORMAT=ROW; SET GLOBAL BINLOG_FORMAT=ROW; @@ -198,6 +238,7 @@ a b DROP TABLE t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -206,3 +247,4 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE t1 +RESET MASTER; diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 426bf93ae97..20c3ccf0486 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -11,7 +11,8 @@ ############################################################################## rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master -rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case -rpl_auto_increment_11932 : Bug#29809 2007-07-16 ingo Slave SQL errors in warnings file -rpl_extraColmaster_innodb : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris -rpl_extraColmaster_myisam : BUG#30854 +rpl_stm_extraColmaster_ndb : WL#3915 : Statement-based replication not supported in ndb. Enable test when supported. +rpl_innodb_bug28430 : Bug #32247 2007-11-27 mats Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table) +rpl_view : Bug#32654: rpl_view.test fails randomly +rpl_ndb_multi : Bug#30751: rpl_ndb_multi missing row in output +rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test index 42af33c2e05..e95f69a3f99 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test @@ -1,3 +1,4 @@ +source include/master-slave.inc; -- source include/have_innodb.inc -- source include/not_embedded.inc -- source include/have_binlog_format_mixed_or_statement.inc diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test index cc8b26ac8f4..1c7b0ca0fd1 100644 --- a/mysql-test/suite/rpl/t/rpl_bug31076.test +++ b/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -114,4 +114,5 @@ SELECT * FROM visits_events; # Cleanup DROP DATABASE track; +sync_slave_with_master; --echo End of 5.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test index 27c920a3186..83c15d691be 100644 --- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test +++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test @@ -106,9 +106,3 @@ connection slave; sync_with_master; # End of 4.1 tests - -# Cleanup -# The A->B->A replication causes the master to start writing relay logs -# in var/run, remove them -remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001; -remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index; diff --git a/mysql-test/suite/rpl/t/rpl_found_rows.test b/mysql-test/suite/rpl/t/rpl_found_rows.test new file mode 100644 index 00000000000..f868061c951 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_found_rows.test @@ -0,0 +1,256 @@ +source include/master-slave.inc; + +# It is not possible to replicate FOUND_ROWS() using statement-based +# replication, but there is a workaround that stores the result of +# FOUND_ROWS() into a user variable and then replicates this instead. + +# The purpose of this test case is to test that the workaround +# function properly even when inside stored programs (i.e., stored +# routines and triggers). + +--echo ==== 0. Setting it all up ==== + +SET BINLOG_FORMAT=STATEMENT; + +--echo **** On Master **** +connection master; +CREATE TABLE t1 (a INT); +CREATE TABLE logtbl (sect INT, test INT, count INT); + +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; + +--echo #### 1. Using statement mode #### + +--echo ==== 1.1. Simple test ==== + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; + +# Instead of +# INSERT INTO logtbl VALUES(1, 1, FOUND_ROWS()); +# we write +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,1,@a); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +# Instead of +# INSERT INTO logtbl VALUES(1, 2, FOUND_ROWS()); +# we write +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,2,@a); + +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +--echo **** On Slave **** +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; + +--echo ==== 1.2. Stored procedure ==== + +# Here we do both the calculation and the logging. We also do it twice +# to make sure that there are no limitations on how many times it can +# be used. + +--echo **** On Master **** +connection master; +--delimiter $$ +CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN + DECLARE cnt INT; + SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; + SELECT FOUND_ROWS() INTO cnt; + INSERT INTO logtbl VALUES(sect,test,cnt); + SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; + SELECT FOUND_ROWS() INTO cnt; + INSERT INTO logtbl VALUES(sect,test+1,cnt); +END $$ +--delimiter ; + +CALL calc_and_log(2,1); + +--delimiter $$ +CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN + INSERT INTO logtbl VALUES (sect,test,found_rows); +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO @found_rows; +CALL just_log(2,3,@found_rows); + +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +--echo **** On Slave **** +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; + +--echo ==== 1.3. Stored functions ==== +--echo **** On Master **** +connection master; +--delimiter $$ +CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT) + RETURNS INT +BEGIN + INSERT INTO logtbl VALUES(sect,test,found_rows); + RETURN found_rows; +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO @found_rows; +SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows); + +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; +--echo **** On Slave **** +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; + +--echo ==== 1.9. Cleanup ==== +--echo **** On Master **** +connection master; +DELETE FROM logtbl; +DROP PROCEDURE just_log; +DROP PROCEDURE calc_and_log; +DROP FUNCTION log_rows; +sync_slave_with_master; + +source include/reset_master_and_slave.inc; + +--echo #### 2. Using mixed mode #### + +--echo ==== 2.1. Checking a procedure ==== + +--echo **** On Master **** +connection master; +SET BINLOG_FORMAT=MIXED; + +# We will now check some stuff that will not work in statement-based +# replication, but which should cause the binary log to switch to +# row-based logging. + +--delimiter $$ +CREATE PROCEDURE just_log(sect INT, test INT) BEGIN + INSERT INTO logtbl VALUES (sect,test,FOUND_ROWS()); +END $$ +--delimiter ; +sync_slave_with_master; + +--echo **** On Master 1 **** +connection master1; +SET BINLOG_FORMAT=MIXED; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +CALL just_log(1,1); + +--echo **** On Master **** +connection master; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +CALL just_log(1,2); + +--echo **** On Master 1 **** + +connection master1; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +CALL just_log(1,3); +sync_slave_with_master; + +--echo **** On Master **** +connection master; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +CALL just_log(1,4); +sync_slave_with_master; + +connection master; +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +--echo **** On Slave **** +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; + +--echo ==== 2.1. Checking a stored function ==== +--echo **** On Master **** +connection master; +--delimiter $$ +CREATE FUNCTION log_rows(sect INT, test INT) + RETURNS INT +BEGIN + DECLARE found_rows INT; + SELECT FOUND_ROWS() INTO found_rows; + INSERT INTO logtbl VALUES(sect,test,found_rows); + RETURN found_rows; +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +SELECT log_rows(2,1), log_rows(2,2); + +CREATE TABLE t2 (a INT, b INT); + +# Trying with referencing FOUND_ROWS() directly in the trigger. + +--delimiter $$ +CREATE TRIGGER t2_tr BEFORE INSERT ON t2 FOR EACH ROW +BEGIN + INSERT INTO logtbl VALUES (NEW.a, NEW.b, FOUND_ROWS()); +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +INSERT INTO t2 VALUES (2,3), (2,4); + +# Referencing FOUND_ROWS() indirectly. + +DROP TRIGGER t2_tr; + +--delimiter $$ +CREATE TRIGGER t2_tr BEFORE INSERT ON t2 FOR EACH ROW +BEGIN + DECLARE dummy INT; + SELECT log_rows(NEW.a, NEW.b) INTO dummy; +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +INSERT INTO t2 VALUES (2,5), (2,6); + +# Putting FOUND_ROWS() even lower in the call chain. + +connection master; +DROP TRIGGER t2_tr; + +--delimiter $$ +CREATE PROCEDURE log_me_inner(sect INT, test INT) +BEGIN + DECLARE dummy INT; + SELECT log_rows(sect, test) INTO dummy; + SELECT log_rows(sect, test+1) INTO dummy; +END $$ + +CREATE PROCEDURE log_me(sect INT, test INT) +BEGIN + CALL log_me_inner(sect,test); +END $$ +--delimiter ; + +--delimiter $$ +CREATE TRIGGER t2_tr BEFORE INSERT ON t2 FOR EACH ROW +BEGIN + CALL log_me(NEW.a, NEW.b); +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +INSERT INTO t2 VALUES (2,5), (2,6); + +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; + +connection master; +DROP TABLE t1, logtbl; +DROP PROCEDURE just_log; +DROP PROCEDURE log_me; +DROP PROCEDURE log_me_inner; +DROP FUNCTION log_rows; +sync_slave_with_master; + diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test new file mode 100644 index 00000000000..44956b7b459 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -0,0 +1,79 @@ +# Testing various forms of idempotency for replication that should +# work the same way under statement based as under row based. + +source include/master-slave.inc; + +connection master; +CREATE TABLE t1 (a INT PRIMARY KEY); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (-1),(-2),(-3); +INSERT INTO t2 VALUES (-1),(-2),(-3); +sync_slave_with_master; + +# A delete for a row that does not exist, the statement is +# deliberately written to be idempotent for statement-based +# replication as well. We test this towards both a table with a +# primary key and without a primary key. + +connection slave; +DELETE FROM t1 WHERE a = -2; +DELETE FROM t2 WHERE a = -2; +connection master; +DELETE FROM t1 WHERE a = -2; +DELETE FROM t2 WHERE a = -2; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +# An insert of a row that already exists. Since we are replacing the +# row if it already exists, the most apropriate representation is +# INSERT IGNORE. We only test this towards a table with a primary key, +# since the other case does not make sense. + +INSERT IGNORE INTO t1 VALUES (-2); +connection master; +INSERT IGNORE INTO t1 VALUES (-2); +SELECT * FROM t1 ORDER BY a; +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +# BUG#19958: RBR idempotency issue for UPDATE and DELETE + +# Statement-based and row-based replication have different behaviour +# when updating a row with an explicit WHERE-clause that matches +# exactly one row (or no row at all). For statement-based replication, +# the statement is idempotent since the first time it is executed, it +# will update exactly one row, and the second time it will not update +# any row at all. This was not the case for row-based replication, so +# we test under both row-based and statement-based replication both +# for tables with and without primary keys. + +connection slave; +UPDATE t1 SET a = 1 WHERE a = -1; +UPDATE t2 SET a = 1 WHERE a = -1; +connection master; +UPDATE t1 SET a = 1 WHERE a = -1; +UPDATE t2 SET a = 1 WHERE a = -1; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +connection master; +DROP TABLE t1, t2; +sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test index 74954299920..eb828f07415 100644 --- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test @@ -136,8 +136,7 @@ SELECT count(*) as "Master byrange" FROM test.byrange_tbl; --sync_slave_with_master connection slave; show create table test.byrange_tbl; ---replace_column 4 MASTER_PORT 33 # -show slave status; +source include/show_slave_status.inc; SELECT count(*) "Slave norm" FROM test.regular_tbl; SELECT count(*) "Slave bykey" FROM test.bykey_tbl; SELECT count(*) "Slave byrange" FROM test.byrange_tbl; diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test index e797e0552ef..2e69c0fabd9 100644 --- a/mysql-test/suite/rpl/t/rpl_invoked_features.test +++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test @@ -8,10 +8,9 @@ --source include/master-slave.inc --source include/have_innodb.inc - -# -# Define variables used by test case -# +# --disable_warnings/--enable_warnings added before/after query +# if one uses UUID() function because we need to avoid warnings +# for STATEMENT binlog format # Non-transactional engine --let $engine_type= myisam @@ -45,20 +44,24 @@ DROP EVENT IF EXISTS e11; --echo eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type; ---disable_warnings INSERT INTO t1 VALUES (1,1,'1'); +--disable_warnings INSERT INTO t1 VALUES (2,2,UUID()); -eval CREATE TABLE t2 (a INT, b INT, c VARCHAR(64)) ENGINE=$engine_type; +--enable_warnings +eval CREATE TABLE t2 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=$engine_type; INSERT INTO t2 VALUES (1,1,'1'); +--disable_warnings INSERT INTO t2 VALUES (2,2,UUID()); --enable_warnings eval CREATE TABLE t11 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type2; ---disable_warnings INSERT INTO t11 VALUES (1,1,'1'); +--disable_warnings INSERT INTO t11 VALUES (2,2,UUID()); -eval CREATE TABLE t12 (a INT, b INT, c VARCHAR(64)) ENGINE=$engine_type2; +--enable_warnings +eval CREATE TABLE t12 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=$engine_type2; INSERT INTO t12 VALUES (1,1,'1'); +--disable_warnings INSERT INTO t12 VALUES (2,2,UUID()); --enable_warnings @@ -96,22 +99,16 @@ BEGIN END| # Create events which will run every 1 sec -CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND ENABLE DO +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO BEGIN - DECLARE c INT; - SELECT a INTO c FROM t1 WHERE a < 11 ORDER BY a DESC LIMIT 1; - IF c = 7 THEN - CALL p1(10, ''); - END IF; + ALTER EVENT e1 DISABLE; + CALL p1(10, ''); END| -CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND ENABLE DO +CREATE EVENT e11 ON SCHEDULE EVERY 1 SECOND DISABLE DO BEGIN - DECLARE c INT; - SELECT a INTO c FROM t11 WHERE a < 11 ORDER BY a DESC LIMIT 1; - IF c = 7 THEN - CALL p11(10, ''); - END IF; + ALTER EVENT e11 DISABLE; + CALL p11(10, ''); END| # Create functions and procedures used for events @@ -130,12 +127,12 @@ END| CREATE PROCEDURE p1 (IN x INT, IN y VARCHAR(64)) BEGIN - INSERT INTO t1 VALUES (x,x,y); + INSERT IGNORE INTO t1 VALUES (x,x,y); END| CREATE PROCEDURE p11 (IN x INT, IN y VARCHAR(64)) BEGIN - INSERT INTO t11 VALUES (x,x,y); + INSERT IGNORE INTO t11 VALUES (x,x,y); END| DELIMITER ;| @@ -147,17 +144,24 @@ DELIMITER ;| # Do some actions for non-transactional tables --echo ---disable_warnings CREATE TABLE t3 SELECT * FROM v1; INSERT INTO t1 VALUES (3,3,''); UPDATE t1 SET c='2' WHERE a = 1; +--disable_warnings INSERT INTO t1 VALUES(4,4,f1(4)); +--enable_warnings INSERT INTO t1 VALUES (100,100,''); +--disable_warnings CALL p1(5, UUID()); +--enable_warnings INSERT INTO t1 VALUES (101,101,''); +--disable_warnings INSERT INTO t1 VALUES(6,6,f1(6)); +--enable_warnings INSERT INTO t1 VALUES (102,102,''); +--disable_warnings INSERT INTO t1 VALUES(7,7,f2(7)); +--enable_warnings INSERT INTO t1 VALUES (103,103,''); # Do some actions for transactional tables @@ -165,21 +169,34 @@ INSERT INTO t1 VALUES (103,103,''); CREATE TABLE t13 SELECT * FROM v11; INSERT INTO t11 VALUES (3,3,''); UPDATE t11 SET c='2' WHERE a = 1; +--disable_warnings INSERT INTO t11 VALUES(4,4,f1(4)); +--enable_warnings INSERT INTO t11 VALUES (100,100,''); +--disable_warnings CALL p11(5, UUID()); +--enable_warnings INSERT INTO t11 VALUES (101,101,''); +--disable_warnings INSERT INTO t11 VALUES(6,6,f1(6)); +--enable_warnings INSERT INTO t11 VALUES (102,102,''); +--disable_warnings INSERT INTO t11 VALUES(7,7,f2(7)); -INSERT INTO t11 VALUES (103,103,''); --enable_warnings +INSERT INTO t11 VALUES (103,103,''); # Scheduler is on --echo +# Temporally events fire sequentally due Bug#29020. SET GLOBAL EVENT_SCHEDULER = on; -# Wait 2 sec while events will executed ---sleep 2 +# Wait while events will executed +ALTER EVENT e1 ENABLE; +let $wait_condition= SELECT COUNT(*) = 1 FROM t1 WHERE t1.a = 10; +--source include/wait_condition.inc +ALTER EVENT e11 ENABLE; +let $wait_condition= SELECT COUNT(*) = 1 FROM t11 WHERE t11.a = 10; +--source include/wait_condition.inc SET GLOBAL EVENT_SCHEDULER = off; # Check original objects @@ -234,7 +251,7 @@ SELECT COUNT(*) FROM t13; SELECT a,b FROM t13 ORDER BY a; SELECT a,b FROM v11 ORDER BY a; -# Remove UUID() before comparing +# Remove UUID() before comparing and sort tables --connection master --echo @@ -245,6 +262,9 @@ UPDATE t11 SET c=''; UPDATE t12 SET c=''; UPDATE t13 SET c=''; +ALTER TABLE t3 ORDER BY a; +ALTER TABLE t13 ORDER BY a; + --sync_slave_with_master slave # Compare a data from master and slave @@ -260,13 +280,12 @@ UPDATE t13 SET c=''; # Remove dumps --echo ---exec rm $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql ---exec rm $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql +--remove_file $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql +--remove_file $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql # Remove tables,views,procedures,functions --connection master --echo ---disable_warnings DROP VIEW IF EXISTS v1,v11; DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13; DROP PROCEDURE IF EXISTS p1; @@ -275,7 +294,6 @@ DROP FUNCTION IF EXISTS f1; DROP FUNCTION IF EXISTS f2; DROP EVENT IF EXISTS e1; DROP EVENT IF EXISTS e11; ---enable_warnings --sync_slave_with_master slave diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 316278cb75d..0e17ae3144c 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -66,16 +66,11 @@ CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); # The slave I/O thread must stop after trying to read the above event -connection slave; -sleep 2; ---source include/wait_for_slave_io_to_stop.inc -SHOW STATUS LIKE 'Slave_running'; - -# cleanup -#connection master; -#drop table t1; -#connection slave; -#drop table t1; - +connection slave; +--source include/wait_for_slave_io_to_stop.inc +--replace_result $MASTER_MYPORT MASTER_MYPORT +# import is only the 11th column Slave_IO_Running +--replace_column 1 # 7 # 8 # 9 # 12 # 22 # 23 # 33 # +query_vertical show slave status; # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index fb43664f121..07fe763eb3c 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -223,3 +223,38 @@ connection master; drop table t1,t2; sync_slave_with_master; + +# +# BUG#31702: Missing row on slave causes assertion failure under +# row-based replication +# + +disable_query_log; +source include/master-slave-reset.inc; +enable_query_log; + +--echo **** On Master **** +connection master; +SET SESSION BINLOG_FORMAT=ROW; +CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave')); +INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave'); +--echo **** On Slave **** +sync_slave_with_master; +UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1; +SELECT * FROM t1 ORDER BY a; +--echo **** On Master **** +connection master; +UPDATE t1 SET a = 5, b = 'master' WHERE a = 1; +SELECT * FROM t1 ORDER BY a; +--echo **** On Slave **** +sync_slave_with_master; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; +SELECT * FROM t1 ORDER BY a; +DROP TABLE t1; + +--echo **** On Master **** +connection master; +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test b/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test index 1465500d0eb..2d48af65581 100644 --- a/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test +++ b/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test @@ -4,6 +4,7 @@ ######################################################## -- source include/not_ndb_default.inc -- source include/have_binlog_format_row.inc +-- source include/have_innodb.inc -- source include/master-slave.inc let $engine_type=innodb; -- source extra/rpl_tests/rpl_row_charset.test diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test index dd46d64f684..be76ac9f3f6 100644 --- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test +++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test @@ -344,5 +344,6 @@ FLUSH LOGS; --exec rm $MYSQLTEST_VARDIR/tmp/local.sql DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index 9464e5cfadd..610eec305df 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -13,6 +13,8 @@ save_master_pos; connection slave; sync_with_master; stop slave; +# Make sure the slave sql and io thread has stopped +--source include/wait_for_slave_to_stop.inc connection master; # create some events on master @@ -52,6 +54,8 @@ save_master_pos; connection slave; sync_with_master; stop slave; +# Make sure the slave sql and io thread has stopped +--source include/wait_for_slave_to_stop.inc # this should stop immediately as we are already there start slave until master_log_file='master-bin.000001', master_log_pos=740; diff --git a/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt index c84171976a1..a8f5deaa30b 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt @@ -1 +1 @@ ---slave-skip-error=1062,1582 +--slave-skip-error=1062 diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test index b68b637b3b0..72d434d9c9b 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_error.test +++ b/mysql-test/suite/rpl/t/rpl_skip_error.test @@ -3,6 +3,14 @@ ######################################### # Note that errors are ignored by opt file. source include/master-slave.inc; +source include/have_binlog_format_mixed_or_statement.inc; + +# +# Bug #30594 +# Skipping error due to applying Row-based repliation events +# should be checked with another test file +# consider names like rpl_row_skip_error +# create table t1 (n int not null primary key); save_master_pos; diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt b/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test index b19d6a2730b..6783098fd7c 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -1,7 +1,9 @@ source include/master-slave.inc; +source include/have_innodb.inc; --echo **** On Slave **** connection slave; +source include/have_innodb.inc; STOP SLAVE; --echo **** On Master **** @@ -69,3 +71,240 @@ query_vertical SHOW SLAVE STATUS; connection master; DROP TABLE t1, t2; sync_slave_with_master; + +# +# More tests for BUG#28618 +# +# Case 1. +# ROW binlog format and non-transactional tables. +# Create the group of events via triggers and try to skip +# some items of that group. +# + +connection master; +SET SESSION BINLOG_FORMAT=ROW; +SET AUTOCOMMIT=0; + +CREATE TABLE t1 (a INT, b VARCHAR(20)) ENGINE=myisam; +CREATE TABLE t2 (a INT, b VARCHAR(20)) ENGINE=myisam; +CREATE TABLE t3 (a INT, b VARCHAR(20)) ENGINE=myisam; + +INSERT INTO t1 VALUES (1,'master/slave'); +INSERT INTO t2 VALUES (1,'master/slave'); +INSERT INTO t3 VALUES (1,'master/slave'); + +DELIMITER |; + +CREATE TRIGGER tr1 AFTER UPDATE on t1 FOR EACH ROW +BEGIN + INSERT INTO t2 VALUES (NEW.a,NEW.b); + DELETE FROM t2 WHERE a < NEW.a; +END| + +CREATE TRIGGER tr2 AFTER INSERT on t2 FOR EACH ROW +BEGIN + UPDATE t3 SET a =2, b = 'master only'; +END| + +DELIMITER ;| + +--echo **** On Slave **** +sync_slave_with_master; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; + +--echo **** On Master **** +connection master; +UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1; +DROP TRIGGER tr1; +DROP TRIGGER tr2; +INSERT INTO t1 VALUES (3,'master/slave'); +INSERT INTO t2 VALUES (3,'master/slave'); +INSERT INTO t3 VALUES (3,'master/slave'); + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +SELECT * FROM t3 ORDER BY a; + +save_master_pos; + +--echo *** On Slave *** +connection slave; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +source include/wait_for_slave_to_start.inc; +sync_with_master; + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +SELECT * FROM t3 ORDER BY a; + +connection master; +DROP TABLE t1, t2, t3; +sync_slave_with_master; + +--echo **** Case 2: Row binlog format and transactional tables **** + +# Create the transaction and try to skip some +# queries from one. + +--echo *** On Master *** +connection master; +CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb; +CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb; +CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb; + +--echo **** On Slave **** +sync_slave_with_master; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; + +--echo *** On Master *** +connection master; +BEGIN; +INSERT INTO t4 VALUES (2, 'master only'); +INSERT INTO t5 VALUES (2, 'master only'); +INSERT INTO t6 VALUES (2, 'master only'); +COMMIT; + +BEGIN; +INSERT INTO t4 VALUES (3, 'master/slave'); +INSERT INTO t5 VALUES (3, 'master/slave'); +INSERT INTO t6 VALUES (3, 'master/slave'); +COMMIT; + +SELECT * FROM t4 ORDER BY a; +SELECT * FROM t5 ORDER BY a; +SELECT * FROM t6 ORDER BY a; + +save_master_pos; + +--echo *** On Slave *** +connection slave; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +source include/wait_for_slave_to_start.inc; +sync_with_master; + +SELECT * FROM t4 ORDER BY a; +SELECT * FROM t5 ORDER BY a; +SELECT * FROM t6 ORDER BY a; + +# Test skipping two groups + +--echo **** On Slave **** +connection slave; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; + +--echo *** On Master *** +connection master; +BEGIN; +INSERT INTO t4 VALUES (6, 'master only'); +INSERT INTO t5 VALUES (6, 'master only'); +INSERT INTO t6 VALUES (6, 'master only'); +COMMIT; + +BEGIN; +INSERT INTO t4 VALUES (7, 'master only'); +INSERT INTO t5 VALUES (7, 'master only'); +INSERT INTO t6 VALUES (7, 'master only'); +COMMIT; + +SELECT * FROM t4 ORDER BY a; +SELECT * FROM t5 ORDER BY a; +SELECT * FROM t6 ORDER BY a; + +save_master_pos; + +--echo *** On Slave *** +connection slave; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10; +START SLAVE; +source include/wait_for_slave_to_start.inc; +sync_with_master; + +SELECT * FROM t4 ORDER BY a; +SELECT * FROM t5 ORDER BY a; +SELECT * FROM t6 ORDER BY a; + +# +# And the same, but with autocommit = 0 +# +connection slave; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; + +connection master; +SET AUTOCOMMIT=0; + +INSERT INTO t4 VALUES (4, 'master only'); +INSERT INTO t5 VALUES (4, 'master only'); +INSERT INTO t6 VALUES (4, 'master only'); +COMMIT; + +INSERT INTO t4 VALUES (5, 'master/slave'); +INSERT INTO t5 VALUES (5, 'master/slave'); +INSERT INTO t6 VALUES (5, 'master/slave'); +COMMIT; + +SELECT * FROM t4 ORDER BY a; +SELECT * FROM t5 ORDER BY a; +SELECT * FROM t6 ORDER BY a; + +save_master_pos; + +--echo *** On Slave *** +connection slave; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +source include/wait_for_slave_to_start.inc; +sync_with_master; + +SELECT * FROM t4 ORDER BY a; +SELECT * FROM t5 ORDER BY a; +SELECT * FROM t6 ORDER BY a; + +connection master; +DROP TABLE t4, t5, t6; +sync_slave_with_master; + +--echo **** Case 3: Statement logging format and LOAD DATA with non-transactional table **** + +# LOAD DATA creates two events in binary log for statement binlog format. +# Try to skip the first. + +--echo *** On Master *** +connection master; +CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam; + +--echo *** On Slave *** +sync_slave_with_master; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; + +--echo *** On Master *** +connection master; +SET SESSION BINLOG_FORMAT=STATEMENT; +exec cp ./suite/rpl/data/rpl_bug28618.dat $MYSQLTEST_VARDIR/tmp/; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|'; +remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug28618.dat; + +SELECT * FROM t10 ORDER BY a; + +save_master_pos; + +--echo *** On Slave *** +connection slave; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +source include/wait_for_slave_to_start.inc; +sync_with_master; + +SELECT * FROM t10 ORDER BY a; + +connection master; +DROP TABLE t10; +sync_slave_with_master; + diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test index 027bfd69f36..c1092e3260f 100644 --- a/mysql-test/suite/rpl/t/rpl_sp_effects.test +++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test @@ -201,6 +201,10 @@ sync_slave_with_master; connection slave; SELECT 'slave', a FROM t1 ORDER BY a; +# +# cleanup +# + connection master; drop table t1; drop function f1; @@ -208,4 +212,50 @@ drop function f2; drop procedure p1; sync_slave_with_master; +# +# bug#26199 Replication Failure on Slave when using stored procs +# with bit-type parameters + +connection master; + +create table t2 (b BIT(7)); +delimiter //; +create procedure sp_bug26199(bitvalue BIT(7)) +begin + insert into t2 set b = bitvalue; +end // + +create function sf_bug26199(b BIT(7)) returns int +begin + insert into t2 values(b); + return 0; +end// + +DELIMITER ;// + + + +call sp_bug26199(b'1110'); +call sp_bug26199('\0'); +select sf_bug26199(b'1111111'); +select sf_bug26199(b'101111111'); +select sf_bug26199('\''); +select hex(b) from t2; + +sync_slave_with_master; +#connection slave; +select hex(b) from t2; + +# +# cleanup bug#26199 +# +connection master; +drop table t2; +drop procedure sp_bug26199; +drop function sf_bug26199; + +sync_slave_with_master; + SET GLOBAL log_bin_trust_function_creators = 0; + +--echo end of the tests diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index c1b7bc2097b..7e256390e25 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -42,6 +42,10 @@ select * from t1; # Do the same thing a number of times disable_query_log; disable_result_log; +# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows +# After discussions with Engineering, I'm disabling this part of the test to avoid it causing +# red trees. +disable_parsing; let $i= 100; while ($i) { @@ -54,7 +58,8 @@ while ($i) stop slave; dec $i; } -start slave; +enable_parsing; +START SLAVE; enable_query_log; enable_result_log; connection master; @@ -76,6 +81,16 @@ if (`select $slave_count != $master_count`) echo master and slave differed in number of rows; echo master: $master_count; echo slave: $slave_count; + + connection master; + echo === master ===; + select count(*) t1; + select * from t1; + connection slave; + echo === slave ===; + select count(*) t1; + select * from t1; + query_vertical show slave status; } connection master; diff --git a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test index 017593fdfba..b43a734fffc 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_mystery22.test +++ b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test @@ -28,7 +28,7 @@ insert into t1 values(NULL,'new'); save_master_pos; connection slave; # wait until the slave tries to run the query, fails and aborts slave thread -wait_for_slave_to_stop; +source include/wait_for_slave_sql_error.inc; select * from t1 order by n; delete from t1 where n = 2; --disable_warnings diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index 98e7e0e5eac..c8d3cb1823d 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -12,6 +12,8 @@ save_master_pos; connection slave; sync_with_master; stop slave; +# Make sure the slave sql and io thread has stopped +--source include/wait_for_slave_to_stop.inc connection master; # create some events on master @@ -51,6 +53,8 @@ save_master_pos; connection slave; sync_with_master; stop slave; +# Make sure the slave sql and io thread has stopped +--source include/wait_for_slave_to_stop.inc # this should stop immediately as we are already there start slave until master_log_file='master-bin.000001', master_log_pos=776; diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index b0012827db8..05dcb91ca28 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -518,6 +518,42 @@ CREATE TABLE t12 (data LONG); LOCK TABLES t12 WRITE; INSERT INTO t12 VALUES(UUID()); UNLOCK TABLES; +sync_slave_with_master; + +# +# BUG#28086: SBR of USER() becomes corrupted on slave +# + +connection master; + +# Just to get something that is non-trivial, albeit still simple, we +# stuff the result of USER() and CURRENT_USER() into a variable. +--delimiter $$ +CREATE FUNCTION my_user() + RETURNS CHAR(64) +BEGIN + DECLARE user CHAR(64); + SELECT USER() INTO user; + RETURN user; +END $$ +--delimiter ; + +--delimiter $$ +CREATE FUNCTION my_current_user() + RETURNS CHAR(64) +BEGIN + DECLARE user CHAR(64); + SELECT CURRENT_USER() INTO user; + RETURN user; +END $$ +--delimiter ; + +DROP TABLE IF EXISTS t13; +CREATE TABLE t13 (data CHAR(64)); +INSERT INTO t13 VALUES (USER()); +INSERT INTO t13 VALUES (my_user()); +INSERT INTO t13 VALUES (CURRENT_USER()); +INSERT INTO t13 VALUES (my_current_user()); source include/show_binlog_events.inc; sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test index 09b8b83f25f..852dfdbc25c 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary.test +++ b/mysql-test/suite/rpl/t/rpl_temporary.test @@ -208,8 +208,9 @@ select * from t1; connection master; drop table t1; +--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql # Delete the anonymous users source include/delete_anonymous_users.inc; -# End of 5.1 tests +# End of tests diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt b/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt new file mode 100644 index 00000000000..80c171170f6 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt @@ -0,0 +1,3 @@ +--loose-debug="+d,all_errors_are_temporary_errors" --slave-transaction-retries=2 + + diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test new file mode 100644 index 00000000000..6a57f3cc167 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test @@ -0,0 +1,27 @@ +source include/master-slave.inc; + +--echo **** On Master **** +connection master; +SET SESSION BINLOG_FORMAT=ROW; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +--echo **** On Slave **** +sync_slave_with_master; +SHOW STATUS LIKE 'Slave_retried_transactions'; +UPDATE t1 SET a = 5, b = 47 WHERE a = 1; +SELECT * FROM t1; +--echo **** On Master **** +connection master; +UPDATE t1 SET a = 5, b = 5 WHERE a = 1; +SELECT * FROM t1; +#SHOW BINLOG EVENTS; +--echo **** On Slave **** +sync_slave_with_master; +SHOW STATUS LIKE 'Slave_retried_transactions'; +SELECT * FROM t1; +source include/show_slave_status.inc; +DROP TABLE t1; + +--echo **** On Master **** +connection master; +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index 9f5f6fc9b4c..4a496ea4923 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -316,8 +316,13 @@ SELECT * FROM t2; # 2. Check that the trigger is non-SUID on the slave; # 3. Check that the trigger can be activated on the slave. +# +# We disable warnings here since it affects the result file in +# different ways depending on the mode being used. +disable_warnings; INSERT INTO t1 VALUES(2); +enable_warnings; SELECT * FROM t1; SELECT * FROM t2; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result index 54056ac613b..685fdbf0a6e 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result @@ -615,6 +615,66 @@ c1 c2 c3 c4 c5 c6 c7 1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP 2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP 3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP +*** Create t14a on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +*** Create t14a on Master *** +CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; +RESET MASTER; +*** Start Slave *** +START SLAVE; +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14a () VALUES(1,@b1,'Kyle'), +(2,@b1,'JOE'), +(3,@b1,'QA'); +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 +1 b1b1b1b1b1b1b1b1 Kyle +2 b1b1b1b1b1b1b1b1 JOE +3 b1b1b1b1b1b1b1b1 QA +*** Select on Slave **** +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 c6 c7 +1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP +2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP +3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP +STOP SLAVE; +RESET SLAVE; +*** Master Drop c5 *** +ALTER TABLE t14a DROP COLUMN c5; +RESET MASTER; +*** Start Slave *** +START SLAVE; +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14a () VALUES(4,@b1), +(5,@b1), +(6,@b1); +SELECT * FROM t14a ORDER BY c1; +c1 c4 +1 b1b1b1b1b1b1b1b1 +2 b1b1b1b1b1b1b1b1 +3 b1b1b1b1b1b1b1b1 +4 b1b1b1b1b1b1b1b1 +5 b1b1b1b1b1b1b1b1 +6 b1b1b1b1b1b1b1b1 +*** Select on Slave **** +SELECT * FROM t14a ORDER BY c1; +c1 c4 c5 c6 c7 +1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP +2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP +3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP +4 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP +5 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP +6 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP *** connect to master and drop columns *** ALTER TABLE t14 DROP COLUMN c2; ALTER TABLE t14 DROP COLUMN c4; @@ -707,7 +767,7 @@ Last_IO_Errno # Last_IO_Error # Last_SQL_Errno 1060 Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; *** Try to insert in master **** INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2); diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result index 5519e0dcd0c..abd5bad8e49 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result @@ -415,4 +415,23 @@ a b c 2 4 8 3 6 9 99 99 99 +**** Test for BUG#31552 **** +**** On Master **** +DELETE FROM t1; +**** Resetting master and slave **** +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +**** On Master **** +INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); +**** On Master **** +DELETE FROM t1 WHERE C1 = 'L'; +DELETE FROM t1; +SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +COUNT(*) 0 +Last_SQL_Error +0 +SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +COUNT(*) 0 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 05e8297bf0e..60bfa559953 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -11,16 +11,13 @@ ############################################################################## -rpl_ndb_2innodb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue -rpl_ndb_2myisam : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue -rpl_ndb_2other : BUG#21842 2007-08-30 tsmith test has never worked on bigendian (sol10-sparc-a, powermacg5 -rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD -rpl_ndb_innodb2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue -rpl_ndb_myisam2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue +rpl_ndb_2innodb : Bug #32648 Test failure between NDB Cluster and other engines +rpl_ndb_2myisam : Bug #32648 Test failure between NDB Cluster and other engines +rpl_ndb_2other : Bug #32648 Test failure between NDB Cluster and other engines rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB -rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris +rpl_ndb_mix_innodb : Bug #32720 Test rpl_ndb_mix_innodb fails on SPARC and PowerPC # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test index 7c9830bb468..0903db1eca4 100644 --- a/mysql-test/t/analyze.test +++ b/mysql-test/t/analyze.test @@ -72,4 +72,16 @@ analyze table t1; show index from t1; drop table t1; -# End of 4.1 tests +--echo End of 4.1 tests + +# +# Bug #30495: optimize table t1,t2,t3 extended errors +# +create table t1(a int); +--error 1064 +analyze table t1 extended; +--error 1064 +optimize table t1 extended; +drop table t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index f8eff10e30a..b42c8446a32 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1320,7 +1320,7 @@ SELECT * FROM t2; INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W'); INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring',''); INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); -OPTIMIZE TABLE t2 EXTENDED; +OPTIMIZE TABLE t2; SELECT * FROM t2; REPAIR TABLE t2; SELECT * FROM t2; @@ -1589,3 +1589,12 @@ SELECT * FROM t1 ORDER BY a; --enable_result_log DROP TABLE t1; + +# +# BUG#31833 - ORDER BY leads to wrong result when ARCHIVE, BLOB and table +# cache is full +# +CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive; +INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL); +FLUSH TABLE t1; +SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index da10f4efa61..5a589816dcd 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -113,6 +113,15 @@ t2.value64=t1.value64; drop table t1, t2; +# Test for BUG#30069, can't handle bigint -9223372036854775808 on +# x86_64, with some GCC versions and optimizations. + +create table t1 (sint64 bigint not null); +insert into t1 values (-9223372036854775808); +select * from t1; + +drop table t1; + # End of 4.1 tests # diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 63baeebcf12..028c64d6de7 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -1,9 +1,9 @@ -# + # Testing of CASE # --disable_warnings -drop table if exists t1,t2; +drop table if exists t1, t2; --enable_warnings select CASE "b" when "a" then 1 when "b" then 2 END; @@ -152,4 +152,21 @@ SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM, FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM; DROP TABLE t1,t2; -# End of 4.1 tests + +--echo End of 4.1 tests + +# +# #30782: Truncated UNSIGNED BIGINT columns +# +create table t1 (a int, b bigint unsigned); +create table t2 (c int); +insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997), + (3,11120436154190595086); +insert into t2 (c) values (1), (2), (3); +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 + join t2 on t1.a=t2.c order by d; +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 + join t2 on t1.a=t2.c where b=11120436154190595086 order by d; +drop table t1, t2; + +--echo End of 5.0 tests diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 06ad25313ce..dff6bf3fcff 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -483,7 +483,7 @@ drop table t1,t2; create table t1 (a int); --error 1093 create table t1 select * from t1; ---error 1093 +--error ER_WRONG_OBJECT create table t2 union = (t1) select * from t1; flush tables with read lock; unlock tables; diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 6c83fbfdc9c..7b4f95bbf8a 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1755,9 +1755,9 @@ insert into t1 values(); select BIN(a) from t1; drop table t1; # We prevent creation of table with nullable ENUM ---error ER_CANT_CREATE_TABLE +--error ER_CHECK_NOT_IMPLEMENTED create table t1(a enum('foo','bar') default null) engine=csv; ---error ER_CANT_CREATE_TABLE +--error ER_CHECK_NOT_IMPLEMENTED create table t1(a enum('foo','bar') default 'foo') engine=csv; # Enum columns must be specified as NOT NULL create table t1(a enum('foo','bar') default 'foo' not null) engine=csv; @@ -1765,5 +1765,12 @@ insert into t1 values(); select * from t1; drop table t1; +# +# BUG#32817 - though CSV is marked as supported create table is rejected +# with error 1005. +# +--error ER_CHECK_NOT_IMPLEMENTED +CREATE TABLE t1(a INT) ENGINE=CSV; +SHOW WARNINGS; --echo End of 5.1 tests diff --git a/mysql-test/t/ctype_euckr.test b/mysql-test/t/ctype_euckr.test index 56939817b2f..05e4b04eded 100644 --- a/mysql-test/t/ctype_euckr.test +++ b/mysql-test/t/ctype_euckr.test @@ -31,3 +31,26 @@ SELECT hex(a) FROM t1 ORDER BY a; DROP TABLE t1; # End of 4.1 tests + +# +#Bug #30315 Character sets: insertion of euckr code value 0xa141 fails +# +create table t1 (s1 varchar(5) character set euckr); +# Insert some valid characters +insert into t1 values (0xA141); +insert into t1 values (0xA15A); +insert into t1 values (0xA161); +insert into t1 values (0xA17A); +insert into t1 values (0xA181); +insert into t1 values (0xA1FE); +# Insert some invalid characters +insert into t1 values (0xA140); +insert into t1 values (0xA15B); +insert into t1 values (0xA160); +insert into t1 values (0xA17B); +insert into t1 values (0xA180); +insert into t1 values (0xA1FF); +select hex(s1), hex(convert(s1 using utf8)) from t1 order by binary s1; +drop table t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 695a21adbf5..0d917428efb 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -538,4 +538,8 @@ alter table t1 convert to character set ucs2 collate ucs2_czech_ci; select * from t1 where a like 'c%'; drop table t1; +set collation_connection=ucs2_unicode_ci; +--source include/ctype_regex.inc +set names utf8; + -- echo End for 5.0 tests diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 7827ff0d31e..3af5bfa54f9 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -548,6 +548,18 @@ select quote(name) from bug20536; drop table bug20536; # +# Bug #31615: crash after set names ucs2 collate xxx +# +--error 1231 +set names ucs2; +--error 1231 +set names ucs2 collate ucs2_bin; +--error 1231 +set character_set_client= ucs2; +--error 1231 +set character_set_client= concat('ucs', substr('2', 1)); + +# # BUG#31159 - fulltext search on ucs2 column crashes server # CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci); @@ -659,6 +671,9 @@ select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062); select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0); drop table t1; +set collation_connection=ucs2_general_ci; +--source include/ctype_regex.inc +set names latin1; # # Bug#30981 CHAR(0x41 USING ucs2) doesn't add leading zero # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 5c35bf82343..d18a7d22a0e 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -186,6 +186,13 @@ select * from t1 where a = 'b' and a != 'b'; drop table t1; # +# Testing regexp +# +set collation_connection=utf8_general_ci; +--source include/ctype_regex.inc +set names utf8; + +# # Bug #3928 regexp [[:>:]] and UTF-8 # set names utf8; diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 03b4f8b3013..ce57645bd4b 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -103,13 +103,13 @@ DROP TABLE t1; # Bug#20627 - INSERT DELAYED does not honour auto_increment_* variables # SET @bug20627_old_auto_increment_offset= - @@auto_increment_offset= 2; + @@auto_increment_offset; SET @bug20627_old_auto_increment_increment= - @@auto_increment_increment= 3; + @@auto_increment_increment; SET @bug20627_old_session_auto_increment_offset= - @@session.auto_increment_offset= 4; + @@session.auto_increment_offset; SET @bug20627_old_session_auto_increment_increment= - @@session.auto_increment_increment= 5; + @@session.auto_increment_increment; SET @@auto_increment_offset= 2; SET @@auto_increment_increment= 3; SET @@session.auto_increment_offset= 4; @@ -151,13 +151,13 @@ SET @@session.auto_increment_increment= # Bug#20830 - INSERT DELAYED does not honour SET INSERT_ID # SET @bug20830_old_auto_increment_offset= - @@auto_increment_offset= 2; + @@auto_increment_offset; SET @bug20830_old_auto_increment_increment= - @@auto_increment_increment= 3; + @@auto_increment_increment; SET @bug20830_old_session_auto_increment_offset= - @@session.auto_increment_offset= 4; + @@session.auto_increment_offset; SET @bug20830_old_session_auto_increment_increment= - @@session.auto_increment_increment= 5; + @@session.auto_increment_increment; SET @@auto_increment_offset= 2; SET @@auto_increment_increment= 3; SET @@session.auto_increment_offset= 4; @@ -244,13 +244,15 @@ SELECT HEX(a) FROM t1; DROP TABLE t1; # -# Bug#26464 - insert delayed + update + merge = corruption +# Bug #32676: insert delayed crash with wrong column and function specified # -CREATE TABLE t1(c1 INT) ENGINE=MyISAM; -CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); ---error 1031 -INSERT DELAYED INTO t2 VALUES(1); -DROP TABLE t1, t2; +CREATE TABLE t1 (a INT); +--error ER_BAD_FIELD_ERROR +INSERT DELAYED INTO t1 SET b= b(); +DROP TABLE t1; + +--echo End of 5.0 tests + # # Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client # @@ -283,3 +285,4 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00'); INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); DROP TABLE t1,t2; +--echo End of 5.1 tests diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index a39de913659..2c16017241c 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -15,3 +15,11 @@ concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper federated_transactions : Bug#29523 Transactions do not work +events : Bug#32664 events.test fails randomly +lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log +kill : Bug#29149: Test "kill" fails on Windows +innodb_mysql : Bug#32724: innodb_mysql.test fails randomly +wait_timeout : Bug#32801 wait_timeout.test fails randomly +kill : Bug#29149 Test "kill" fails on Windows +ctype_create : Bug#32965 main.ctype_create fails +status : Bug#32966 main.status fails diff --git a/mysql-test/t/events_bugs-master.opt b/mysql-test/t/events_bugs-master.opt new file mode 100644 index 00000000000..f93413a61e5 --- /dev/null +++ b/mysql-test/t/events_bugs-master.opt @@ -0,0 +1 @@ +--event-scheduler diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index ebd86f3a3d2..efdb67349ec 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -10,6 +10,21 @@ create database events_test; use events_test; # +# START: Bug #31332 --event-scheduler option misbehaving +# + +# NOTE!! this test must come first! It's testing that the --event-scheduler +# option with no argument in events_bugs-master.opt turns the scheduler on. + +select * from information_schema.global_variables where variable_name like 'event_scheduler'; + +SET GLOBAL event_scheduler = 'OFF'; + +# +# END: Bug #31332 +# + +# # START - 16415: Events: event names are case sensitive # CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1; diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index b1eeae1e020..226cad0f3eb 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -87,7 +87,7 @@ SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; -SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR') +SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2'; diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index d58d038c3ea..794423ca211 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -133,6 +133,37 @@ disconnect con3; connection default; drop table t1, t2; +# +# Bug#32528 Global read lock with a low priority write lock causes a server crash +# + +--disable_warnings +drop table if exists t1, t2; +--enable_warnings + +set session low_priority_updates=1; + +create table t1 (a int); +create table t2 (b int); + +lock tables t1 write; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +flush tables with read lock; +unlock tables; + +lock tables t1 read, t2 write; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +flush tables with read lock; +unlock tables; + +lock tables t1 read; +flush tables with read lock; +unlock tables; + +drop table t1, t2; + +set session low_priority_updates=default; + --echo End of 5.0 tests # diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 426fa8992fe..5a934ce712e 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -213,6 +213,25 @@ SELECT NAME_CONST('test', 1.0); SELECT NAME_CONST('test', -1.0); SELECT NAME_CONST('test', 'test'); +# +# Bug #32559: connection hangs on query with name_const +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (), (), (); +--error ER_WRONG_ARGUMENTS +SELECT NAME_CONST(a, '1') FROM t1; +--error ER_WRONG_ARGUMENTS +SET INSERT_ID= NAME_CONST(a, a); +DROP TABLE t1; + +# +# Bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' +# +create table t1 (a int not null); +insert into t1 values (-1), (-2); +select min(a) from t1 group by inet_ntoa(a); +drop table t1; + --echo End of 5.0 tests # diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test index 5eff404bc0f..1b35fab9d54 100644 --- a/mysql-test/t/func_regexp.test +++ b/mysql-test/t/func_regexp.test @@ -6,28 +6,9 @@ drop table if exists t1; --enable_warnings -create table t1 (s1 char(64),s2 char(64)); +set names latin1; +--source include/ctype_regex.inc -insert into t1 values('aaa','aaa'); -insert into t1 values('aaa|qqq','qqq'); -insert into t1 values('gheis','^[^a-dXYZ]+$'); -insert into t1 values('aab','^aa?b'); -insert into t1 values('Baaan','^Ba*n'); -insert into t1 values('aaa','qqq|aaa'); -insert into t1 values('qqq','qqq|aaa'); - -insert into t1 values('bbb','qqq|aaa'); -insert into t1 values('bbb','qqq'); -insert into t1 values('aaa','aba'); - -insert into t1 values(null,'abc'); -insert into t1 values('def',null); -insert into t1 values(null,null); -insert into t1 values('ghi','ghi['); - -select HIGH_PRIORITY s1 regexp s2 from t1; - -drop table t1; # # This test a bug in regexp on Alpha diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index 710b9b90a05..e4fde6e0e0e 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -54,4 +54,21 @@ select find_in_set(binary 'a', 'A,B,C'); # select find_in_set('1','3,1,'); -# End of 4.1 tests +--echo End of 4.1 tests + +# +# Bug #32560: crash with interval function and count(*) +# +SELECT INTERVAL(0.0, NULL); +SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL)); +SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL)); +SELECT INTERVAL(0.0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +SELECT INTERVAL(0.0, CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), + CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), + CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL), CAST(NULL AS DECIMAL)); +SELECT INTERVAL(0.0, CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), + CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), + CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL), + CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL)); + +--echo End of 5.0 tests diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 8d909d63f51..d9ee38d0c14 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1235,6 +1235,7 @@ DROP DATABASE mysqltest1; DROP DATABASE mysqltest2; DROP USER mysqltest_1@localhost; +DROP USER mysqltest_2@localhost; # # Bug#27878: Unchecked privileges on a view referring to a table from another @@ -1260,6 +1261,7 @@ connection default; REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; +DROP USER mysqltest_1@localhost; DROP DATABASE db27878; use test; DROP TABLE t1; @@ -1277,3 +1279,101 @@ drop user юзер_юзер@localhost; --error ER_WRONG_STRING_LENGTH grant select on test.* to очень_длинный_юзер@localhost; set names default; + +# +# Bug #20901 - CREATE privilege is enough to insert into a table +# + +create database mysqltest; +use mysqltest; + +grant create on mysqltest.* to mysqltest@localhost; +create table t1 (i INT); + +connect (user1,localhost,mysqltest,,mysqltest); +connection user1; +# show we don't have INSERT +--error 1142 +insert into t1 values (1); +# show we have CREATE +create table t2 (i INT); +create table t4 (i INT); + +connection default; +grant select, insert on mysqltest.t2 to mysqltest@localhost; +grant insert on mysqltest.t4 to mysqltest@localhost; +# to specify ACLs for non-existent objects, must explictly |CREATE +grant create, insert on mysqltest.t5 to mysqltest@localhost; +grant create, insert on mysqltest.t6 to mysqltest@localhost; +flush privileges; + +connection user1; +insert into t2 values (1); + + +# CREATE IF NOT EXISTS...SELECT, t1 exists, no INSERT, must fail +--error 1142 +create table if not exists t1 select * from t2; + +# CREATE IF NOT EXISTS...SELECT, no t3 yet, no INSERT, must fail +--error 1142 +create table if not exists t3 select * from t2; + +# CREATE IF NOT EXISTS...SELECT, t4 exists, have INSERT, must succeed +create table if not exists t4 select * from t2; + +# CREATE IF NOT EXISTS...SELECT, no t5 yet, have INSERT, must succeed +create table if not exists t5 select * from t2; + + +# CREATE...SELECT, no t6 yet, have INSERT, must succeed +create table t6 select * from t2; + +# CREATE...SELECT, no t7 yet, no INSERT, must fail +--error 1142 +create table t7 select * from t2; + +# CREATE...SELECT, t4 exists, have INSERT, must still fail (exists) +--error 1050 +create table t4 select * from t2; + +# CREATE...SELECT, t1 exists, no INSERT, must fail +--error 1142 +create table t1 select * from t2; + + +connection default; +drop table t1,t2,t4,t5,t6; + +revoke create on mysqltest.* from mysqltest@localhost; +revoke select, insert on mysqltest.t2 from mysqltest@localhost; +revoke insert on mysqltest.t4 from mysqltest@localhost; +revoke create, insert on mysqltest.t5 from mysqltest@localhost; +revoke create, insert on mysqltest.t6 from mysqltest@localhost; +drop user mysqltest@localhost; + +disconnect user1; +drop database mysqltest; +use test; + + +# +# Bug #16470 crash on grant if old grant tables +# +--echo FLUSH PRIVILEGES without procs_priv table. +RENAME TABLE mysql.procs_priv TO mysql.procs_gone; +FLUSH PRIVILEGES; +--echo Assigning privileges without procs_priv table. +CREATE DATABASE mysqltest1; +CREATE PROCEDURE mysqltest1.test() SQL SECURITY DEFINER + SELECT 1; +--error ER_NO_SUCH_TABLE +GRANT EXECUTE ON FUNCTION mysqltest1.test TO mysqltest_1@localhost; +GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost; +CALL mysqltest1.test(); +DROP DATABASE mysqltest1; +RENAME TABLE mysql.procs_gone TO mysql.procs_priv; +FLUSH PRIVILEGES; + + +--echo End of 5.1 tests diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 3d3aeec16b9..2a9319fe010 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1143,6 +1143,7 @@ END$$ DELIMITER ;$$ +let $wait_timeout= 300; let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_status'; --source include/wait_condition.inc diff --git a/mysql-test/t/innodb-semi-consistent-master.opt b/mysql-test/t/innodb-semi-consistent-master.opt new file mode 100644 index 00000000000..2746e4e184e --- /dev/null +++ b/mysql-test/t/innodb-semi-consistent-master.opt @@ -0,0 +1 @@ +--innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=2 diff --git a/mysql-test/t/innodb-semi-consistent.test b/mysql-test/t/innodb-semi-consistent.test new file mode 100644 index 00000000000..c33126b93ff --- /dev/null +++ b/mysql-test/t/innodb-semi-consistent.test @@ -0,0 +1,50 @@ +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# basic tests of semi-consistent reads + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +set session transaction isolation level read committed; +create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; +insert into t1 values (1),(2),(3),(4),(5),(6),(7); +set autocommit=0; +# this should lock the entire table +select * from t1 where a=3 lock in share mode; +connection b; +set session transaction isolation level read committed; +set autocommit=0; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=10 where a=5; +connection a; +commit; +connection b; +update t1 set a=10 where a=5; +connection a; +-- error ER_LOCK_WAIT_TIMEOUT +select * from t1 where a=2 for update; +# this should lock the records (1),(2) +select * from t1 where a=2 limit 1 for update; +connection b; +update t1 set a=11 where a=6; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=12 where a=2; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=13 where a=1; +connection a; +commit; +connection b; +update t1 set a=14 where a=1; +commit; +connection a; +select * from t1; +drop table t1; + +connection default; +disconnect a; +disconnect b; diff --git a/mysql-test/t/innodb-ucs2.test b/mysql-test/t/innodb-ucs2.test index 6647a9d0845..7b91ef37d3f 100644 --- a/mysql-test/t/innodb-ucs2.test +++ b/mysql-test/t/innodb-ucs2.test @@ -1,6 +1,10 @@ -- source include/have_innodb.inc -- source include/have_ucs2.inc +--disable_warnings +drop table if exists t1, t2; +--enable_warnings + # # BUG 14056 Column prefix index on UTF-8 primary key column causes: Can't find record.. # diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index cc1ef6f9730..8fdbbfcde79 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -327,39 +327,6 @@ select * from t2; drop table t1,t2; # -# Search on unique key -# - -CREATE TABLE t1 ( - id int(11) NOT NULL auto_increment, - ggid varchar(32) binary DEFAULT '' NOT NULL, - email varchar(64) DEFAULT '' NOT NULL, - passwd varchar(32) binary DEFAULT '' NOT NULL, - PRIMARY KEY (id), - UNIQUE ggid (ggid) -) ENGINE=innodb; - -insert into t1 (ggid,passwd) values ('test1','xxx'); -insert into t1 (ggid,passwd) values ('test2','yyy'); --- error ER_DUP_ENTRY -insert into t1 (ggid,passwd) values ('test2','this will fail'); --- error ER_DUP_ENTRY -insert into t1 (ggid,id) values ('this will fail',1); - -select * from t1 where ggid='test1'; -select * from t1 where passwd='xxx'; -select * from t1 where id=2; - -replace into t1 (ggid,id) values ('this will work',1); -replace into t1 (ggid,passwd) values ('test2','this will work'); --- error ER_DUP_ENTRY -update t1 set id=100,ggid='test2' where id=1; -select * from t1; -select * from t1 where id=1; -select * from t1 where id=999; -drop table t1; - -# # ORDER BY on not primary key # @@ -754,6 +721,38 @@ select * from t2; drop table t1,t2; # +# Bug #29136 erred multi-delete on trans table does not rollback +# + +# prepare +--disable_warnings +drop table if exists t1, t2; +--enable_warnings +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB; +create trigger trg_del_t2 after delete on t2 for each row + insert into t1 values (1); +insert into t1 values (1); +insert into t2 values (1),(2); + + +# exec cases A, B - see multi_update.test + +# A. send_error() w/o send_eof() branch + +--error ER_DUP_ENTRY +delete t2 from t2; + +# check + +select count(*) from t2 /* must be 2 as restored after rollback caused by the error */; + +# cleanup bug#29136 + +drop table t1, t2; + + +# # Testing of IFNULL # create table t1 (a int, b int) engine=innodb; @@ -2323,6 +2322,67 @@ CREATE TABLE t1 ( c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) ) ENGINE = InnoDB; +# +# Bug #31860 InnoDB assumes AUTOINC values can only be positive. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1( + id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY + ) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-10); +SELECT * FROM t1; +# +# NOTE: The server really needs to be restarted at this point +# for the test to be useful. +# +# Without the fix InnoDB would trip over an assertion here. +INSERT INTO t1 VALUES(NULL); +# The next value should be 1 and not -9 or a -ve number +SELECT * FROM t1; +DROP TABLE t1; + +# +# Bug #21409 Incorrect result returned when in READ-COMMITTED with +# query_cache ON +# +CONNECT (c1,localhost,root,,); +CONNECT (c2,localhost,root,,); +CONNECTION c1; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +SELECT * FROM t2; +CONNECTION c2; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +COMMIT; +CONNECTION c1; +SELECT * FROM t1 WHERE a=1; +DISCONNECT c1; +DISCONNECT c2; +CONNECT (c1,localhost,root,,); +CONNECT (c2,localhost,root,,); +CONNECTION c1; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +SELECT * FROM t2; +CONNECTION c2; +SET TX_ISOLATION='read-committed'; +SET AUTOCOMMIT=0; +INSERT INTO t1 VALUES (2); +COMMIT; +CONNECTION c1; +# The result set below should be the same for both selects +SELECT * FROM t1 WHERE a=2; +SELECT * FROM t1 WHERE a=2; +DROP TABLE t1; +DROP TABLE t2; +DISCONNECT c1; +DISCONNECT c2; + ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt b/mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt new file mode 100644 index 00000000000..fad0da2ac2e --- /dev/null +++ b/mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt @@ -0,0 +1 @@ +--innodb-autoinc-lock-mode=0 diff --git a/mysql-test/t/innodb_autoinc_lock_mode_zero.test b/mysql-test/t/innodb_autoinc_lock_mode_zero.test new file mode 100644 index 00000000000..96f748673c0 --- /dev/null +++ b/mysql-test/t/innodb_autoinc_lock_mode_zero.test @@ -0,0 +1,44 @@ +# This test runs with old-style locking, as: +# --innodb-autoinc-lock-mode=0 + +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + + +# +# Search on unique key +# + +CREATE TABLE t1 ( + id int(11) NOT NULL auto_increment, + ggid varchar(32) binary DEFAULT '' NOT NULL, + email varchar(64) DEFAULT '' NOT NULL, + passwd varchar(32) binary DEFAULT '' NOT NULL, + PRIMARY KEY (id), + UNIQUE ggid (ggid) +) ENGINE=innodb; + +insert into t1 (ggid,passwd) values ('test1','xxx'); +insert into t1 (ggid,passwd) values ('test2','yyy'); +-- error ER_DUP_ENTRY +insert into t1 (ggid,passwd) values ('test2','this will fail'); +-- error ER_DUP_ENTRY +insert into t1 (ggid,id) values ('this will fail',1); + +select * from t1 where ggid='test1'; +select * from t1 where passwd='xxx'; +select * from t1 where id=2; + +replace into t1 (ggid,id) values ('this will work',1); +replace into t1 (ggid,passwd) values ('test2','this will work'); +-- error ER_DUP_ENTRY +update t1 set id=100,ggid='test2' where id=1; +select * from t1; +select * from t1 where id=1; +select * from t1 where id=999; +drop table t1; + +--echo End of tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 93495538141..a907866f726 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -10,5 +10,6 @@ let $engine_type= InnoDB; let $other_engine_type= MEMORY; # InnoDB does support FOREIGN KEYFOREIGN KEYs let $test_foreign_keys= 1; - +set global innodb_support_xa=default; +set session innodb_support_xa=default; --source include/mix1.inc diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 3d32da9c3b7..c58fb61ad30 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -387,5 +387,106 @@ SELECT * FROM t2; DROP TABLE t1, t2; +# +# Bug #26788: mysqld (debug) aborts when inserting specific numbers into char +# fields +# + +CREATE TABLE t1 ( + a char(20) NOT NULL, + b char(7) DEFAULT NULL, + c char(4) DEFAULT NULL +); + +INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0); +INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05); +INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04); +INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01); +INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01); +INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01); +INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01); +INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05); +INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10); +INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15); +INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0); +INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78); +INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94); +INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203); +INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175); +INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0); +INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); +INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); +INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); +INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); +INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); +INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); +# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and +# "1.3e+78" due to different rounding rules +--replace_result 12.3 12.2 1.3e+78 1.2e+78 +SELECT * FROM t1; + +DROP TABLE t1; + +CREATE TABLE t1 ( + a char(20) NOT NULL, + b char(7) DEFAULT NULL, + c char(5) +); + + +INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0); +INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05); +INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04); +INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01); +INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01); +INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01); +INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01); +INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05); +INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10); +INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15); +INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0); +INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78); +INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94); +INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203); +INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175); +INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0); +INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); +INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); +INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); +INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); +INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); +INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); + +# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and +# "1.3e+78" due to different rounding rules +--replace_result 12.3 12.2 1.3e+78 1.2e+78 +SELECT * FROM t1; + +DROP TABLE t1; + +# +# Bug #31152: assertion in Field_str::store(double) +# + +CREATE TABLE t (a CHAR(10),b INT); +INSERT INTO t VALUES (),(),(); +INSERT INTO t(a) SELECT rand() FROM t; +DROP TABLE t; + +# +# Bug #30453: String not cast to int correctly +# + +CREATE TABLE t1 (c1 INT NOT NULL); +INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500), +('4188.32999999999992724042385816574096679687500'), (4188); +SELECT * FROM t1; + +CREATE TABLE t2 (c1 BIGINT); +INSERT INTO t2 VALUES('15449237462.0000000000'); +SELECT * FROM t2; + +DROP TABLE t1, t2; + --echo End of 5.0 tests. diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 31d5ac5201b..9a4158d8e13 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -503,6 +503,26 @@ ORDER BY c.b, c.d DROP TABLE t1, t2; # +# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0 +# +create table t1(a int not null, key aa(a), + b char(10) not null, unique key bb(b(1)), + c char(4) not null, unique key cc(c)); +desc t1; +show create table t1; +drop table t1; +create table t1(a int not null, key aa(a), + b char(10) not null, unique key bb(b(1)), + c char(4) not null); +desc t1; +alter table t1 add unique key cc(c); +desc t1; +show create table t1; +drop table t1; + +--echo End of 5.0 tests + +# # Bug #31148: bool close_thread_table(THD*, TABLE**): Assertion # `table->key_read == 0' failed. # diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 5d5095f7d61..3da4232502d 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -304,3 +304,21 @@ while ($i) dec $i ; } --enable_query_log + +########################################################################### + +--echo # +--echo # Bug#19723: kill of active connection yields different error code +--echo # depending on platform. +--echo # + +--echo +--echo # Connection: con2. +--connection con2 + +KILL CONNECTION_ID(); + +--echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing +--echo # of close of the connection socket +--error 2013, 2006 +SELECT 1; diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test index f7795e49b37..a340238b724 100644 --- a/mysql-test/t/log_state.test +++ b/mysql-test/t/log_state.test @@ -213,6 +213,24 @@ SELECT @@slow_query_log, @@log_slow_queries; SET GLOBAL general_log = @old_general_log_state; SET GLOBAL slow_query_log = @old_slow_log_state; +# +# Bug #31604: server crash when setting slow_query_log_file/general_log_file +# +set @old_general_log_file= @@global.general_log_file; +set @old_slow_query_log_file= @@global.slow_query_log_file; + +--error 1231 +set global general_log_file= concat('/not exiting path/log.maste', 'r'); +--error 1231 +set global general_log_file= NULL; +--error 1231 +set global slow_query_log_file= concat('/not exiting path/log.maste', 'r'); +--error 1231 +set global slow_query_log_file= NULL; + +set global general_log_file= @old_general_log_file; +set global slow_query_log_file= @old_slow_query_log_file; + --echo End of 5.1 tests --enable_ps_protocol diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index f02138fb30b..0c986c6d63a 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -811,6 +811,7 @@ SET GLOBAL slow_query_log = @old_slow_log_state; # Bug#21557 entries in the general query log truncated at 1000 characters. # +select CONNECTION_ID() into @thread_id; truncate table mysql.general_log; set @old_general_log_state = @@global.general_log; set global general_log = on; @@ -921,7 +922,7 @@ prepare long_query from "select ? as long_query"; execute long_query using @lparam; --enable_result_log set global general_log = off; -select command_type, argument from mysql.general_log; +select command_type, argument from mysql.general_log where thread_id = @thread_id; deallocate prepare long_query; set global general_log = @old_general_log_state; diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test new file mode 100644 index 00000000000..eddcbb59ed4 --- /dev/null +++ b/mysql-test/t/merge-big.test @@ -0,0 +1,150 @@ +# +# Test of MERGE tables with multisession and many waits. +# +# This test takes rather long time so let us run it only in --big-test mode +--source include/big_test.inc +# We are using some debug-only features in this test +--source include/have_debug.inc + +--disable_warnings +drop table if exists t1,t2,t3,t4,t5,t6; +--enable_warnings + +--echo # +--echo # Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE +--echo # corrupts a MERGE table +--echo # Problem #3 +--echo # +# Two FLUSH TABLES within a LOCK TABLES segment could invalidate the lock. +# This did *not* require a MERGE table. +# +# To increase reproducibility it was necessary to enter a sleep of 2 +# seconds at the end of wait_for_tables() after unlock of LOCK_open. In +# 5.0 and 5.1 the sleep must be inserted in open_and_lock_tables() after +# open_tables() instead. wait_for_tables() is not used in this case. The +# problem was that FLUSH TABLES releases LOCK_open while having unlocked +# and closed all tables. When this happened while a thread was in the +# loop in mysql_lock_tables() right after wait_for_tables() +# (open_tables()) and before retrying to lock, the thread got the lock. +# And it did not notice that the table needed a refresh after the +# [re-]open. So it executed its statement on the table. +# +# The first FLUSH TABLES kicked the INSERT out of thr_multi_lock() and +# let it wait in wait_for_tables() (open_table()). The second FLUSH +# TABLES must happen while the INSERT was on its way from +# wait_for_tables() (open_table()) to the next call of thr_multi_lock(). +# This needed to be supported by a sleep to make it repeatable. +# +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +LOCK TABLE t1 WRITE; +#SELECT NOW(); + --echo # connection con1 + connect (con1,localhost,root,,); + let $con1_id= `SELECT CONNECTION_ID()`; + SET SESSION debug="+d,sleep_open_and_lock_after_open"; + send INSERT INTO t1 VALUES (1); +--echo # connection default +connection default; +--echo # Let INSERT go into thr_multi_lock(). +let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE ID = $con1_id AND STATE = 'Locked'; +--source include/wait_condition.inc +#SELECT NOW(); +--echo # Kick INSERT out of thr_multi_lock(). +FLUSH TABLES; +#SELECT NOW(); +--echo # Let INSERT go through open_tables() where it sleeps. +let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE ID = $con1_id AND STATE = 'DBUG sleep'; +--source include/wait_condition.inc +#SELECT NOW(); +--echo # Unlock and close table and wait for con1 to close too. +FLUSH TABLES; +#SELECT NOW(); +--echo # This should give no result. +SELECT * FROM t1; +#SELECT NOW(); +UNLOCK TABLES; + --echo # connection con1 + connection con1; + reap; + SET SESSION debug="-d,sleep_open_and_lock_after_open"; + disconnect con1; +--echo # connection default +connection default; +DROP TABLE t1; + +--echo # +--echo # Extra tests for Bug#26379 - Combination of FLUSH TABLE and +--echo # REPAIR TABLE corrupts a MERGE table +--echo # +CREATE TABLE t1 (c1 INT); +CREATE TABLE t2 (c1 INT); +CREATE TABLE t3 (c1 INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +--echo # +--echo # CREATE ... SELECT +--echo # try to access parent from another thread. +--echo # +#SELECT NOW(); + --echo # connection con1 + connect (con1,localhost,root,,); + let $con1_id= `SELECT CONNECTION_ID()`; + SET SESSION debug="+d,sleep_create_select_before_lock"; + send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) + INSERT_METHOD=FIRST SELECT * FROM t3; +--echo # connection default +connection default; +# wait for the other query to start executing +let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE ID = $con1_id AND STATE = 'DBUG sleep'; +--source include/wait_condition.inc +#SELECT NOW(); +--echo # Now try to access the parent. +--echo # If 3 is in table, SELECT had to wait. +SELECT * FROM t4 ORDER BY c1; +#SELECT NOW(); + --echo # connection con1 + connection con1; + reap; + #SELECT NOW(); + SET SESSION debug="-d,sleep_create_select_before_lock"; + disconnect con1; +--echo # connection default +connection default; +--echo # Cleanup for next test. +DROP TABLE t4; +DELETE FROM t1 WHERE c1 != 1; +--echo # +--echo # CREATE ... SELECT +--echo # try to access child from another thread. +--echo # +#SELECT NOW(); + --echo # connection con1 + connect (con1,localhost,root,,); + let $con1_id= `SELECT CONNECTION_ID()`; + SET SESSION debug="+d,sleep_create_select_before_lock"; + send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) + INSERT_METHOD=FIRST SELECT * FROM t3; +--echo # connection default +connection default; +# wait for the other query to start executing +let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE ID = $con1_id AND STATE = 'DBUG sleep'; +--source include/wait_condition.inc +#SELECT NOW(); +--echo # Now try to access a child. +--echo # If 3 is in table, SELECT had to wait. +SELECT * FROM t1 ORDER BY c1; +#SELECT NOW(); + --echo # connection con1 + connection con1; + reap; + #SELECT NOW(); + SET SESSION debug="-d,sleep_create_select_before_lock"; + disconnect con1; +--echo # connection default +connection default; +DROP TABLE t1, t2, t3, t4; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index f8fd82707ce..e49297dd06c 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -1,5 +1,5 @@ # -# test of MERGE TABLES +# Test of MERGE TABLES # --disable_warnings @@ -221,6 +221,7 @@ create table t2 (a int not null); insert into t1 values (1); insert into t2 values (2); create temporary table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +--error ER_WRONG_MRG_TABLE select * from t3; create temporary table t4 (a int not null); create temporary table t5 (a int not null); @@ -229,6 +230,58 @@ insert into t5 values (2); create temporary table t6 (a int not null) ENGINE=MERGE UNION=(t4,t5); select * from t6; drop table t6, t3, t1, t2, t4, t5; +# +# Bug#19627 - temporary merge table locking +# MERGE table and its children must match in temporary type. +# Forbid temporary merge on non-temporary children: shown above. +# Forbid non-temporary merge on temporary children: +create temporary table t1 (a int not null); +create temporary table t2 (a int not null); +insert into t1 values (1); +insert into t2 values (2); +create table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +--error ER_WRONG_MRG_TABLE +select * from t3; +drop table t3, t2, t1; +# Forbid children mismatch in temporary: +create table t1 (a int not null); +create temporary table t2 (a int not null); +insert into t1 values (1); +insert into t2 values (2); +create table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +--error ER_WRONG_MRG_TABLE +select * from t3; +drop table t3; +create temporary table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +--error ER_WRONG_MRG_TABLE +select * from t3; +drop table t3, t2, t1; +--echo # CREATE...SELECT is not implemented for MERGE tables. +CREATE TEMPORARY TABLE t1 (c1 INT NOT NULL); +CREATE TEMPORARY TABLE t2 (c1 INT NOT NULL); +CREATE TABLE t3 (c1 INT NOT NULL); +INSERT INTO t3 VALUES (3), (33); +LOCK TABLES t3 READ; +--error ER_WRONG_OBJECT +CREATE TEMPORARY TABLE t4 (c1 INT NOT NULL) ENGINE=MERGE UNION=(t1,t2) + INSERT_METHOD=LAST SELECT * FROM t3; +--error ER_TABLE_NOT_LOCKED +SELECT * FROM t4; +UNLOCK TABLES; +CREATE TEMPORARY TABLE t4 (c1 INT NOT NULL) ENGINE=MERGE UNION=(t1,t2) + INSERT_METHOD=LAST; +INSERT INTO t4 SELECT * FROM t3; +--echo # Alter temporary MERGE table. +ALTER TABLE t4 UNION=(t1); +LOCK TABLES t4 WRITE; +--echo # Alter temporary MERGE table under LOCk tables. +ALTER TABLE t4 UNION=(t1,t2); +UNLOCK TABLES; +--echo # MERGE table and function. +CREATE FUNCTION f1 () RETURNS INT RETURN (SELECT max(c1) FROM t3); +SELECT * FROM t4 WHERE c1 < f1(); +DROP FUNCTION f1; +DROP TABLE t4, t3, t2, t1; # # testing merge::records_in_range and optimizer @@ -284,11 +337,11 @@ create table t1 (a int); create table t2 (a int); insert into t1 values (0); insert into t2 values (1); ---error 1093 +--error ER_WRONG_OBJECT create table t3 engine=merge union=(t1, t2) select * from t1; ---error 1093 +--error ER_WRONG_OBJECT create table t3 engine=merge union=(t1, t2) select * from t2; ---error 1093 +--error ER_WRONG_OBJECT create table t3 engine=merge union=(t1, t2) select (select max(a) from t2); drop table t1, t2; @@ -403,7 +456,7 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1); SELECT * FROM t2; DROP TABLE t1, t2; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); ---error 1168 +--error ER_NO_SUCH_TABLE SELECT * FROM t2; DROP TABLE t2; @@ -495,11 +548,11 @@ drop table t1; # CREATE TABLE fails # CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2); ---error 1168 +--error ER_NO_SUCH_TABLE SELECT * FROM tm1; CHECK TABLE tm1; CREATE TABLE t1(a INT); ---error 1168 +--error ER_NO_SUCH_TABLE SELECT * FROM tm1; CHECK TABLE tm1; CREATE TABLE t2(a BLOB); @@ -548,3 +601,783 @@ DROP TABLE t1, t2, t3; --echo End of 5.0 tests + +# +# Bug #8306: TRUNCATE leads to index corruption +# +create table t1 (c1 int, index(c1)); +create table t2 (c1 int, index(c1)) engine=merge union=(t1); +insert into t1 values (1); +# Close all tables. +flush tables; +# Open t2 and (implicitly) t1. +select * from t2; +# Truncate after flush works (unless another threads reopens t2 in between). +flush tables; +truncate table t1; +insert into t1 values (1); +# Close all tables. +flush tables; +# Open t2 and (implicitly) t1. +select * from t2; +# Truncate t1, wich was not recognized as open without the bugfix. +# After fix for Bug#8306 and before fix for Bug#26379, +# it should fail with a table-in-use error message, otherwise succeed. +truncate table t1; +# The insert used to fail on the crashed table. +insert into t1 values (1); +drop table t1,t2; +--echo # +--echo # Extra tests for TRUNCATE. +--echo # +--echo # Truncate MERGE table. +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)); +CREATE TABLE t3 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1,t2); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t3; +TRUNCATE TABLE t3; +SELECT * FROM t3; +--echo # +--echo # Truncate child table. +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +TRUNCATE TABLE t1; +SELECT * FROM t3; +--echo # +--echo # Truncate MERGE table under locked tables. +LOCK TABLE t1 WRITE, t2 WRITE, t3 WRITE; +INSERT INTO t1 VALUES (1); +--error ER_LOCK_OR_ACTIVE_TRANSACTION +TRUNCATE TABLE t3; +SELECT * FROM t3; +--echo # +--echo # Truncate child table under locked tables. +--error ER_LOCK_OR_ACTIVE_TRANSACTION +TRUNCATE TABLE t1; +SELECT * FROM t3; +UNLOCK TABLES; +DROP TABLE t1, t2, t3; +--echo # +--echo # Truncate temporary MERGE table. +CREATE TEMPORARY TABLE t1 (c1 INT, INDEX(c1)); +CREATE TEMPORARY TABLE t2 (c1 INT, INDEX(c1)); +CREATE TEMPORARY TABLE t3 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1,t2); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t3; +TRUNCATE TABLE t3; +SELECT * FROM t3; +--echo # +--echo # Truncate temporary child table. +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +TRUNCATE TABLE t1; +SELECT * FROM t3; +--echo # +--echo # Truncate temporary MERGE table under locked tables. +INSERT INTO t1 VALUES (1); +CREATE TABLE t4 (c1 INT, INDEX(c1)); +LOCK TABLE t4 WRITE; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +TRUNCATE TABLE t3; +SELECT * FROM t3; +--echo # +--echo # Truncate temporary child table under locked tables. +--error ER_LOCK_OR_ACTIVE_TRANSACTION +TRUNCATE TABLE t1; +SELECT * FROM t3; +UNLOCK TABLES; +DROP TABLE t1, t2, t3, t4; + +# +# Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table +# Preparation +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +connection default; +# +# Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table +# Problem #1 +# A thread trying to lock a MERGE table performed busy waiting while +# REPAIR TABLE or a similar table administration task was ongoing on one or +# more of its MyISAM tables. +# To allow for observability it was necessary to enter a multi-second sleep +# in mysql_admin_table() after remove_table_from_cache(), which comes after +# mysql_abort_lock(). The sleep faked a long running operation. One could +# watch a high CPU load during the sleep time. +# The problem was that mysql_abort_lock() upgrades the write lock to +# TL_WRITE_ONLY. This lock type persisted until the final unlock at the end +# of the administration task. The effect of TL_WRITE_ONLY is to reject any +# attempt to lock the table. The trying thread must close the table and wait +# until it is no longer used. Unfortunately there is no way to detect that +# one of the MyISAM tables of a MERGE table is in use. When trying to lock +# the MERGE table, all MyISAM tables are locked. If one fails on +# TL_WRITE_ONLY, all locks are aborted and wait_for_tables() is entered. +# But this doesn't see the MERGE table as used, so it seems appropriate to +# retry a lock... +# +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1) INSERT_METHOD= LAST; +send REPAIR TABLE t1; + connection con1; + sleep 1; # let repair run into its sleep + INSERT INTO t2 VALUES (1); +connection default; +reap; +DROP TABLE t1, t2; +# +# Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table +# Problem #2 +# A thread trying to lock a MERGE table performed busy waiting until all +# threads that did REPAIR TABLE or similar table administration tasks on +# one or more of its MyISAM tables in LOCK TABLES segments did +# UNLOCK TABLES. +# The difference against problem #1 is that the busy waiting took place +# *after* the administration task. It was terminated by UNLOCK TABLES only. +# +# This is the same test case as for +# Bug#26867 - LOCK TABLES + REPAIR + merge table result in memory/cpu hogging +# +# +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1) INSERT_METHOD= LAST; +LOCK TABLE t1 WRITE; + connection con1; + send INSERT INTO t2 VALUES (1); +connection default; +sleep 1; # Let INSERT go into thr_multi_lock(). +REPAIR TABLE t1; +sleep 2; # con1 performs busy waiting during this sleep. +UNLOCK TABLES; + connection con1; + reap; +connection default; +DROP TABLE t1, t2; +# +# Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table +# Problem #3 +# Two FLUSH TABLES within a LOCK TABLES segment could invalidate the lock. +# This did *not* require a MERGE table. +# To increase reproducibility it was necessary to enter a sleep of 2 seconds +# at the end of wait_for_tables() after unlock of LOCK_open. In 5.0 and 5.1 +# the sleep must be inserted in open_and_lock_tables() after open_tables() +# instead. wait_for_tables() is not used in this case. +# The problem was that FLUSH TABLES releases LOCK_open while having unlocked +# and closed all tables. When this happened while a thread was in the loop in +# mysql_lock_tables() right after wait_for_tables() and before retrying to +# lock, the thread got the lock. (Translate to similar code places in 5.0 +# and 5.1). And it did not notice that the table needed a refresh. So it +# executed its statement on the table. +# The first FLUSH TABLES kicked the INSERT out of thr_multi_lock() and let +# it wait in wait_for_tables(). (open_table() in 5.0 and 5.1). The second +# FLUSH TABLES must happen while the INSERT was on its way from +# wait_for_tables() to the next call of thr_multi_lock(). This needed to be +# supported by a sleep to make it repeatable. +# +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +LOCK TABLE t1 WRITE; + connection con1; + send INSERT INTO t1 VALUES (1); +connection default; +sleep 1; # Let INSERT go into thr_multi_lock(). +FLUSH TABLES; +sleep 1; # Let INSERT go through wait_for_tables() where it sleeps. +FLUSH TABLES; +# This should give no result. But it will with sleep(2) at the right place. +SELECT * FROM t1; +UNLOCK TABLES; + connection con1; + reap; +connection default; +DROP TABLE t1; +# +# Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table +# Cleanup +disconnect con1; +disconnect con2; +# +--echo # +--echo # Extra tests for Bug#26379 - Combination of FLUSH TABLE and +--echo # REPAIR TABLE corrupts a MERGE table +# +--echo # +--echo # CREATE ... SELECT is disabled for MERGE tables. +--echo # +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=LAST; +--error ER_OPEN_AS_READONLY +CREATE TABLE t3 ENGINE=MRG_MYISAM INSERT_METHOD=LAST SELECT * FROM t2; +--error ER_NO_SUCH_TABLE +SHOW CREATE TABLE t3; +--error ER_WRONG_OBJECT +CREATE TABLE t3 ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=LAST + SELECT * FROM t2; +--error ER_NO_SUCH_TABLE +SHOW CREATE TABLE t3; +DROP TABLE t1, t2; +# +--echo # +--echo # CREATE ... LIKE +--echo # +--echo # 1. Create like. +CREATE TABLE t1 (c1 INT); +CREATE TABLE t2 (c1 INT); +CREATE TABLE t3 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) + INSERT_METHOD=LAST; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +CREATE TABLE t4 LIKE t3; +SHOW CREATE TABLE t4; +--error ER_OPEN_AS_READONLY +INSERT INTO t4 VALUES (4); +DROP TABLE t4; +--echo # +--echo # 1. Create like with locked tables. +LOCK TABLES t3 WRITE, t2 WRITE, t1 WRITE; +CREATE TABLE t4 LIKE t3; +--error ER_TABLE_NOT_LOCKED +SHOW CREATE TABLE t4; +--error ER_TABLE_NOT_LOCKED +INSERT INTO t4 VALUES (4); +UNLOCK TABLES; +SHOW CREATE TABLE t4; +--error ER_OPEN_AS_READONLY +INSERT INTO t4 VALUES (4); +DROP TABLE t4; +# +--echo # +--echo # Rename child. +--echo # +--echo # 1. Normal rename of non-MERGE table. +CREATE TABLE t4 (c1 INT); +INSERT INTO t4 VALUES (4); +SELECT * FROM t4 ORDER BY c1; +RENAME TABLE t4 TO t5; +SELECT * FROM t5 ORDER BY c1; +RENAME TABLE t5 TO t4; +SELECT * FROM t4 ORDER BY c1; +DROP TABLE t4; +--echo # +--echo # 2. Normal rename. +SELECT * FROM t3 ORDER BY c1; +RENAME TABLE t2 TO t5; +--error ER_NO_SUCH_TABLE +SELECT * FROM t3 ORDER BY c1; +RENAME TABLE t5 TO t2; +SELECT * FROM t3 ORDER BY c1; +--echo # +--echo # 3. Normal rename with locked tables. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +SELECT * FROM t3 ORDER BY c1; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +RENAME TABLE t2 TO t5; +SELECT * FROM t3 ORDER BY c1; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +RENAME TABLE t5 TO t2; +SELECT * FROM t3 ORDER BY c1; +UNLOCK TABLES; +--echo # +--echo # 4. Alter table rename. +ALTER TABLE t2 RENAME TO t5; +--error ER_NO_SUCH_TABLE +SELECT * FROM t3 ORDER BY c1; +ALTER TABLE t5 RENAME TO t2; +SELECT * FROM t3 ORDER BY c1; +--echo # +--echo # 5. Alter table rename with locked tables. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +ALTER TABLE t2 RENAME TO t5; +--error ER_TABLE_NOT_LOCKED +SELECT * FROM t3 ORDER BY c1; +--error ER_TABLE_NOT_LOCKED +ALTER TABLE t5 RENAME TO t2; +UNLOCK TABLES; +ALTER TABLE t5 RENAME TO t2; +SELECT * FROM t3 ORDER BY c1; +# +--echo # +--echo # Rename parent. +--echo # +--echo # 1. Normal rename with locked tables. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +SELECT * FROM t3 ORDER BY c1; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +RENAME TABLE t3 TO t5; +SELECT * FROM t3 ORDER BY c1; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +RENAME TABLE t5 TO t3; +SELECT * FROM t3 ORDER BY c1; +--echo # +--echo # 5. Alter table rename with locked tables. +ALTER TABLE t3 RENAME TO t5; +--error ER_TABLE_NOT_LOCKED +SELECT * FROM t5 ORDER BY c1; +--error ER_TABLE_NOT_LOCKED +ALTER TABLE t5 RENAME TO t3; +UNLOCK TABLES; +ALTER TABLE t5 RENAME TO t3; +SELECT * FROM t3 ORDER BY c1; +DROP TABLE t1, t2, t3; +# +--echo # +--echo # Drop locked tables. +--echo # +--echo # 1. Drop parent. +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1) + INSERT_METHOD=LAST; +LOCK TABLES t1 WRITE, t2 WRITE; +INSERT INTO t1 VALUES (1); +DROP TABLE t2; +--error ER_TABLE_NOT_LOCKED +SELECT * FROM t2; +SELECT * FROM t1; +UNLOCK TABLES; +--echo # 2. Drop child. +CREATE TABLE t2 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1) + INSERT_METHOD=LAST; +LOCK TABLES t1 WRITE, t2 WRITE; +INSERT INTO t1 VALUES (1); +DROP TABLE t1; +--error ER_NO_SUCH_TABLE +SELECT * FROM t2; +--error ER_NO_SUCH_TABLE +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t2; +# +--echo # +--echo # ALTER TABLE. Change child list. +--echo # +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)); +CREATE TABLE t3 (c1 INT, INDEX(c1)); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +CREATE TABLE t4 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t3,t2) + INSERT_METHOD=LAST; +--echo # Shrink child list. +ALTER TABLE t4 UNION=(t3); +SHOW CREATE TABLE t4; +SELECT * FROM t4 ORDER BY c1; +--echo # Extend child list. +ALTER TABLE t4 UNION=(t3,t2); +SHOW CREATE TABLE t4; +SELECT * FROM t4 ORDER BY c1; +# +--echo # +--echo # ALTER TABLE under LOCK TABLES. Change child list. +--echo # +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE; +--echo # Shrink child list. +--error ER_LOCK_OR_ACTIVE_TRANSACTION +ALTER TABLE t4 UNION=(t3); +--echo # Extend child list within locked tables. +--error ER_LOCK_OR_ACTIVE_TRANSACTION +ALTER TABLE t4 UNION=(t3,t2); +--echo # Extend child list beyond locked tables. +--error ER_LOCK_OR_ACTIVE_TRANSACTION +ALTER TABLE t4 UNION=(t3,t2,t1); +SHOW CREATE TABLE t4; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +DROP TABLE t4; +# +--echo # +--echo # ALTER TABLE under LOCK TABLES. Grave change, table re-creation. +--echo # +CREATE TABLE t4 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1,t2,t3) + INSERT_METHOD=LAST; +--echo # Lock parent first and then children. +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE, t1 WRITE; +ALTER TABLE t4 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +ALTER TABLE t2 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +--echo # Lock children first and then parent. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE; +ALTER TABLE t4 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +ALTER TABLE t2 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +--echo # Lock parent between children. +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +ALTER TABLE t4 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +ALTER TABLE t2 DROP INDEX c1, ADD UNIQUE INDEX (c1); +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +DROP TABLE t1, t2, t3, t4; +# +--echo # +--echo # ALTER TABLE under LOCK TABLES. Simple change, no re-creation. +--echo # +CREATE TABLE t1 (c1 INT); +CREATE TABLE t2 (c1 INT); +CREATE TABLE t3 (c1 INT); +CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2,t3) + INSERT_METHOD=LAST; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +--echo # Lock parent first and then children. +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE, t1 WRITE; +ALTER TABLE t4 ALTER COLUMN c1 SET DEFAULT 44; +SELECT * FROM t4 ORDER BY c1; +ALTER TABLE t2 ALTER COLUMN c1 SET DEFAULT 22; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +--echo # Lock children first and then parent. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE; +ALTER TABLE t4 ALTER COLUMN c1 SET DEFAULT 44; +SELECT * FROM t4 ORDER BY c1; +ALTER TABLE t2 ALTER COLUMN c1 SET DEFAULT 22; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +--echo # Lock parent between children. +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +ALTER TABLE t4 ALTER COLUMN c1 SET DEFAULT 44; +SELECT * FROM t4 ORDER BY c1; +ALTER TABLE t2 ALTER COLUMN c1 SET DEFAULT 22; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +# +--echo # +--echo # FLUSH TABLE under LOCK TABLES. +--echo # +--echo # Lock parent first and then children. +LOCK TABLES t4 WRITE, t3 WRITE, t2 WRITE, t1 WRITE; +FLUSH TABLE t4; +SELECT * FROM t4 ORDER BY c1; +FLUSH TABLE t2; +SELECT * FROM t4 ORDER BY c1; +FLUSH TABLES; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +--echo # Lock children first and then parent. +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE; +FLUSH TABLE t4; +SELECT * FROM t4 ORDER BY c1; +FLUSH TABLE t2; +SELECT * FROM t4 ORDER BY c1; +FLUSH TABLES; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +--echo # Lock parent between children. +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +FLUSH TABLE t4; +SELECT * FROM t4 ORDER BY c1; +FLUSH TABLE t2; +SELECT * FROM t4 ORDER BY c1; +FLUSH TABLES; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +# +--echo # +--echo # Triggers +--echo # +--echo # Trigger on parent +DELETE FROM t4 WHERE c1 = 4; +CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +SELECT * FROM t4 ORDER BY c1; +DROP TRIGGER t4_ai; +--echo # Trigger on parent under LOCK TABLES +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +SELECT * FROM t4 ORDER BY c1; +DROP TRIGGER t4_ai; +UNLOCK TABLES; +--echo # +--echo # Trigger on child +DELETE FROM t4 WHERE c1 = 4; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +INSERT INTO t3 VALUES (33); +SELECT @a; +SELECT * FROM t4 ORDER BY c1; +DROP TRIGGER t3_ai; +--echo # Trigger on child under LOCK TABLES +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1; +SET @a=0; +INSERT INTO t4 VALUES (4); +SELECT @a; +INSERT INTO t3 VALUES (33); +SELECT @a; +SELECT * FROM t4 ORDER BY c1; +DELETE FROM t4 WHERE c1 = 33; +DROP TRIGGER t3_ai; +--echo # +--echo # Trigger with table use on child +DELETE FROM t4 WHERE c1 = 4; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22); +INSERT INTO t4 VALUES (4); +SELECT * FROM t4 ORDER BY c1; +INSERT INTO t3 VALUES (33); +SELECT * FROM t4 ORDER BY c1; +DELETE FROM t4 WHERE c1 = 22; +DELETE FROM t4 WHERE c1 = 33; +DROP TRIGGER t3_ai; +--echo # Trigger with table use on child under LOCK TABLES +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22); +INSERT INTO t4 VALUES (4); +SELECT * FROM t4 ORDER BY c1; +INSERT INTO t3 VALUES (33); +SELECT * FROM t4 ORDER BY c1; +DROP TRIGGER t3_ai; +DELETE FROM t4 WHERE c1 = 22; +DELETE FROM t4 WHERE c1 = 33; +UNLOCK TABLES; +# +--echo # +--echo # Repair +--echo # +REPAIR TABLE t4; +REPAIR TABLE t2; +SELECT * FROM t4 ORDER BY c1; +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +REPAIR TABLE t4; +REPAIR TABLE t2; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +# +--echo # +--echo # Optimize +--echo # +OPTIMIZE TABLE t4; +OPTIMIZE TABLE t2; +SELECT * FROM t4 ORDER BY c1; +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +OPTIMIZE TABLE t4; +OPTIMIZE TABLE t2; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +# +--echo # +--echo # Checksum +--echo # +CHECKSUM TABLE t4; +CHECKSUM TABLE t2; +SELECT * FROM t4 ORDER BY c1; +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +CHECKSUM TABLE t4; +CHECKSUM TABLE t2; +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +# +--echo # +--echo # Insert delayed +--echo # +# See also Bug#26464 - insert delayed + update + merge = corruption +# Succeeds in embedded server - is converted to normal insert +# Fails in normal server, ps-protocol - not supported by engine +# Fails in normal server, normal protocol - not a base table +--error 0, ER_ILLEGAL_HA, ER_WRONG_OBJECT +INSERT DELAYED INTO t4 VALUES(44); +# Get rid of row in embedded server +DELETE FROM t4 WHERE c1 = 44; +INSERT DELAYED INTO t3 VALUES(33); + let $wait_cmd= SHOW STATUS LIKE 'Not_flushed_delayed_rows'; + let $run= query_get_value($wait_cmd, Value, 1); + while ($run) + { + let $run= query_get_value($wait_cmd, Value, 1); + } +SELECT * FROM t4 ORDER BY c1; +LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE; +--error ER_DELAYED_INSERT_TABLE_LOCKED, ER_ILLEGAL_HA +INSERT DELAYED INTO t4 VALUES(444); +--error ER_DELAYED_INSERT_TABLE_LOCKED, ER_ILLEGAL_HA +INSERT DELAYED INTO t3 VALUES(333); +SELECT * FROM t4 ORDER BY c1; +UNLOCK TABLES; +DROP TABLE t1, t2, t3, t4; +# +--echo # +--echo # Recursive inclusion of merge tables in their union clauses. +--echo # +CREATE TABLE t1 (c1 INT, INDEX(c1)); +CREATE TABLE t2 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t1) + INSERT_METHOD=LAST; +CREATE TABLE t3 (c1 INT, INDEX(c1)) ENGINE=MRG_MYISAM UNION=(t2,t1) + INSERT_METHOD=LAST; +ALTER TABLE t2 UNION=(t3,t1); +--error ER_ADMIN_WRONG_MRG_TABLE +SELECT * FROM t2; +DROP TABLE t1, t2, t3; + + +# +# Bug#25038 - Waiting TRUNCATE +# +# Show that truncate of child table after use of parent table works. +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t3 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1, t2); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t3; +TRUNCATE TABLE t1; +SELECT * FROM t3; +DROP TABLE t1, t2, t3; +# +# Show that truncate of child table waits while parent table is used. +# (test partly borrowed from count_distinct3.) +CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER); +SET @rnd_max= 2147483647; +let $1 = 10; +while ($1) +{ + SET @rnd= RAND(); + SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); + SET @id_rev= @rnd_max - @id; + SET @grp= CAST(127.0 * @rnd AS UNSIGNED); + INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); + dec $1; +} +set @@read_buffer_size=2*1024*1024; +CREATE TABLE t2 SELECT * FROM t1; +INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2; +INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1; +INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2; +INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1; +INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2; +CREATE TABLE t3 (id INTEGER, grp TINYINT, id_rev INTEGER) + ENGINE= MRG_MYISAM UNION= (t1, t2); +SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM t2; +SELECT COUNT(*) FROM t3; +connect (con1,localhost,root,,); + # As t3 contains random numbers, results are different from test to test. + # That's okay, because we test only that select doesn't yield an + # error. Note, that --disable_result_log doesn't suppress error output. + --disable_result_log + send SELECT COUNT(DISTINCT a1.id) FROM t3 AS a1, t3 AS a2 + WHERE a1.id = a2.id GROUP BY a2.grp; +connection default; +sleep 1; +TRUNCATE TABLE t1; + connection con1; + reap; + --enable_result_log + disconnect con1; +connection default; +SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM t2; +SELECT COUNT(*) FROM t3; +DROP TABLE t1, t2, t3; + +# +# Bug#25700 - merge base tables get corrupted by optimize/analyze/repair table +# +# Using FLUSH TABLES before REPAIR. +CREATE TABLE t1 (c1 INT) ENGINE=MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=LAST; +INSERT INTO t2 VALUES (1); +SELECT * FROM t2; +LOCK TABLES t2 WRITE, t1 WRITE; +FLUSH TABLES; +REPAIR TABLE t1; +CHECK TABLE t1; +REPAIR TABLE t1; +UNLOCK TABLES; +CHECK TABLE t1 EXTENDED; +# +# Not using FLUSH TABLES before REPAIR. +LOCK TABLES t2 WRITE, t1 WRITE; +REPAIR TABLE t1; +CHECK TABLE t1; +REPAIR TABLE t1; +UNLOCK TABLES; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1, t2; + +# +# Bug#26377 - Deadlock with MERGE and FLUSH TABLE +# +CREATE TABLE t1 ( a INT ) ENGINE=MyISAM; +CREATE TABLE m1 ( a INT ) ENGINE=MRG_MYISAM UNION=(t1); +# Lock t1 first. This did always work. +LOCK TABLES t1 WRITE, m1 WRITE; +FLUSH TABLE t1; +UNLOCK TABLES; +DROP TABLE m1, t1; +# +CREATE TABLE t1 ( a INT ) ENGINE=MyISAM; +CREATE TABLE m1 ( a INT ) ENGINE=MRG_MYISAM UNION=(t1); +# Lock m1 first. This did deadlock. +LOCK TABLES m1 WRITE, t1 WRITE; +FLUSH TABLE t1; +UNLOCK TABLES; +DROP TABLE m1, t1; + +# +# Bug#27660 - Falcon: merge table possible +# +# Normal MyISAM MERGE operation. +CREATE TABLE t1 (c1 INT, c2 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT, c2 INT) ENGINE= MyISAM; +CREATE TABLE t3 (c1 INT, c2 INT) ENGINE= MRG_MYISAM UNION(t1, t2); +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +SELECT * FROM t3; +# Try an unsupported engine. +ALTER TABLE t1 ENGINE= MEMORY; +INSERT INTO t1 VALUES (0, 0); +# Before fixing, this succeeded, but (0, 0) was missing. +--error 1168 +SELECT * FROM t3; +DROP TABLE t1, t2, t3; + +# +# Bug#30275 - Merge tables: flush tables or unlock tables causes server to crash +# +CREATE TABLE t1 (c1 INT, KEY(c1)); +CREATE TABLE t2 (c1 INT, KEY(c1)) ENGINE=MRG_MYISAM UNION=(t1) + INSERT_METHOD=FIRST; +LOCK TABLE t1 WRITE, t2 WRITE; +FLUSH TABLES t2, t1; +OPTIMIZE TABLE t1; +FLUSH TABLES t1; +UNLOCK TABLES; +# +FLUSH TABLES; +INSERT INTO t1 VALUES (1); +LOCK TABLE t1 WRITE, t2 WRITE; +FLUSH TABLES t2, t1; +OPTIMIZE TABLE t1; +FLUSH TABLES t1; +UNLOCK TABLES; +DROP TABLE t1, t2; + +# +# Test derived from test program for +# Bug#30273 - merge tables: Can't lock file (errno: 155) +# +CREATE TABLE t1 (ID INT) ENGINE=MYISAM; +CREATE TABLE m1 (ID INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST; +INSERT INTO t1 VALUES (); +INSERT INTO m1 VALUES (); +LOCK TABLE t1 WRITE, m1 WRITE; +FLUSH TABLES m1, t1; +OPTIMIZE TABLE t1; +FLUSH TABLES m1, t1; +UNLOCK TABLES; +DROP TABLE t1, m1; + diff --git a/mysql-test/t/merge_innodb.test b/mysql-test/t/merge_innodb.test new file mode 100644 index 00000000000..7f0b1a0c36e --- /dev/null +++ b/mysql-test/t/merge_innodb.test @@ -0,0 +1,41 @@ +# t/merge_innodb.test +# +# Tests with MERGE tables over InnoDB tables +# + +--source include/have_innodb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, t3, t4, t5; +--enable_warnings + +# +# Bug#30491 - MERGE doesn't report error when one table is Innodb +# +CREATE TABLE t1 (c1 varchar(100)) ENGINE=MyISAM; +CREATE TABLE t2 (c1 varchar(100)) ENGINE=MyISAM; +CREATE TABLE t3 (c1 varchar(100)) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('Ann'), ('Alice'); +INSERT INTO t2 VALUES ('Bob'), ('Brian'); +INSERT INTO t3 VALUES ('Chris'), ('Charlie'); +CREATE TABLE t4 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t2) + INSERT_METHOD=LAST; +CREATE TABLE t5 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t3) + INSERT_METHOD=LAST; +--error ER_WRONG_MRG_TABLE +SELECT * FROM t5; +SELECT * FROM t4; +ALTER TABLE t2 ENGINE=InnoDB; +--error ER_WRONG_MRG_TABLE +SELECT * FROM t4; +DELETE FROM t2 LIMIT 1; +--error ER_WRONG_MRG_TABLE +SELECT * FROM t4; +--error ER_WRONG_MRG_TABLE +INSERT INTO t4 VALUES ('Beware'); +--error ER_WRONG_MRG_TABLE +SELECT * FROM t4; +SELECT * FROM t2; +SELECT * FROM t1; +DROP TABLE t1, t2, t3, t4, t5; + diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 6f5ac70a34b..331663dceb5 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -588,6 +588,7 @@ CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; # as the test is about to see erroed queries in binlog +set @sav_binlog_format= @@session.binlog_format; set @@session.binlog_format= mixed; @@ -614,5 +615,42 @@ show master status /* there must be the UPDATE query event */; # cleanup bug#27716 drop table t1, t2; +set @@session.binlog_format= @sav_binlog_format; + +# +# Bug #29136 erred multi-delete on trans table does not rollback +# + +# prepare +--disable_warnings +drop table if exists t1, t2, t3; +--enable_warnings +CREATE TABLE t1 (a int, PRIMARY KEY (a)); +CREATE TABLE t2 (a int, PRIMARY KEY (a)); +CREATE TABLE t3 (a int, PRIMARY KEY (a)) ENGINE=MyISAM; +create trigger trg_del_t3 before delete on t3 for each row insert into t1 values (1); + +insert into t2 values (1),(2); +insert into t3 values (1),(2); +reset master; + +# exec cases B, A - see innodb.test + +# B. send_eof() and send_error() afterward + +--error ER_DUP_ENTRY +delete t3.* from t2,t3 where t2.a=t3.a; + +# check +select count(*) from t1 /* must be 1 */; +select count(*) from t3 /* must be 1 */; + +# cleanup bug#29136 +drop table t1, t2, t3; + +# +# Add further tests from here +# + --echo end of tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 34db38d4a38..fbd0a5ac4e7 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -576,32 +576,6 @@ select count(*) from t1 where a is null; drop table t1; # -# Bug #8306: TRUNCATE leads to index corruption -# -create table t1 (c1 int, index(c1)); -create table t2 (c1 int, index(c1)) engine=merge union=(t1); -insert into t1 values (1); -# Close all tables. -flush tables; -# Open t2 and (implicitly) t1. -select * from t2; -# Truncate after flush works (unless another threads reopens t2 in between). -flush tables; -truncate table t1; -insert into t1 values (1); -# Close all tables. -flush tables; -# Open t2 and (implicitly) t1. -select * from t2; -# Truncate t1, wich was not recognized as open without the bugfix. -# Now, it should fail with a table-in-use error message. ---error 1105 -truncate table t1; -# The insert used to fail on the crashed table. -insert into t1 values (1); -drop table t1,t2; - -# # bug9188 - Corruption Can't open file: 'table.MYI' (errno: 145) # create table t1 (c1 int, c2 varchar(4) not null default '', @@ -1170,6 +1144,12 @@ SHOW TABLE STATUS LIKE 't1'; #--exec ls -log var/master-data/test/t1.MYI #--exec myisamchk -dvv var/master-data/test/t1.MYI #--exec myisamchk -iev var/master-data/test/t1.MYI +--echo # Enable keys with parallel repair +SET @@myisam_repair_threads=2; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +SET @@myisam_repair_threads=1; +CHECK TABLE t1 EXTENDED; DROP TABLE t1; # diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test new file mode 100644 index 00000000000..6598af6318a --- /dev/null +++ b/mysql-test/t/myisampack.test @@ -0,0 +1,33 @@ +# +# BUG#31277 - myisamchk --unpack corrupts a table +# +CREATE TABLE t1(c1 DOUBLE, c2 DOUBLE, c3 DOUBLE, c4 DOUBLE, c5 DOUBLE, + c6 DOUBLE, c7 DOUBLE, c8 DOUBLE, c9 DOUBLE, a INT PRIMARY KEY); +INSERT INTO t1 VALUES +(-3.31168791059336e-06,-3.19054655887874e-06,-1.06528081684847e-05,-1.227278240089e-06,-1.66718069164799e-06,-2.59038972510885e-06,-2.83145227805303e-06,-4.09678491270648e-07,-2.22610091291797e-06,6), +(0.0030743000272545,2.53222044316438e-05,2.78674650061845e-05,1.95914465544536e-05,1.7347572525984e-05,1.87513810069614e-05,1.69882826885005e-05,2.44449336987598e-05,1.89914629921774e-05,9), +(2.85229319423495e-05,3.05970988282259e-05,3.77161100113133e-05,2.3055238978766e-05,2.08241267364615e-05,2.28009504270553e-05,2.12070165658947e-05,2.84350091565409e-05,2.3366822910704e-05,3), +(0,0,0,0,0,0,0,0,0,12), +(3.24544577570754e-05,3.44619021870993e-05,4.37561613201124e-05,2.57556808726748e-05,2.3195354640561e-05,2.58532400758869e-05,2.34934241667179e-05,3.1621640063232e-05,2.58229982746189e-05,19), +(2.53222044316438e-05,0.00445071933455582,2.97447268116016e-05,2.12379514059868e-05,1.86777776502663e-05,2.0170058676712e-05,1.8946030385445e-05,2.66040037173511e-05,2.09161899668946e-05,20), +(3.03462382611645e-05,3.26517930083994e-05,3.5242025468662e-05,2.53219745106391e-05,2.24384532945004e-05,2.4052346047657e-05,2.23865572957053e-05,3.1634313969082e-05,2.48285463481801e-05,21), +(1.95914465544536e-05,2.12379514059868e-05,2.27808649037128e-05,0.000341724375366877,1.4512761275113e-05,1.56475828693953e-05,1.44372366441415e-05,2.07952121981765e-05,1.61488256935919e-05,28), +(1.7347572525984e-05,1.86777776502663e-05,2.04116907052727e-05,1.4512761275113e-05,0.000432162526082388,1.38116514014465e-05,1.2712914948904e-05,1.82503165178506e-05,1.43043075345922e-05,30), +(1.68339762136661e-05,1.77836497166611e-05,2.36328309295222e-05,1.30183423732016e-05,1.18674654241553e-05,1.32467273128652e-05,1.24581739117775e-05,1.55624190959406e-05,1.33010638508213e-05,31), +(1.89643062824415e-05,2.06997140070717e-05,2.29045490159364e-05,1.57918175731019e-05,1.39864987449492e-05,1.50580274578455e-05,1.45908734129609e-05,1.95329296993327e-05,1.5814709481221e-05,32), +(1.69882826885005e-05,1.8946030385445e-05,2.00820439721439e-05,1.44372366441415e-05,1.2712914948904e-05,1.35209686474184e-05,0.00261563314789896,1.78285095864627e-05,1.46699314500019e-05,34), +(2.0278186540684e-05,2.18923409729654e-05,2.39981539939738e-05,1.71774589459438e-05,1.54654355357383e-05,1.62731485707636e-05,1.49253140625051e-05,2.18229800160297e-05,1.71923561673718e-05,35), +(2.44449336987598e-05,2.66040037173511e-05,2.84860148925308e-05,2.07952121981765e-05,1.82503165178506e-05,1.97667730441441e-05,1.78285095864627e-05,0.00166478601822712,2.0299952103232e-05,36), +(1.89914629921774e-05,2.09161899668946e-05,2.26026841007872e-05,1.61488256935919e-05,1.43043075345922e-05,1.52609063290127e-05,1.46699314500019e-05,2.0299952103232e-05,0.00306670170971682,39), +(0,0,0,0,0,0,0,0,0,41), +(0,0,0,0,0,0,0,0,0,17), +(0,0,0,0,0,0,0,0,0,18), +(2.51880677333017e-05,2.63051795435778e-05,2.79874748974906e-05,2.02888886670845e-05,1.8178636318197e-05,1.91308527003585e-05,1.83260023644133e-05,2.4422300558171e-05,1.96411467520551e-05,44), +(2.22402118719591e-05,2.37546284320705e-05,2.58463051055541e-05,1.83391609130854e-05,1.6300720519646e-05,1.74559091886791e-05,1.63733785575587e-05,2.26616253279828e-05,1.79541237435621e-05,45), +(3.01092775359837e-05,3.23865212934412e-05,4.09444584045994e-05,0,2.15470966302776e-05,2.39082636344032e-05,2.28296706429177e-05,2.9007671511595e-05,2.44201138973326e-05,46); +FLUSH TABLES; +--exec $MYISAMPACK -s $MYSQLTEST_VARDIR/master-data/test/t1 +--exec $MYISAMCHK -srq $MYSQLTEST_VARDIR/master-data/test/t1 +--exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1 +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 3ee04f32640..528337da77b 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -282,6 +282,15 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql; # --exec $MYSQL test -e "/*! \C latin1 */ select 1;" +# +# Bug#29323 mysql client only accetps ANSI encoded files +# +--write_file $MYSQLTEST_VARDIR/tmp/bug29323.sql +select "This is a file starting with UTF8 BOM 0xEFBBBF"; +EOF +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql; + --echo End of 5.0 tests # @@ -290,3 +299,21 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql; --disable_query_log --exec $MYSQL --server-arg=no-defaults test -e "quit" --enable_query_log + +# +# Bug #25146: Some warnings/errors not shown when using --show-warnings +# + +# This one should succeed with no warnings +--exec $MYSQL --show-warnings test -e "create table t1 (id int)" + +# This should succeed, with warnings about conversion from nonexistent engine +--exec $MYSQL --show-warnings test -e "create table t2 (id int) engine=nonexistent" + +# This should fail, with warnings as well +--error 1 +--exec $MYSQL --show-warnings test -e "create table t2 (id int) engine=nonexistent2" + +drop tables t1, t2; + +--echo End of tests diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index edaf07a64db..1afc105e34e 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -240,6 +240,10 @@ let $c= `select $a=$b`; --echo $c drop table t1; +echo shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql; +error 1; +exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql; + --echo End of 5.0 tests # diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index d233546f9e3..6a7f44b4dbe 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -11,7 +11,7 @@ # --disable_warnings -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, `t``1`, `t 1`; drop view if exists v1; drop database if exists client_test_db; --enable_warnings @@ -37,4 +37,26 @@ create view v1 as select * from t1; drop view v1; drop table t1; +# +# Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks +# +create table `t``1`(a int); +create table `t 1`(a int); +--replace_result 'Table is already up to date' OK +--exec $MYSQL_CHECK --databases test +drop table `t``1`, `t 1`; + --echo End of 5.0 tests + +# +# Bug #30679: 5.1 name encoding not performed for views during upgrade +# +create table t1(a int); +create view v1 as select * from t1; +show tables; +--copy_file $MYSQLTEST_VARDIR/master-data/test/v1.frm $MYSQLTEST_VARDIR/master-data/test/v-1.frm +show tables; +--exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test +show tables; +drop view v1, `v-1`; +drop table t1; diff --git a/mysql-test/t/no-threads.test b/mysql-test/t/no-threads.test index 806cf24e961..31ea6406ee9 100644 --- a/mysql-test/t/no-threads.test +++ b/mysql-test/t/no-threads.test @@ -3,3 +3,4 @@ # select 1+1; select 1+2; +SHOW GLOBAL VARIABLES LIKE 'thread_handling'; diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 1ac99d9c39f..d1e40024733 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -367,3 +367,12 @@ select count(a) from t1 group by null with rollup; drop table t1; --echo ############################################################## +# +# Bug #32558: group by null-returning expression with rollup causes crash +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(0); +SELECT 1 FROM t1 GROUP BY (DATE(NULL)) WITH ROLLUP; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test index 79c9129bb74..9170308a4f2 100644 --- a/mysql-test/t/parser.test +++ b/mysql-test/t/parser.test @@ -629,3 +629,31 @@ select atan(10, 20 "p2"); -- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT select atan(10 AS p1, 20 AS p2); +# +# Bug#22312 Syntax error in expression with INTERVAL() +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE; +SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND; +SELECT 1 + INTERVAL(1,0,1,2) + 1; +SELECT INTERVAL(1^1,0,1,2) + 1; +SELECT INTERVAL(1,0+1,2,3) * 5.5; +SELECT INTERVAL(3,3,1+3,4+4) / 0.5; +SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2; +SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2); +SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3); + +--disable_warnings +SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND; +SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND; +--enable_warnings + +CREATE TABLE t1 (a INT, b DATETIME); +INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND); +SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1; +DROP TABLE t1; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index ab6cba529ad..23d6c5f8865 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -373,6 +373,16 @@ select * from t1 where a = 4; drop table t1; # +# Bug#22351 - handler::index_next_same() call to key_cmp_if_same() +# uses the wrong buffer +# +CREATE TABLE t1 (c1 INT, c2 INT, PRIMARY KEY USING BTREE (c1,c2)) ENGINE=MEMORY + PARTITION BY KEY(c2,c1) PARTITIONS 4; +INSERT INTO t1 VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6); +SELECT * FROM t1 WHERE c1 = 4; +DROP TABLE t1; + +# # Bug #13438: Engine clause in PARTITION clause causes crash # CREATE TABLE t1 (a int) @@ -1551,6 +1561,57 @@ insert ignore into t1 set c0 = 241221, c1 = -6862346, c2 = 56644; select c1 from t1 group by (select c0 from t1 limit 1); drop table t1; +# Bug #30495: optimize table t1,t2,t3 extended errors +# +CREATE TABLE t1(a int) +PARTITION BY RANGE (a) ( + PARTITION p1 VALUES LESS THAN (10), + PARTITION p2 VALUES LESS THAN (20) +); +--error 1064 +ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; +--error 1064 +ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; +DROP TABLE t1; + +# +# Bug #29258: Partitions: search fails for maximum unsigned bigint +# +CREATE TABLE t1 (s1 BIGINT UNSIGNED) + PARTITION BY RANGE (s1) ( + PARTITION p0 VALUES LESS THAN (0), + PARTITION p1 VALUES LESS THAN (1), + PARTITION p2 VALUES LESS THAN (18446744073709551615) +); +INSERT INTO t1 VALUES (0), (18446744073709551614); +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +INSERT INTO t1 VALUES (18446744073709551615); +DROP TABLE t1; + +CREATE TABLE t1 (s1 BIGINT UNSIGNED) + PARTITION BY RANGE (s1) ( + PARTITION p0 VALUES LESS THAN (0), + PARTITION p1 VALUES LESS THAN (1), + PARTITION p2 VALUES LESS THAN (18446744073709551614), + PARTITION p3 VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (-1), (0), (18446744073709551613), + (18446744073709551614), (18446744073709551615); +SELECT * FROM t1; +SELECT * FROM t1 WHERE s1 = 0; +SELECT * FROM t1 WHERE s1 = 18446744073709551614; +SELECT * FROM t1 WHERE s1 = 18446744073709551615; +DROP TABLE t1; + +CREATE TABLE t1 (s1 BIGINT UNSIGNED) + PARTITION BY RANGE (s1) ( + PARTITION p0 VALUES LESS THAN (0), + PARTITION p1 VALUES LESS THAN (1), + PARTITION p2 VALUES LESS THAN (18446744073709551615), + PARTITION p3 VALUES LESS THAN MAXVALUE +); +DROP TABLE t1; + # # Bug #31890 Partitions: ORDER BY DESC in InnoDB not working # diff --git a/mysql-test/t/partition_02myisam.test b/mysql-test/t/partition_02myisam.test deleted file mode 100644 index 107d0b89cea..00000000000 --- a/mysql-test/t/partition_02myisam.test +++ /dev/null @@ -1,25 +0,0 @@ -############################################### -# # -# Partition tests MyISAM tables # -# # -############################################### - -# -# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! -# NON STORAGE SPECIFIC TESTCASES SHOULD BE ADDED IN -# THE SOURCED FIELS ONLY. -# - -# Storage engine to be tested -let $engine= 'MYISAM'; -eval SET SESSION storage_engine=$engine; - - -# Other storage engine <> storage engine to be tested -let $engine_other= 'MEMORY'; -# number of rows for the INSERT/UPDATE/DELETE/SELECT experiments -# on partioned tables -# Attention: In the moment the result files fit to @max_row = 200 only -SET @max_row = 200; - --- source include/partition_1.inc diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test index 52caaa8c8e9..362d5f747e9 100644 --- a/mysql-test/t/partition_hash.test +++ b/mysql-test/t/partition_hash.test @@ -10,6 +10,22 @@ drop table if exists t1; --enable_warnings # +# Bug#30822: crash when COALESCE +# +CREATE TABLE t1 (c1 INT) + PARTITION BY HASH (c1) + PARTITIONS 15; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +ALTER TABLE t1 COALESCE PARTITION 13; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) + PARTITION BY LINEAR HASH (c1) + PARTITIONS 5; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +ALTER TABLE t1 COALESCE PARTITION 3; +DROP TABLE t1; + +# # More partition pruning tests, especially on interval walking # create table t1 (a int unsigned) diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 6b73d0b2c5e..58010f85ecf 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -1,6 +1,21 @@ --source include/have_partition.inc --source include/have_innodb.inc +# Bug#32948 - FKs allowed to reference partitioned table +# +-- echo # Bug#32948 +CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB; +CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1), + FOREIGN KEY (c1) REFERENCES t1 (c1) + ON DELETE CASCADE) +ENGINE=INNODB; +--error ER_ROW_IS_REFERENCED +ALTER TABLE t1 PARTITION BY HASH(c1) PARTITIONS 5; +--error ER_ROW_IS_REFERENCED +ALTER TABLE t1 ENGINE=MyISAM; +DROP TABLE t2; +DROP TABLE t1; + # # Bug #14673: Wrong InnoDB default row format # diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index fd7caeb195e..b45d67d8485 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1223,6 +1223,16 @@ EXECUTE st1; DEALLOCATE PREPARE st1; DROP TABLE t1; + +# +# Bug #32137: prepared statement crash with str_to_date in update clause +# +create table t1 (a int, b tinyint); +prepare st1 from 'update t1 set b= (str_to_date(a, a))'; +execute st1; +deallocate prepare st1; +drop table t1; + --echo End of 4.1 tests. ############################# 5.0 tests start ################################ diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test index 018366f705f..72a073ac541 100644 --- a/mysql-test/t/skip_grants.test +++ b/mysql-test/t/skip_grants.test @@ -122,7 +122,6 @@ select count(*) from information_schema.COLUMN_PRIVILEGES; select count(*) from information_schema.SCHEMA_PRIVILEGES; select count(*) from information_schema.TABLE_PRIVILEGES; select count(*) from information_schema.USER_PRIVILEGES; - # # Bug #32020: loading udfs while --skip-grant-tables is enabled causes out of # memory errors @@ -134,3 +133,12 @@ CREATE FUNCTION a RETURNS STRING SONAME ''; DROP FUNCTION a; --echo End of 5.0 tests + +--echo # +--echo # Bug#29817 Queries with UDF fail with non-descriptive error +--echo # if mysql.proc is missing +--echo # +--error ER_SP_DOES_NOT_EXIST +select no_such_function(1); + +--echo End of 5.1 tests diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index b5037b469ae..4a747b9c614 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -45,27 +45,9 @@ call bug4902_2()| call bug4902_2()| drop procedure bug4902_2| - -# Disable until bug#17244 is fixed ---disable_parsing # -# BUG#5278: Stored procedure packets out of order if SET PASSWORD. +# BUG#3583: query cache doesn't work for stored procedures # ---disable_warnings -drop function if exists bug5278| ---enable_warnings -create function bug5278 () returns char -begin - SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass'); - return 'okay'; -end| - ---error 1133 -select bug5278()| ---error 1133 -select bug5278()| -drop function bug5278| ---enable_parsing --disable_warnings drop table if exists t1| @@ -74,9 +56,6 @@ create table t1 ( id char(16) not null default '', data int not null )| -# -# BUG#3583: query cache doesn't work for stored procedures -# --disable_warnings drop procedure if exists bug3583| --enable_warnings diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 1cd5aa1726a..6a11791924a 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -21,6 +21,8 @@ select * from information_schema.session_status where variable_name like 'Table_ connection con1; # ++Immediate = 3 SET SQL_LOG_BIN=0; +set @old_general_log = @@global.general_log; +set global general_log = 'OFF'; --disable_warnings # ++Immediate = 4 drop table if exists t1; @@ -60,6 +62,7 @@ reap; # ++Immediate = 16 + $wait_condition_reps show status like 'Table_locks_waited'; drop table t1; +set global general_log = @old_general_log; disconnect con2; disconnect con1; diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 1c98a0f8d29..1aeac91e5ad 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -2250,11 +2250,58 @@ drop table table_25411_b; # Bug #31866: MySQL Server crashes on SHOW CREATE TRIGGER statement # ---disable-warnings +--disable_warnings DROP TRIGGER IF EXISTS trg; ---enable-warnings +--enable_warnings --error ER_TRG_DOES_NOT_EXIST SHOW CREATE TRIGGER trg; +# +# Bug#23713 LOCK TABLES + CREATE TRIGGER + FLUSH TABLES WITH READ LOCK = deadlock +# +# Test of trigger creation and removal under LOCK TABLES +# + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (i int, j int); + +create trigger t1_bi before insert on t1 for each row begin end; +--error ER_NOT_SUPPORTED_YET +create trigger t1_bi before insert on t1 for each row begin end; +drop trigger t1_bi; +--error ER_TRG_DOES_NOT_EXIST +drop trigger t1_bi; + +lock tables t1 read; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +create trigger t1_bi before insert on t1 for each row begin end; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +create trigger t1_bi before insert on t1 for each row begin end; +--error ER_TRG_DOES_NOT_EXIST +drop trigger t1_bi; +unlock tables; + +create trigger t1_bi before insert on t1 for each row begin end; +lock tables t1 read; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +create trigger t1_bi before insert on t1 for each row begin end; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +drop trigger t1_bi; +unlock tables; +drop trigger t1_bi; + +lock tables t1 write; +create trigger b1_bi before insert on t1 for each row set new.i = new.i + 10; +insert into t1 values (10, 10); +drop trigger b1_bi; +insert into t1 values (10, 10); +select * from t1; +unlock tables; + +drop table t1; + --echo End of 5.1 tests. diff --git a/mysql-test/t/trigger-grant.test b/mysql-test/t/trigger_notembedded.test index 8145212ed5b..748ae6e1c27 100644 --- a/mysql-test/t/trigger-grant.test +++ b/mysql-test/t/trigger_notembedded.test @@ -875,3 +875,37 @@ DROP DATABASE mysqltest_db1; USE test; --echo End of 5.0 tests. + +# +# Bug#23713 LOCK TABLES + CREATE TRIGGER + FLUSH TABLES WITH READ LOCK = deadlock +# + +# Test temporarily disable due to Bug#32395 +--disable_parsing +create table t1 (i int); +connect (flush,localhost,root,,test,,); +connection default; +--echo connection: default +lock tables t1 write; +connection flush; +--echo connection: flush +--send flush tables with read lock; +connection default; +--echo connection: default +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Flushing tables"; +--source include/wait_condition.inc +create trigger t1_bi before insert on t1 for each row begin end; +unlock tables; +connection flush; +--echo connection: flush +--reap +unlock tables; +connection default; +select * from t1; +drop table t1; +disconnect flush; +--enable_parsing + +--echo End of 5.1 tests. diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index a6961982a9e..d714229c217 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -214,3 +214,13 @@ SET SQL_MODE=DEFAULT; DROP TABLE t1,t2; --echo End of 5.0 tests + +# +# Bug#32021: Using Date 000-00-01 in WHERE causes wrong result +# +create table t1 (a date, primary key (a))engine=memory; +insert into t1 values ('0000-01-01'), ('0000-00-01'), ('0001-01-01'); +select * from t1 where a between '0000-00-01' and '0000-00-02'; +drop table t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 7b2d2b46351..4fdd96b8729 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -155,13 +155,13 @@ set @@sql_mode='ansi,traditional'; insert into t1 values ('2007-03-23 13:49:38','2007-03-23 13:49:38'); insert into t1 set dt='2007-03-23 13:49:38',da=dt; # Test error handling ---error 1292 +--error ER_TRUNCATED_WRONG_VALUE insert into t1 values ('2007-03-32','2007-03-23 13:49:38'); select * from t1; drop table t1; ---error 1067 +--error ER_INVALID_DEFAULT create table t1 (da date default '1962-03-32 23:33:34', dt datetime default '1962-03-03'); ---error 1067 +--error ER_INVALID_DEFAULT create table t1 (t time default '916:00:00 a'); set @@sql_mode= @org_mode; @@ -169,6 +169,19 @@ set @@sql_mode= @org_mode; # # Bug#27590: Wrong DATE/DATETIME comparison. # +## The following sub test will fail (difference to expected result) if the +## select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1; +## runs exact at midnight ('00:00:00'). +## ( Bug#29290 type_datetime.test failure in 5.1 ) +## Therefore we sleep a bit if we are too close to midnight. +## The complete test itself needs around 1 second. +## Therefore a time_distance to midnight of 5 seconds should be sufficient. +if (`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`) +{ + # We are here when CURTIME() is between '23:59:56' and '23:59:59'. + # So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'. + --real_sleep 5 +} create table t1 (f1 date, f2 datetime, f3 timestamp); insert into t1(f1) values(curdate()); select curdate() < now(), f1 < now(), cast(f1 as date) < now() from t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index ed3abb12140..9aa8c00d24a 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -116,15 +116,10 @@ drop table if exists t1; # Check conversion of floats to character field (Bug #7774) create table t1 (c char(20)); insert into t1 values (5e-28); -# Expected result is "5e-28", but windows returns "5e-028" ---replace_result 5e-028 5e-28 select * from t1; drop table t1; create table t1 (c char(6)); insert into t1 values (2e5),(2e6),(2e-4),(2e-5); -# Expected result is "2e+06", but windows returns "2e+006" -# Expected result is "2e-05", but windows returns "2e-005" ---replace_result 2e+006 2e+06 2e-005 2e-05 select * from t1; drop table t1; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index b1776d09744..4b052a3d1fb 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1205,6 +1205,27 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b; DROP TABLE t1; +# +# Bug #24907: unpredictable (display) precission, if input precission +# increases +# + +# As per 10.1.1. Overview of Numeric Types, type (new) DECIMAL has a +# maxmimum precision of 30 places after the decimal point. Show that +# temp field creation beyond that works and throws a truncation warning. +# DECIMAL(37,36) should be adjusted to DECIMAL(31,30). +CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +DESC t1; +SELECT f1 FROM t1; +DROP TABLE t1; + +# too many decimal places, AND too many digits altogether (90 = 45+45). +# should preserve integers (65 = 45+20) +CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1; +DESC t1; +SELECT f1 FROM t1; +DROP TABLE t1; + --echo End of 5.0 tests # diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index ca02e0b5f2d..f2699ab03d3 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -245,3 +245,22 @@ create table t1 (f1 int); insert into t1 values (2), (1); select @i := f1 as j from t1 order by 1; drop table t1; +# Bug #32260: User variables in query cause server crash +# +create table t1(a int); +insert into t1 values(5),(4),(4),(3),(2),(2),(2),(1); +set @rownum := 0; +set @rank := 0; +set @prev_score := NULL; +# Disable the result log as we assign a value to a user variable in one part +# of a statement and use the same variable in other part of the same statement, +# so we can get unexpected results. +--disable_result_log +select @rownum := @rownum + 1 as row, + @rank := IF(@prev_score!=a, @rownum, @rank) as rank, + @prev_score := a as score +from t1 order by score desc; +--enable_result_log +drop table t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index e388aa61803..7f769c50449 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3475,4 +3475,55 @@ DROP VIEW `v-2`; DROP DATABASE `d-1`; USE test; +--echo +--echo # +--echo # Bug#26676: VIEW using old table schema in a session. +--echo # +--echo + +--disable_warnings +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1(c1 INT, c2 INT); +INSERT INTO t1 VALUES (1, 2), (3, 4); + +--echo + +SELECT * FROM t1; + +--echo + +CREATE VIEW v1 AS SELECT * FROM t1; + +--echo + +SELECT * FROM v1; + +--echo + +ALTER TABLE t1 ADD COLUMN c3 INT AFTER c2; + +--echo + +SELECT * FROM t1; + +--echo + +SELECT * FROM v1; + +--echo + +SHOW CREATE VIEW v1; + +--echo + +DROP VIEW v1; +DROP TABLE t1; + +--echo +--echo # End of test case for Bug#26676. +--echo + --echo End of 5.1 tests. diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 6c7d9af1b63..5ca9c7afd76 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -543,4 +543,12 @@ select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL), updatexml(NULL, 1, NULL); select updatexml(NULL, NULL, NULL); +# +# Bug #32557: order by updatexml causes assertion in filesort +# +CREATE TABLE t1(a INT NOT NULL); +INSERT INTO t1 VALUES (0), (0); +SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1')); +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 6b24165686a..60e75c96b75 100755 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -29,7 +29,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_ errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c - mf_radix.c mf_same.c mf_sort.c mf_soundex.c mf_strip.c mf_tempdir.c + mf_radix.c mf_same.c mf_sort.c mf_soundex.c mf_strip.c mf_arr_appstr.c mf_tempdir.c mf_tempfile.c mf_unixpath.c mf_wcomp.c mf_wfile.c mulalloc.c my_access.c my_aes.c my_alarm.c my_alloc.c my_append.c my_bit.c my_bitmap.c my_chsize.c my_clock.c my_compress.c my_conio.c my_copy.c my_crc32.c my_create.c my_delete.c diff --git a/mysys/Makefile.am b/mysys/Makefile.am index fca13ab52b8..f06d81da849 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -35,7 +35,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ my_error.c errors.c my_div.c my_messnc.c \ mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \ my_symlink.c my_symlink2.c \ - mf_pack.c mf_unixpath.c mf_strip.c \ + mf_pack.c mf_unixpath.c mf_strip.c mf_arr_appstr.c \ mf_wcomp.c mf_wfile.c my_gethwaddr.c \ mf_qsort.c mf_qsort2.c mf_sort.c \ ptr_cmp.c mf_radix.c queues.c my_getncpus.c \ diff --git a/mysys/default.c b/mysys/default.c index 3cc5b08e77c..2758029ec12 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -47,7 +47,7 @@ char *my_defaults_extra_file=0; /* Which directories are searched for options (and in which order) */ -#define MAX_DEFAULT_DIRS 7 +#define MAX_DEFAULT_DIRS 6 const char *default_directories[MAX_DEFAULT_DIRS + 1]; #ifdef __WIN__ @@ -83,7 +83,22 @@ static int search_default_file_with_ext(Process_option_func func, void *func_ctx, const char *dir, const char *ext, const char *config_file, int recursion_level); -static void init_default_directories(); + + + +/** + Create the list of default directories. + + @details + On all systems, if a directory is already in the list, it will be moved + to the end of the list. This avoids reading defaults files multiple times, + while ensuring the correct precedence. + + @return void +*/ + +static void (*init_default_directories)(); + static char *remove_end_comment(char *ptr); @@ -922,6 +937,34 @@ void print_defaults(const char *conf_file, const char **groups) #include <help_end.h> +/* + This extra complexity is to avoid declaring 'rc' if it won't be + used. +*/ +#define ADD_DIRECTORY_INTERNAL(DIR) \ + array_append_string_unique((DIR), default_directories, \ + array_elements(default_directories)) +#ifdef DBUG_OFF +# define ADD_DIRECTORY(DIR) (void) ADD_DIRECTORY_INTERNAL(DIR) +#else +#define ADD_DIRECTORY(DIR) \ + do { \ + my_bool rc= ADD_DIRECTORY_INTERNAL(DIR); \ + DBUG_ASSERT(rc == FALSE); /* Success */ \ + } while (0) +#endif + + +#define ADD_COMMON_DIRECTORIES() \ + do { \ + char *env; \ + if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) \ + ADD_DIRECTORY(env); \ + /* Placeholder for --defaults-extra-file=<path> */ \ + ADD_DIRECTORY(""); \ + } while (0) + + #ifdef __WIN__ /* This wrapper for GetSystemWindowsDirectory() will dynamically bind to the @@ -956,71 +999,33 @@ static size_t my_get_system_windows_directory(char *buffer, size_t size) } return count; } -#endif -/* - Create the list of default directories. +/** + Initialize default directories for Microsoft Windows - On Microsoft Windows, this is: - 1. C:/ + @details + 1. GetSystemWindowsDirectory() 2. GetWindowsDirectory() - 3. GetSystemWindowsDirectory() - 4. getenv(DEFAULT_HOME_ENV) - 5. Directory above where the executable is located - 6. "" - 7. --sysconfdir=<path> - - On Novell NetWare, this is: - 1. sys:/etc/ - 2. getenv(DEFAULT_HOME_ENV) - 3. "" - 4. --sysconfdir=<path> - - On OS/2, this is: - 1. getenv(ETC) - 2. /etc/ - 3. getenv(DEFAULT_HOME_ENV) - 4. "" - 5. "~/" - 6. --sysconfdir=<path> - - Everywhere else, this is: - 1. /etc/ - 2. /etc/mysql/ - 3. getenv(DEFAULT_HOME_ENV) - 4. "" - 5. "~/" - 6. --sysconfdir=<path> - - */ + 3. C:/ + 4. Directory above where the executable is located + 5. getenv(DEFAULT_HOME_ENV) + 6. --defaults-extra-file=<path> (run-time option) +*/ -static void init_default_directories() +static void init_default_directories_win() { - const char *env, **ptr= default_directories; + bzero((char *) default_directories, sizeof(default_directories)); -#ifdef __WIN__ - *ptr++= "C:/"; + if (my_get_system_windows_directory(shared_system_dir, + sizeof(shared_system_dir))) + ADD_DIRECTORY(shared_system_dir); if (GetWindowsDirectory(system_dir,sizeof(system_dir))) - *ptr++= (char*)&system_dir; - if (my_get_system_windows_directory(shared_system_dir, - sizeof(shared_system_dir)) && - strcmp(system_dir, shared_system_dir)) - *ptr++= (char *)&shared_system_dir; + ADD_DIRECTORY(system_dir); + + ADD_DIRECTORY("C:/"); -#elif defined(__NETWARE__) - *ptr++= "sys:/etc/"; -#else - *ptr++= "/etc/"; - *ptr++= "/etc/mysql/"; -#endif - if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) - *ptr++= env; - *ptr++= ""; /* Place for defaults_extra_file */ -#if !defined(__WIN__) && !defined(__NETWARE__) - *ptr++= "~/";; -#elif defined(__WIN__) if (GetModuleFileName(NULL, config_dir, sizeof(config_dir))) { char *last= NULL, *end= strend(config_dir); @@ -1050,12 +1055,61 @@ static void init_default_directories() last= end; } } - *ptr++= (char *)&config_dir; + ADD_DIRECTORY(config_dir); } -#endif + + ADD_COMMON_DIRECTORIES(); +} + +static void (*init_default_directories)()= init_default_directories_win; + +#elif defined(__NETWARE__) + +/** + Initialize default directories for Novell Netware + + @details + 1. sys:/etc/ + 2. getenv(DEFAULT_HOME_ENV) + 3. --defaults-extra-file=<path> (run-time option) +*/ + +static void init_default_directories_netware() +{ + bzero((char *) default_directories, sizeof(default_directories)); + ADD_DIRECTORY("sys:/etc/"); + ADD_COMMON_DIRECTORIES(); +} + +static void (*init_default_directories)()= init_default_directories_netware; + +#else + +/** + Initialize default directories for Unix + + @details + 1. /etc/ + 2. /etc/mysql/ + 3. --sysconfdir=<path> (compile-time option) + 4. getenv(DEFAULT_HOME_ENV) + 5. --defaults-extra-file=<path> (run-time option) + 6. "~/" +*/ + +static void init_default_directories_unix() +{ + bzero((char *) default_directories, sizeof(default_directories)); + ADD_DIRECTORY("/etc/"); + ADD_DIRECTORY("/etc/mysql/"); #ifdef DEFAULT_SYSCONFDIR if (DEFAULT_SYSCONFDIR != "") - *ptr++= DEFAULT_SYSCONFDIR; + ADD_DIRECTORY(DEFAULT_SYSCONFDIR); #endif - *ptr= 0; /* end marker */ + ADD_COMMON_DIRECTORIES(); + ADD_DIRECTORY("~/"); } + +static void (*init_default_directories)()= init_default_directories_unix; + +#endif diff --git a/mysys/mf_arr_appstr.c b/mysys/mf_arr_appstr.c new file mode 100644 index 00000000000..1edbea9df4a --- /dev/null +++ b/mysys/mf_arr_appstr.c @@ -0,0 +1,61 @@ +/* Copyright (C) 2007 MySQL AB + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "mysys_priv.h" +#include <m_string.h> /* strcmp() */ + + +/** + Append str to array, or move to the end if it already exists + + @param str String to be appended + @param array The array, terminated by a NULL element, all unused elements + pre-initialized to NULL + @param size Size of the array; array must be terminated by a NULL + pointer, so can hold size - 1 elements + + @retval FALSE Success + @retval TRUE Failure, array is full +*/ + +my_bool array_append_string_unique(const char *str, + const char **array, size_t size) +{ + const char **p; + /* end points at the terminating NULL element */ + const char **end= array + size - 1; + DBUG_ASSERT(*end == NULL); + + for (p= array; *p; ++p) + { + if (strcmp(*p, str) == 0) + break; + } + if (p >= end) + return TRUE; /* Array is full */ + + DBUG_ASSERT(*p == NULL || strcmp(*p, str) == 0); + + while (*(p + 1)) + { + *p= *(p + 1); + ++p; + } + + DBUG_ASSERT(p < end); + *p= str; + + return FALSE; /* Success */ +} diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index c81da9a469a..a03d71f32d8 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -3429,7 +3429,7 @@ static int flush_cached_blocks(KEY_CACHE *keycache, As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH we are guarunteed no thread will change them */ - qsort((uchar*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link); + my_qsort((uchar*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link); keycache_pthread_mutex_lock(&keycache->cache_lock); /* diff --git a/mysys/mf_qsort.c b/mysys/mf_qsort.c index 3d52d56c952..4b3ecb603a6 100644 --- a/mysys/mf_qsort.c +++ b/mysys/mf_qsort.c @@ -91,10 +91,10 @@ typedef struct st_stack *****************************************************************************/ #ifdef QSORT_EXTRA_CMP_ARGUMENT -qsort_t qsort2(void *base_ptr, size_t count, size_t size, qsort2_cmp cmp, +qsort_t my_qsort2(void *base_ptr, size_t count, size_t size, qsort2_cmp cmp, void *cmp_argument) #else -qsort_t qsort(void *base_ptr, size_t count, size_t size, qsort_cmp cmp) +qsort_t my_qsort(void *base_ptr, size_t count, size_t size, qsort_cmp cmp) #endif { char *low, *high, *pivot; diff --git a/mysys/mf_sort.c b/mysys/mf_sort.c index 741c8f42327..686ebbc1d14 100644 --- a/mysys/mf_sort.c +++ b/mysys/mf_sort.c @@ -34,8 +34,8 @@ void my_string_ptr_sort(uchar *base, uint items, size_t size) { if (size && items) { - qsort2(base,items, sizeof(uchar*), get_ptr_compare(size), - (void*) &size); + my_qsort2(base,items, sizeof(uchar*), get_ptr_compare(size), + (void*) &size); } } } diff --git a/mysys/my_delete.c b/mysys/my_delete.c index bac3e2513e1..cff00bf7e08 100644 --- a/mysys/my_delete.c +++ b/mysys/my_delete.c @@ -56,16 +56,20 @@ int nt_share_delete(const char *name, myf MyFlags) ulong cnt; DBUG_ENTER("nt_share_delete"); DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags)); - + for (cnt= GetTickCount(); cnt; cnt--) { sprintf(buf, "%s.%08X.deleted", name, cnt); if (MoveFile(name, buf)) break; - + if ((errno= GetLastError()) == ERROR_ALREADY_EXISTS) continue; - + + /* This happened during tests with MERGE tables. */ + if (errno == ERROR_ACCESS_DENIED) + continue; + DBUG_PRINT("warning", ("Failed to rename %s to %s, errno: %d", name, buf, errno)); break; diff --git a/mysys/my_lib.c b/mysys/my_lib.c index c10b2e391b4..c18d14fb549 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -180,7 +180,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) result->number_off_files= dir_entries_storage->elements; if (!(MyFlags & MY_DONT_SORT)) - qsort((void *) result->dir_entry, result->number_off_files, + my_qsort((void *) result->dir_entry, result->number_off_files, sizeof(FILEINFO), (qsort_cmp) comp_names); DBUG_RETURN(result); @@ -491,7 +491,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) result->number_off_files= dir_entries_storage->elements; if (!(MyFlags & MY_DONT_SORT)) - qsort((void *) result->dir_entry, result->number_off_files, + my_qsort((void *) result->dir_entry, result->number_off_files, sizeof(FILEINFO), (qsort_cmp) comp_names); DBUG_PRINT("exit", ("found %d files", result->number_off_files)); DBUG_RETURN(result); diff --git a/mysys/my_write.c b/mysys/my_write.c index 056a84f1794..c67b1d8f3f2 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -29,6 +29,10 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) Filedes, (long) Buffer, (ulong) Count, MyFlags)); errors=0; written=0; + /* The behavior of write(fd, buf, 0) is not portable */ + if (unlikely(!Count)) + DBUG_RETURN(0); + for (;;) { if ((writenbytes= write(Filedes, Buffer, Count)) == Count) diff --git a/mysys/queues.c b/mysys/queues.c index c0561e41dce..94f49ab8f9c 100644 --- a/mysys/queues.c +++ b/mysys/queues.c @@ -376,7 +376,7 @@ void queue_fix(QUEUE *queue) make test_priority_queue ./test_priority_queue - Written by Mikael Ronström, 2005 + Written by Mikael Ronström, 2005 */ static uint num_array[1025]; diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index a81ed925562..7f7be4835a5 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -396,6 +396,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, struct timespec wait_timeout; enum enum_thr_lock_result result= THR_LOCK_ABORTED; my_bool can_deadlock= test(data->owner->info->n_cursors); + DBUG_ENTER("wait_for_lock"); if (!in_wait_list) { @@ -431,13 +432,21 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, if the predicate is true. */ if (data->cond == 0) + { + DBUG_PRINT("thr_lock", ("lock granted/aborted")); break; + } if (rc == ETIMEDOUT || rc == ETIME) { + /* purecov: begin inspected */ + DBUG_PRINT("thr_lock", ("lock timed out")); result= THR_LOCK_WAIT_TIMEOUT; break; + /* purecov: end */ } } + DBUG_PRINT("thr_lock", ("aborted: %d in_wait_list: %d", + thread_var->abort, in_wait_list)); if (data->cond || data->type == TL_UNLOCK) { @@ -453,6 +462,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, } else { + DBUG_PRINT("thr_lock", ("lock aborted")); check_locks(data->lock, "aborted wait_for_lock", 0); } } @@ -471,7 +481,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, thread_var->current_mutex= 0; thread_var->current_cond= 0; pthread_mutex_unlock(&thread_var->mutex); - return result; + DBUG_RETURN(result); } @@ -509,7 +519,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, and the read lock is not TL_READ_NO_INSERT */ - DBUG_PRINT("lock",("write locked by thread: 0x%lx", + DBUG_PRINT("lock",("write locked 1 by thread: 0x%lx", lock->write.data->owner->info->thread_id)); if (thr_lock_owner_equal(data->owner, lock->write.data->owner) || (lock->write.data->type <= TL_WRITE_DELAYED && @@ -598,10 +608,14 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, { if (lock->write.data->type == TL_WRITE_ONLY) { - /* We are not allowed to get a lock in this case */ - data->type=TL_UNLOCK; - result= THR_LOCK_ABORTED; /* Can't wait for this one */ - goto end; + /* Allow lock owner to bypass TL_WRITE_ONLY. */ + if (!thr_lock_owner_equal(data->owner, lock->write.data->owner)) + { + /* We are not allowed to get a lock in this case */ + data->type=TL_UNLOCK; + result= THR_LOCK_ABORTED; /* Can't wait for this one */ + goto end; + } } /* @@ -631,10 +645,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, statistic_increment(locks_immediate,&THR_LOCK_lock); goto end; } - /* purecov: begin inspected */ - DBUG_PRINT("lock",("write locked by thread: 0x%lx", + DBUG_PRINT("lock",("write locked 2 by thread: 0x%lx", lock->write.data->owner->info->thread_id)); - /* purecov: end */ } else { @@ -669,7 +681,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, goto end; } } - DBUG_PRINT("lock",("write locked by thread: 0x%lx type: %d", + DBUG_PRINT("lock",("write locked 3 by thread: 0x%lx type: %d", lock->read.data->owner->info->thread_id, data->type)); } wait_queue= &lock->write_wait; @@ -683,6 +695,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, lock_owner= lock->read.data ? lock->read.data : lock->write.data; if (lock_owner && lock_owner->owner->info == owner->info) { + DBUG_PRINT("lock",("deadlock")); result= THR_LOCK_DEADLOCK; goto end; } diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 6f147c45f3b..3c1d3ae0fab 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -19,7 +19,8 @@ # All unrecognized arguments to this script are passed to mysqld. basedir="" -ldata="" +builddir="" +ldata="@localstatedir@" srcdir="" args="" @@ -30,14 +31,18 @@ user="" force=0 in_rpm=0 ip_only=0 -windows=0 -source_install=0 +cross_bootstrap=0 usage() { cat <<EOF Usage: $0 [OPTIONS] --basedir=path The path to the MySQL installation directory. + --builddir=path If using --srcdir with out-of-directory builds, you + will need to set this to the location of the build + directory where built files reside. + --cross-bootstrap For internal use. Used when building the MySQL system + tables on a different host than the target. --datadir=path The path to the MySQL data directory. --force Causes mysql_install_db to run even if DNS does not work. In that case, grant table entries that normally @@ -48,17 +53,15 @@ Usage: $0 [OPTIONS] --skip-name-resolve Use IP addresses rather than hostnames when creating grant table entries. This option can be useful if your DNS does not work. - --srcdir=path For internal use. The directory under which - mysql_install_db looks for support files such as the - error message file and the file for popoulating the - help tables. + --srcdir=path The path to the MySQL source directory. This option + uses the compiled binaries and support files within the + source tree, useful for if you don't want to install + MySQL yet and just want to create the system tables. --user=user_name The login username to use for running mysqld. Files and directories created by mysqld will be owned by this user. You must be root to use this option. By default mysqld runs using your current login name and files and directories that it creates will be owned by you. - --windows For internal use. This option is used for creating - Windows distributions. All other options are passed to the mysqld program @@ -68,7 +71,7 @@ EOF s_echo() { - if test "$in_rpm" -eq 0 -a "$windows" -eq 0 + if test "$in_rpm" -eq 0 -a "$cross_bootstrap" -eq 0 then echo "$1" fi @@ -96,6 +99,7 @@ parse_arguments() case "$arg" in --force) force=1 ;; --basedir=*) basedir=`parse_arg "$arg"` ;; + --builddir=*) builddir=`parse_arg "$arg"` ;; --srcdir=*) srcdir=`parse_arg "$arg"` ;; --ldata=*|--datadir=*) ldata=`parse_arg "$arg"` ;; --user=*) @@ -110,23 +114,17 @@ parse_arguments() --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$arg" ;; - --windows) - # This is actually a "cross bootstrap" argument used when - # building the MySQL system tables on a different host - # than the target. The platform independent - # files that are created in --datadir on the host can - # be copied to the target system, the most common use for - # this feature is in the windows installer which will take - # the files from datadir and include them as part of the install - # package. - windows=1 ;; - - --source-install) - # This is used when you want to run mysqld directly from the - # source tree (for example when you are developing MySQL and - # only want to create the default tables but don't want to - # install mysqld yet. - source_install=1 ;; + --cross-bootstrap|--windows) + # Used when building the MySQL system tables on a different host than + # the target. The platform-independent files that are created in + # --datadir on the host can be copied to the target system. + # + # The most common use for this feature is in the Windows installer + # which will take the files from datadir and include them as part of + # the install package. See top-level 'dist-hook' make target. + # + # --windows is a deprecated alias + cross_bootstrap=1 ;; *) if test -n "$pick_args" @@ -155,41 +153,33 @@ find_in_basedir() file=$1; shift - base="$basedir" - if test -z "$base" - then - # Assume source installation if basedir is not given - base="." - fi - for dir in "$@" do - if test -f "$base/$dir/$file" + if test -f "$basedir/$dir/$file" then if test -n "$return_dir" then - echo "$base/$dir" + echo "$basedir/$dir" else - echo "$base/$dir/$file" + echo "$basedir/$dir/$file" fi break fi done } -missing_in_basedir() +cannot_find_file() { - if test -z "$basedir" - then - echo "FATAL ERROR: Could not find $* inside --basedir" - echo - echo "When using --basedir you must point either into a MySQL binary" - echo "distribution directory or a compiled tree previously populated" - echo "by 'make install'" - else - echo "FATAL ERROR: Can't find $*. Please specify your installation" - echo "directory with the '--basedir=' option." - fi + echo + echo "FATAL ERROR: Could not find $*" + echo + echo "If you compiled from source, you need to run 'make install' to" + echo "copy the software into the correct location ready for operation." + echo + echo "If you are using a binary release, you must either be at the top" + echo "level of the extracted archive, or pass the --basedir option" + echo "pointing to that location." + echo } # Ok, let's go. We first need to parse arguments which are required by @@ -197,23 +187,37 @@ missing_in_basedir() # the command line to add any extra bits that we need. parse_arguments PICK-ARGS-FROM-ARGV "$@" -# We can now find my_print_defaults, either in the supplied --basedir -# location or in the installed area. - -print_defaults=`find_in_basedir my_print_defaults bin extra` -if test -z "$print_defaults" +# +# We can now find my_print_defaults. This script supports: +# +# --srcdir=path pointing to compiled source tree +# --basedir=path pointing to installed binary location +# +# or default to compiled-in locations. +# +if test -n "$srcdir" && test -n "$basedir" then - print_defaults="@bindir@/my_print_defaults" - if ! test -x "$print_defaults" + echo "ERROR: Specify either --basedir or --srcdir, not both." + exit 1 +fi +if test -n "$srcdir" +then + if test -z "$builddir" then - echo "FATAL ERROR: Could not find $print_defaults" - echo - echo "If you are using a binary release, you must run this script from" - echo "within the directory the archive extracted into. If you compiled" - echo "MySQL yourself you must run 'make install' first or use" - echo "use --source-install --install-dir=xxx from the top source directory" - exit 1 + builddir="$srcdir" fi + print_defaults="$builddir/extra/my_print_defaults" +elif test -n "$basedir" +then + print_defaults=`find_in_basedir my_print_defaults bin extra` +else + print_defaults="@bindir@/my_print_defaults" +fi + +if test ! -x "$print_defaults" +then + cannot_find_file "$print_defaults" + exit 1 fi # Now we can get arguments from the groups [mysqld] and [mysql_install_db] @@ -221,63 +225,33 @@ fi parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" -# Path to MySQL installation directory -if test -z "$basedir" -a "$source_install" = 0 +# Configure paths to support files +if test -n "$srcdir" then + basedir="$builddir" + bindir="$basedir/client" + extra_bindir="$basedir/extra" + mysqld="$basedir/sql/mysqld" + mysqld_opt="--language=$srcdir/sql/share/english" + pkgdatadir="$srcdir/scripts" + scriptdir="$srcdir/scripts" +elif test -n "$basedir" +then + bindir="$basedir/bin" + extra_bindir="$bindir" + mysqld=`find_in_basedir mysqld libexec sbin bin` + pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` + scriptdir="$basedir/scripts" +else basedir="@prefix@" bindir="@bindir@" extra_bindir="$bindir" mysqld="@libexecdir@/mysqld" pkgdatadir="@pkgdatadir@" -else - bindir="$basedir/bin" - extra_bindir="$bindir" - # We set up bootstrap-specific paths later, so skip this for --windows - if test "$windows" -eq 0 - then - mysqld=`find_in_basedir mysqld libexec sbin bin` - if test -z "$basedir" - then - # We come here when source-install is given - bindir="$basedir/bin" - extra_bindir="$bindir" - fi - if test -x "$mysqld" - then - pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql scripts` - if test -z "$pkgdatadir" - then - missing_in_basedir fill_help_tables.sql - exit 1 - fi - else - if test -x "./sql/mysqld" - then - # Source installation - mysqld="./sql/mysqld" - bindir="./client" - extra_bindir="./extra" - pkgdatadir="./scripts" - mysqld_opt="--language=./sql/share/english" - else - missing_in_basedir mysqld - fi - fi - fi -fi - -# Path to data directory -if test -z "$ldata" -then - ldata="@localstatedir@" -fi - -# Set up paths to SQL scripts required for bootstrap and ensure they exist. -if test -n "$srcdir" -then - pkgdatadir="$srcdir/scripts" + scriptdir="@scriptdir@" fi +# Set up paths to SQL scripts required for bootstrap fill_help_tables="$pkgdatadir/fill_help_tables.sql" create_system_tables="$pkgdatadir/mysql_system_tables.sql" fill_system_tables="$pkgdatadir/mysql_system_tables_data.sql" @@ -286,28 +260,14 @@ for f in $fill_help_tables $create_system_tables $fill_system_tables do if test ! -f "$f" then - echo "FATAL ERROR: Could not find SQL file '$f'" + cannot_find_file "$f" exit 1 fi done -# Set up Windows-specific paths -if test "$windows" -eq 1 -then - mysqld="./sql/mysqld" - if test -n "$srcdir" -a -f "$srcdir/sql/share/english/errmsg.sys" - then - mysqld_opt="--language=$srcdir/sql/share/english" - else - mysqld_opt="--language=./sql/share/english" - fi -fi - -# Make sure mysqld is available in default location (--basedir option is -# already tested above). if test ! -x "$mysqld" then - echo "FATAL ERROR: 'mysqld' executable not found!" + cannot_find_file "$mysqld" exit 1 fi @@ -315,13 +275,13 @@ fi hostname=`@HOSTNAME@` # Check if hostname is valid -if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 +if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 then resolved=`$extra_bindir/resolveip $hostname 2>&1` - if [ $? -ne 0 ] + if test $? -ne 0 then resolved=`$extra_bindir/resolveip localhost 2>&1` - if [ $? -ne 0 ] + if test $? -ne 0 then echo "Neither host '$hostname' nor 'localhost' could be looked up with" echo "$extra_bindir/resolveip" @@ -345,7 +305,7 @@ then hostname=`echo "$resolved" | awk '/ /{print $6}'` fi -# Create database directories mysql & test +# Create database directories for dir in $ldata $ldata/mysql $ldata/test do if test ! -d $dir @@ -364,98 +324,95 @@ then args="$args --user=$user" fi -# Peform the install of system tables +# Configure mysqld command line mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}" mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \ --loose-skip-ndbcluster $args --max_allowed_packet=8M \ --net_buffer_length=16K" -# Pipe mysql_system_tables.sql to "mysqld --bootstrap" +# Create the system and help tables by passing them to "mysqld --bootstrap" s_echo "Installing MySQL system tables..." -if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld_install_cmd_line` +if { echo "use mysql;"; cat $create_system_tables $fill_system_tables; } | eval "$filter_cmd_line" | $mysqld_install_cmd_line > /dev/null then s_echo "OK" +else + echo + echo "Installation of system tables failed! Examine the logs in" + echo "$ldata for more information." + echo + echo "You can try to start the mysqld daemon with:" + echo + echo " shell> $mysqld --skip-grant &" + echo + echo "and use the command line tool $bindir/mysql" + echo "to connect to the mysql database and look at the grant tables:" + echo + echo " shell> $bindir/mysql -u root mysql" + echo " mysql> show tables" + echo + echo "Try 'mysqld --help' if you have problems with paths. Using --log" + echo "gives you a log in $ldata that may be helpful." + echo + echo "The latest information about MySQL is available on the web at" + echo "http://www.mysql.com/. Please consult the MySQL manual section" + echo "'Problems running mysql_install_db', and the manual section that" + echo "describes problems on your OS. Another information source are the" + echo "MySQL email archives available at http://lists.mysql.com/." + echo + echo "Please check all of the above before mailing us! And remember, if" + echo "you do mail us, you MUST use the $scriptdir/mysqlbug script!" + echo + exit 1 +fi - s_echo "Filling help tables..." - # Pipe fill_help_tables.sql to "mysqld --bootstrap" - if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` - then - # Fill suceeded - s_echo "OK" - else - echo - echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" - echo "The \"HELP\" command might not work properly" - echo - fi +s_echo "Filling help tables..." +if `(echo "use mysql;"; cat $fill_help_tables) | $mysqld_install_cmd_line` +then + s_echo "OK" +else + echo + echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" + echo "The \"HELP\" command might not work properly." +fi +# Don't output verbose information if running inside bootstrap or using +# --srcdir for testing. +if test "$cross_bootstrap" -eq 0 && test -z "$srcdir" +then s_echo s_echo "To start mysqld at boot time you have to copy" s_echo "support-files/mysql.server to the right place for your system" - s_echo + echo + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "To do so, start the server, then issue the following commands:" + echo + echo "$bindir/mysqladmin -u root password 'new-password'" + echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" + echo + echo "Alternatively you can run:" + echo "$bindir/mysql_secure_installation" + echo + echo "which will also give you the option of removing the test" + echo "databases and anonymous user created by default. This is" + echo "strongly recommended for production servers." + echo + echo "See the manual for more instructions." - if test "$windows" -eq 0 + if test "$in_rpm" -eq 0 then - # A root password should of course also be set on Windows! - # The reason for not displaying these prompts here is that when - # executing this script with the --windows argument the script - # is used to generate system tables mainly used by the - # windows installer. And thus the password should not be set until - # those files has been copied to the target system - echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" - echo "To do so, start the server, then issue the following commands:" - echo "$bindir/mysqladmin -u root password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" - echo - echo "Alternatively you can run:" - echo "$bindir/mysql_secure_installation" - echo - echo "which will also give you the option of removing the test" - echo "databases and anonymous user created by default. This is" - echo "strongly recommended for production servers." - echo - echo "See the manual for more instructions." - echo - - if test "$in_rpm" -eq 0 -a "$source_install" -eq 0 - then - echo "You can start the MySQL daemon with:" - echo "cd @prefix@ ; $bindir/mysqld_safe &" - echo - echo "You can test the MySQL daemon with mysql-test-run.pl" - echo "cd mysql-test ; perl mysql-test-run.pl" - echo - fi - echo "Please report any problems with the @scriptdir@/mysqlbug script!" - echo - echo "The latest information about MySQL is available on the web at" - echo "http://www.mysql.com" - echo "Support MySQL by buying support/licenses at http://shop.mysql.com" + echo "You can start the MySQL daemon with:" + echo "cd $basedir ; $bindir/mysqld_safe &" + echo "You can test the MySQL daemon with mysql-test-run.pl" + echo "cd $basedir/mysql-test ; perl mysql-test-run.pl" fi - exit 0 -else - echo "Installation of system tables failed!" - echo - echo "Examine the logs in $ldata for more information." - echo "You can try to start the mysqld daemon with:" - echo "$mysqld --skip-grant &" - echo "and use the command line tool" - echo "$bindir/mysql to connect to the mysql" - echo "database and look at the grant tables:" + echo - echo "shell> $bindir/mysql -u root mysql" - echo "mysql> show tables" + echo "Please report any problems with the $scriptdir/mysqlbug script!" echo - echo "Try 'mysqld --help' if you have problems with paths. Using --log" - echo "gives you a log in $ldata that may be helpful." + echo "The latest information about MySQL is available at http://www.mysql.com/" + echo "Support MySQL by buying support/licenses from http://shop.mysql.com/" echo - echo "The latest information about MySQL is available on the web at" - echo "http://www.mysql.com" - echo "Please consult the MySQL manual section: 'Problems running mysql_install_db'," - echo "and the manual section that describes problems on your OS." - echo "Another information source is the MySQL email archive." - echo "Please check all of the above before mailing us!" - echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" - exit 1 fi + +exit 0 diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 89558f99603..6db9430b972 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -2,6 +2,12 @@ -- The inital data for system tables of MySQL Server -- +-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix +-- host which will later be included in a Windows zip file), any lines +-- containing "@current_hostname" are filtered out by mysql_install_db. +set @current_hostname= @@hostname; + + -- Fill "db" table with default grants for anyone to -- access database 'test' and 'test_%' if "db" table didn't exist CREATE TEMPORARY TABLE tmp_db LIKE db; @@ -14,11 +20,11 @@ DROP TABLE tmp_db; -- Fill "users" table with default users allowing root access -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; -set @hostname= @@hostname; +set @current_hostname= @@hostname; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user VALUES (@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user VALUES (@current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) VALUES (@@hostname,''); +INSERT INTO tmp_user (host,user) VALUES (@current_hostname,''); INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; diff --git a/sql-common/client.c b/sql-common/client.c index 0ca7ef16c0d..f149442f12e 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1097,11 +1097,16 @@ void mysql_read_default_options(struct st_mysql_options *options, my_free(options->ssl_capath, MYF(MY_ALLOW_ZERO_PTR)); options->ssl_capath = my_strdup(opt_arg, MYF(MY_WME)); break; + case 26: /* ssl_cipher */ + my_free(options->ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + options->ssl_cipher= my_strdup(opt_arg, MYF(MY_WME)); + break; #else case 13: /* Ignore SSL options */ case 14: case 15: case 16: + case 26: break; #endif /* HAVE_OPENSSL */ case 17: /* charset-lib */ diff --git a/sql/Makefile.am b/sql/Makefile.am index f3e2484f9ab..0081417d492 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -161,6 +161,7 @@ link_sources: @LN_CP_F@ $(top_srcdir)/sql-common/my_time.c my_time.c rm -f my_user.c @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c + echo timestamp > link_sources # This generates lex_hash.h # NOTE Built sources should depend on their sources not the tool diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index adac2b596c1..f4b64ab3012 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1649,8 +1649,6 @@ err: void Event_queue_element::mark_last_executed(THD *thd) { - thd->set_current_time(); - last_executed= (my_time_t) thd->query_start(); last_executed_changed= TRUE; diff --git a/sql/events.cc b/sql/events.cc index 4579fb4d086..87385082a82 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -146,7 +146,7 @@ bool Events::set_opt_event_scheduler(char *argument) { if (argument == NULL) - opt_event_scheduler= Events::EVENTS_DISABLED; + opt_event_scheduler= Events::EVENTS_ON; else { int type; diff --git a/sql/field.cc b/sql/field.cc index 36ba6e6f12c..942c0538abb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1394,20 +1394,85 @@ int Field::store(const char *to, uint length, CHARSET_INFO *cs, /** + Pack the field into a format suitable for storage and transfer. + + To implement packing functionality, only the virtual function + should be overridden. The other functions are just convenience + functions and hence should not be overridden. + + The value of <code>low_byte_first</code> is dependent on how the + packed data is going to be used: for local use, e.g., temporary + store on disk or in memory, use the native format since that is + faster. For data that is going to be transfered to other machines + (e.g., when writing data to the binary log), data should always be + stored in little-endian format. + + @note The default method for packing fields just copy the raw bytes + of the record into the destination, but never more than + <code>max_length</code> characters. + + @param to + Pointer to memory area where representation of field should be put. + + @param from + Pointer to memory area where record representation of field is + stored. + + @param max_length + Maximum length of the field, as given in the column definition. For + example, for <code>CHAR(1000)</code>, the <code>max_length</code> + is 1000. This information is sometimes needed to decide how to pack + the data. + + @param low_byte_first + @c TRUE if integers should be stored little-endian, @c FALSE if + native format should be used. Note that for little-endian machines, + the value of this flag is a moot point since the native format is + little-endian. +*/ +uchar * +Field::pack(uchar *to, const uchar *from, uint max_length, + bool low_byte_first __attribute__((unused))) +{ + uint32 length= pack_length(); + set_if_smaller(length, max_length); + memcpy(to, from, length); + return to+length; +} + +/** Unpack a field from row data. - This method is used to unpack a field from a master whose size - of the field is less than that of the slave. - + This method is used to unpack a field from a master whose size of + the field is less than that of the slave. + + The <code>param_data</code> parameter is a two-byte integer (stored + in the least significant 16 bits of the unsigned integer) usually + consisting of two parts: the real type in the most significant byte + and a original pack length in the least significant byte. + + The exact layout of the <code>param_data</code> field is given by + the <code>Table_map_log_event::save_field_metadata()</code>. + + This is the default method for unpacking a field. It just copies + the memory block in byte order (of original pack length bytes or + length of field, whichever is smaller). + @param to Destination of the data @param from Source of the data - @param param_data Pack length of the field data + @param param_data Real type and original pack length of the field + data + + @param low_byte_first + If this flag is @c true, all composite entities (e.g., lengths) + should be unpacked in little-endian format; otherwise, the entities + are unpacked in native order. @return New pointer into memory based on from + length of the data */ -const uchar *Field::unpack(uchar* to, - const uchar *from, - uint param_data) +const uchar * +Field::unpack(uchar* to, const uchar *from, uint param_data, + bool low_byte_first __attribute__((unused))) { uint length=pack_length(); int from_type= 0; @@ -1420,19 +1485,18 @@ const uchar *Field::unpack(uchar* to, from_type= (param_data & 0xff00) >> 8U; // real_type. param_data= param_data & 0x00ff; // length. } + + if ((param_data == 0) || + (length == param_data) || + (from_type != real_type())) + { + memcpy(to, from, length); + return from+length; + } + uint len= (param_data && (param_data < length)) ? param_data : length; - /* - If the length is the same, use old unpack method. - If the param_data is 0, use the old unpack method. - This is possible if the table map was generated from a down-level - master or if the data was not available on the master. - If the real_types are not the same, use the old unpack method. - */ - if ((length == param_data) || - (param_data == 0) || - (from_type != real_type())) - return(unpack(to, from)); + memcpy(to, from, param_data > length ? length : len); return from+len; } @@ -2814,10 +2878,15 @@ uint Field_new_decimal::is_equal(Create_field *new_field) @return New pointer into memory based on from + length of the data */ -const uchar *Field_new_decimal::unpack(uchar* to, - const uchar *from, - uint param_data) +const uchar * +Field_new_decimal::unpack(uchar* to, + const uchar *from, + uint param_data, + bool low_byte_first) { + if (param_data == 0) + return Field::unpack(to, from, param_data, low_byte_first); + uint from_precision= (param_data & 0xff00) >> 8U; uint from_decimal= param_data & 0x00ff; uint length=pack_length(); @@ -3959,6 +4028,49 @@ void Field_longlong::sql_type(String &res) const } +/* + Floating-point numbers + */ + +uchar * +Field_real::pack(uchar *to, const uchar *from, + uint max_length, bool low_byte_first) +{ + DBUG_ENTER("Field_real::pack"); + DBUG_ASSERT(max_length >= pack_length()); + DBUG_PRINT("debug", ("pack_length(): %u", pack_length())); +#ifdef WORDS_BIGENDIAN + if (low_byte_first != table->s->db_low_byte_first) + { + const uchar *dptr= from + pack_length(); + while (dptr-- > from) + *to++ = *dptr; + DBUG_RETURN(to); + } + else +#endif + DBUG_RETURN(Field::pack(to, from, max_length, low_byte_first)); +} + +const uchar * +Field_real::unpack(uchar *to, const uchar *from, + uint param_data, bool low_byte_first) +{ + DBUG_ENTER("Field_real::unpack"); + DBUG_PRINT("debug", ("pack_length(): %u", pack_length())); +#ifdef WORDS_BIGENDIAN + if (low_byte_first != table->s->db_low_byte_first) + { + const uchar *dptr= from + pack_length(); + while (dptr-- > from) + *to++ = *dptr; + DBUG_RETURN(from + pack_length()); + } + else +#endif + DBUG_RETURN(Field::unpack(to, from, param_data, low_byte_first)); +} + /**************************************************************************** single precision float ****************************************************************************/ @@ -6289,24 +6401,74 @@ int Field_str::store(double nr) ASSERT_COLUMN_MARKED_FOR_WRITE; char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; uint length; - bool use_scientific_notation= TRUE; uint local_char_length= field_length / charset()->mbmaxlen; - /* - Check fabs(nr) against longest value that can be stored in field, - which depends on whether the value is < 1 or not, and negative or not - */ double anr= fabs(nr); + bool fractional= (anr != floor(anr)); int neg= (nr < 0.0) ? 1 : 0; - if (local_char_length > 4 && local_char_length < 32 && - (anr < 1.0 ? anr > 1/(log_10[max(0,(int) local_char_length-neg-2)]) /* -2 for "0." */ - : anr < log_10[local_char_length-neg]-1)) - use_scientific_notation= FALSE; - - length= (uint) my_sprintf(buff, (buff, "%-.*g", - (use_scientific_notation ? - max(0, (int)local_char_length-neg-5) : - local_char_length), - nr)); + uint max_length; + int exp; + uint digits; + uint i; + + /* Calculate the exponent from the 'e'-format conversion */ + if (anr < 1.0 && anr > 0) + { + for (exp= 0; anr < 1e-100; exp-= 100, anr*= 1e100); + for (; anr < 1e-10; exp-= 10, anr*= 1e10); + for (i= 1; anr < 1 / log_10[i]; exp--, i++); + exp--; + } + else + { + for (exp= 0; anr > 1e100; exp+= 100, anr/= 1e100); + for (; anr > 1e10; exp+= 10, anr/= 1e10); + for (i= 1; anr > log_10[i]; exp++, i++); + } + + max_length= local_char_length - neg; + + /* + Since in sprintf("%g") precision means the number of significant digits, + calculate the maximum number of significant digits if the 'f'-format + would be used (+1 for decimal point if the number has a fractional part). + */ + digits= max(0, (int) max_length - fractional); + /* + If the exponent is negative, decrease digits by the number of leading zeros + after the decimal point that do not count as significant digits. + */ + if (exp < 0) + digits= max(0, (int) digits + exp); + /* + 'e'-format is used only if the exponent is less than -4 or greater than or + equal to the precision. In this case we need to adjust the number of + significant digits to take "e+NN" + decimal point into account (hence -5). + We also have to reserve one additional character if abs(exp) >= 100. + */ + if (exp >= (int) digits || exp < -4) + digits= max(0, (int) (max_length - 5 - (exp >= 100 || exp <= -100))); + + /* Limit precision to DBL_DIG to avoid garbage past significant digits */ + set_if_smaller(digits, DBL_DIG); + + length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr)); + +#ifdef __WIN__ + /* + Windows always zero-pads the exponent to 3 digits, we want to remove the + leading 0 to match the sprintf() output on other platforms. + */ + if ((exp >= (int) digits || exp < -4) && exp > -100 && exp < 100) + { + DBUG_ASSERT(length >= 6); /* 1e+NNN */ + uint tmp= length - 3; + buff[tmp]= buff[tmp + 1]; + tmp++; + buff[tmp]= buff[tmp + 1]; + length--; + } +#endif + /* +1 below is because "precision" in %g above means the max. number of significant digits, not the output width. @@ -6367,6 +6529,11 @@ int Field_longstr::store_decimal(const my_decimal *d) return store(str.ptr(), str.length(), str.charset()); } +uint32 Field_longstr::max_data_length() const +{ + return field_length + (field_length > 255 ? 2 : 1); +} + double Field_string::val_real(void) { @@ -6511,7 +6678,9 @@ void Field_string::sql_type(String &res) const } -uchar *Field_string::pack(uchar *to, const uchar *from, uint max_length) +uchar *Field_string::pack(uchar *to, const uchar *from, + uint max_length, + bool low_byte_first __attribute__((unused))) { uint length= min(field_length,max_length); uint local_char_length= max_length/field_charset->mbmaxlen; @@ -6519,11 +6688,15 @@ uchar *Field_string::pack(uchar *to, const uchar *from, uint max_length) local_char_length= my_charpos(field_charset, from, from+length, local_char_length); set_if_smaller(length, local_char_length); - while (length && from[length-1] == ' ') + while (length && from[length-1] == field_charset->pad_char) length--; + + // Length always stored little-endian *to++= (uchar) length; if (field_length > 255) *to++= (uchar) (length >> 8); + + // Store the actual bytes of the string memcpy(to, from, length); return to+length; } @@ -6545,34 +6718,27 @@ uchar *Field_string::pack(uchar *to, const uchar *from, uint max_length) @return New pointer into memory based on from + length of the data */ -const uchar *Field_string::unpack(uchar *to, - const uchar *from, - uint param_data) -{ - uint from_len= param_data & 0x00ff; // length. - uint length= 0; - uint f_length; - f_length= (from_len < field_length) ? from_len : field_length; - DBUG_ASSERT(f_length <= 255); - length= (uint) *from++; - bitmap_set_bit(table->write_set,field_index); - store((const char *)from, length, system_charset_info); - return from+length; -} - - -const uchar *Field_string::unpack(uchar *to, const uchar *from) -{ +const uchar * +Field_string::unpack(uchar *to, + const uchar *from, + uint param_data, + bool low_byte_first __attribute__((unused))) +{ + uint from_length= + param_data ? min(param_data & 0x00ff, field_length) : field_length; uint length; - if (field_length > 255) + + if (from_length > 255) { length= uint2korr(from); from+= 2; } else length= (uint) *from++; - memcpy(to, from, (int) length); - bfill(to+length, field_length - length, ' '); + + memcpy(to, from, length); + // Pad the string with the pad character of the fields charset + bfill(to + length, field_length - length, field_charset->pad_char); return from+length; } @@ -6762,6 +6928,7 @@ const uint Field_varstring::MAX_SIZE= UINT_MAX16; int Field_varstring::do_save_field_metadata(uchar *metadata_ptr) { char *ptr= (char *)metadata_ptr; + DBUG_ASSERT(field_length <= 65535); int2store(ptr, field_length); return 2; } @@ -6989,22 +7156,30 @@ uint32 Field_varstring::data_length() Here the number of length bytes are depending on the given max_length */ -uchar *Field_varstring::pack(uchar *to, const uchar *from, uint max_length) +uchar *Field_varstring::pack(uchar *to, const uchar *from, + uint max_length, + bool low_byte_first __attribute__((unused))) { uint length= length_bytes == 1 ? (uint) *from : uint2korr(from); set_if_smaller(max_length, field_length); if (length > max_length) length=max_length; - *to++= (char) (length & 255); + + /* Length always stored little-endian */ + *to++= length & 0xFF; if (max_length > 255) - *to++= (char) (length >> 8); - if (length) + *to++= (length >> 8) & 0xFF; + + /* Store bytes of string */ + if (length > 0) memcpy(to, from+length_bytes, length); return to+length; } -uchar *Field_varstring::pack_key(uchar *to, const uchar *key, uint max_length) +uchar * +Field_varstring::pack_key(uchar *to, const uchar *key, uint max_length, + bool low_byte_first __attribute__((unused))) { uint length= length_bytes == 1 ? (uint) *key : uint2korr(key); uint local_char_length= ((field_charset->mbmaxlen > 1) ? @@ -7043,8 +7218,9 @@ uchar *Field_varstring::pack_key(uchar *to, const uchar *key, uint max_length) Pointer to end of 'key' (To the next key part if multi-segment key) */ -const uchar *Field_varstring::unpack_key(uchar *to, const uchar *key, - uint max_length) +const uchar * +Field_varstring::unpack_key(uchar *to, const uchar *key, uint max_length, + bool low_byte_first __attribute__((unused))) { /* get length of the blob key */ uint32 length= *key++; @@ -7073,8 +7249,9 @@ const uchar *Field_varstring::unpack_key(uchar *to, const uchar *key, end of key storage */ -uchar *Field_varstring::pack_key_from_key_image(uchar *to, const uchar *from, - uint max_length) +uchar * +Field_varstring::pack_key_from_key_image(uchar *to, const uchar *from, uint max_length, + bool low_byte_first __attribute__((unused))) { /* Key length is always stored as 2 bytes */ uint length= uint2korr(from); @@ -7094,6 +7271,9 @@ uchar *Field_varstring::pack_key_from_key_image(uchar *to, const uchar *from, This method is used to unpack a varstring field from a master whose size of the field is less than that of the slave. + + @note + The string length is always packed little-endian. @param to Destination of the data @param from Source of the data @@ -7101,9 +7281,10 @@ uchar *Field_varstring::pack_key_from_key_image(uchar *to, const uchar *from, @return New pointer into memory based on from + length of the data */ -const uchar *Field_varstring::unpack(uchar *to, - const uchar *from, - uint param_data) +const uchar * +Field_varstring::unpack(uchar *to, const uchar *from, + uint param_data, + bool low_byte_first __attribute__((unused))) { uint length; uint l_bytes= (param_data && (param_data < field_length)) ? @@ -7115,28 +7296,7 @@ const uchar *Field_varstring::unpack(uchar *to, if (length_bytes == 2) to[1]= 0; } - else - { - length= uint2korr(from); - to[0]= *from++; - to[1]= *from++; - } - if (length) - memcpy(to+ length_bytes, from, length); - return from+length; -} - - -/* - unpack field packed with Field_varstring::pack() -*/ - -const uchar *Field_varstring::unpack(uchar *to, const uchar *from) -{ - uint length; - if (length_bytes == 1) - length= (uint) (*to= *from++); - else + else /* l_bytes == 2 */ { length= uint2korr(from); to[0]= *from++; @@ -7385,9 +7545,9 @@ void Field_blob::store_length(uchar *i_ptr, } -uint32 Field_blob::get_length(const uchar *pos, bool low_byte_first) +uint32 Field_blob::get_length(const uchar *pos, uint packlength_arg, bool low_byte_first) { - switch (packlength) { + switch (packlength_arg) { case 1: return (uint32) pos[0]; case 2: @@ -7818,26 +7978,37 @@ void Field_blob::sql_type(String &res) const } } - -uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) +uchar *Field_blob::pack(uchar *to, const uchar *from, + uint max_length, bool low_byte_first) { + DBUG_ENTER("Field_blob::pack"); + DBUG_PRINT("enter", ("to: 0x%lx; from: 0x%lx;" + " max_length: %u; low_byte_first: %d", + (ulong) to, (ulong) from, + max_length, low_byte_first)); + DBUG_DUMP("record", from, table->s->reclength); uchar *save= ptr; ptr= (uchar*) from; uint32 length=get_length(); // Length of from string - if (length > max_length) - { - length=max_length; - store_length(to,packlength,length,TRUE); - } - else - memcpy(to,from,packlength); // Copy length - if (length) + + /* + Store max length, which will occupy packlength bytes. If the max + length given is smaller than the actual length of the blob, we + just store the initial bytes of the blob. + */ + store_length(to, packlength, min(length, max_length), low_byte_first); + + /* + Store the actual blob data, which will occupy 'length' bytes. + */ + if (length > 0) { get_ptr((uchar**) &from); memcpy(to+packlength, from,length); } ptr=save; // Restore org row pointer - return to+packlength+length; + DBUG_DUMP("packed", to, packlength + length); + DBUG_RETURN(to+packlength+length); } @@ -7852,28 +8023,30 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) @param to Destination of the data @param from Source of the data - @param param_data not used + @param param_data @c TRUE if base types should be stored in little- + endian format, @c FALSE if native format should + be used. @return New pointer into memory based on from + length of the data */ const uchar *Field_blob::unpack(uchar *to, const uchar *from, - uint param_data) -{ - return unpack(to, from); -} - - -const uchar *Field_blob::unpack(uchar *to, const uchar *from) -{ - uint32 length=get_length(from); - memcpy(to,from,packlength); - from+=packlength; - if (length) - memcpy_fixed(to+packlength, &from, sizeof(from)); - else - bzero(to+packlength,sizeof(from)); - return from+length; + uint param_data, + bool low_byte_first) +{ + DBUG_ENTER("Field_blob::unpack"); + DBUG_PRINT("enter", ("to: 0x%lx; from: 0x%lx;" + " param_data: %u; low_byte_first: %d", + (ulong) to, (ulong) from, param_data, low_byte_first)); + uint const master_packlength= + param_data > 0 ? param_data & 0xFF : packlength; + uint32 const length= get_length(from, master_packlength, low_byte_first); + DBUG_DUMP("packed", from, length + master_packlength); + bitmap_set_bit(table->write_set, field_index); + store(reinterpret_cast<const char*>(from) + master_packlength, + length, field_charset); + DBUG_DUMP("record", to, table->s->reclength); + DBUG_RETURN(from + master_packlength + length); } /* Keys for blobs are like keys on varchars */ @@ -7923,7 +8096,9 @@ int Field_blob::pack_cmp(const uchar *b, uint key_length_arg, /* Create a packed key that will be used for storage from a MySQL row */ -uchar *Field_blob::pack_key(uchar *to, const uchar *from, uint max_length) +uchar * +Field_blob::pack_key(uchar *to, const uchar *from, uint max_length, + bool low_byte_first __attribute__((unused))) { uchar *save= ptr; ptr= (uchar*) from; @@ -7968,8 +8143,9 @@ uchar *Field_blob::pack_key(uchar *to, const uchar *from, uint max_length) Pointer into 'from' past the last byte copied from packed key. */ -const uchar *Field_blob::unpack_key(uchar *to, const uchar *from, - uint max_length) +const uchar * +Field_blob::unpack_key(uchar *to, const uchar *from, uint max_length, + bool low_byte_first __attribute__((unused))) { /* get length of the blob key */ uint32 length= *from++; @@ -7992,8 +8168,9 @@ const uchar *Field_blob::unpack_key(uchar *to, const uchar *from, /* Create a packed key that will be used for storage from a MySQL key */ -uchar *Field_blob::pack_key_from_key_image(uchar *to, const uchar *from, - uint max_length) +uchar * +Field_blob::pack_key_from_key_image(uchar *to, const uchar *from, uint max_length, + bool low_byte_first __attribute__((unused))) { uint length=uint2korr(from); if (length > max_length) @@ -8940,9 +9117,11 @@ void Field_bit::sql_type(String &res) const } -uchar *Field_bit::pack(uchar *to, const uchar *from, uint max_length) +uchar * +Field_bit::pack(uchar *to, const uchar *from, uint max_length, + bool low_byte_first __attribute__((unused))) { - DBUG_ASSERT(max_length); + DBUG_ASSERT(max_length > 0); uint length; if (bit_len > 0) { @@ -8977,28 +9156,44 @@ uchar *Field_bit::pack(uchar *to, const uchar *from, uint max_length) /** Unpack a bit field from row data. - This method is used to unpack a bit field from a master whose size + This method is used to unpack a bit field from a master whose size of the field is less than that of the slave. - + @param to Destination of the data @param from Source of the data @param param_data Bit length (upper) and length (lower) values @return New pointer into memory based on from + length of the data */ -const uchar *Field_bit::unpack(uchar *to, - const uchar *from, - uint param_data) +const uchar * +Field_bit::unpack(uchar *to, const uchar *from, uint param_data, + bool low_byte_first __attribute__((unused))) { uint const from_len= (param_data >> 8U) & 0x00ff; uint const from_bit_len= param_data & 0x00ff; /* - If the master and slave have the same sizes, then use the old - unpack() method. + If the parameter data is zero (i.e., undefined), or if the master + and slave have the same sizes, then use the old unpack() method. */ - if ((from_bit_len == bit_len) && - (from_len == bytes_in_rec)) - return(unpack(to, from)); + if (param_data == 0 || + (from_bit_len == bit_len) && (from_len == bytes_in_rec)) + { + if (bit_len > 0) + { + /* + set_rec_bits is a macro, don't put the post-increment in the + argument since that might cause strange side-effects. + + For the choice of the second argument, see the explanation for + Field_bit::pack(). + */ + set_rec_bits(*from, bit_ptr + (to - ptr), bit_ofs, bit_len); + from++; + } + memcpy(to, from, bytes_in_rec); + return from + bytes_in_rec; + } + /* We are converting a smaller bit field to a larger one here. To do that, we first need to construct a raw value for the original @@ -9026,25 +9221,6 @@ const uchar *Field_bit::unpack(uchar *to, } -const uchar *Field_bit::unpack(uchar *to, const uchar *from) -{ - if (bit_len > 0) - { - /* - set_rec_bits is a macro, don't put the post-increment in the - argument since that might cause strange side-effects. - - For the choice of the second argument, see the explanation for - Field_bit::pack(). - */ - set_rec_bits(*from, bit_ptr + (to - ptr), bit_ofs, bit_len); - from++; - } - memcpy(to, from, bytes_in_rec); - return from + bytes_in_rec; -} - - void Field_bit::set_default() { if (bit_len > 0) diff --git a/sql/field.h b/sql/field.h index f4314720e86..9f76deb18bc 100644 --- a/sql/field.h +++ b/sql/field.h @@ -176,6 +176,17 @@ public: */ virtual uint32 data_length() { return pack_length(); } virtual uint32 sort_length() const { return pack_length(); } + + /** + Get the maximum size of the data in packed format. + + @return Maximum data length of the field when packed using the + Field::pack() function. + */ + virtual uint32 max_data_length() const { + return pack_length(); + }; + virtual int reset(void) { bzero(ptr,pack_length()); return 0; } virtual void reset_fields() {} virtual void set_default() @@ -358,32 +369,45 @@ public: return str; } virtual bool send_binary(Protocol *protocol); - virtual uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0) + + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, bool low_byte_first); + /** + @overload Field::pack(uchar*, const uchar*, uint, bool) + */ + uchar *pack(uchar *to, const uchar *from) { - uint32 length=pack_length(); - memcpy(to,from,length); - return to+length; + DBUG_ENTER("Field::pack"); + uchar *result= this->pack(to, from, UINT_MAX, table->s->db_low_byte_first); + DBUG_RETURN(result); } - virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data); - virtual const uchar *unpack(uchar* to, const uchar *from) + + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first); + /** + @overload Field::unpack(uchar*, const uchar*, uint, bool) + */ + const uchar *unpack(uchar* to, const uchar *from) { - uint length=pack_length(); - memcpy(to,from,length); - return from+length; + DBUG_ENTER("Field::unpack"); + const uchar *result= unpack(to, from, 0U, table->s->db_low_byte_first); + DBUG_RETURN(result); } - virtual uchar *pack_key(uchar* to, const uchar *from, uint max_length) + + virtual uchar *pack_key(uchar* to, const uchar *from, + uint max_length, bool low_byte_first) { - return pack(to,from,max_length); + return pack(to, from, max_length, low_byte_first); } virtual uchar *pack_key_from_key_image(uchar* to, const uchar *from, - uint max_length) + uint max_length, bool low_byte_first) { - return pack(to,from,max_length); + return pack(to, from, max_length, low_byte_first); } virtual const uchar *unpack_key(uchar* to, const uchar *from, - uint max_length) + uint max_length, bool low_byte_first) { - return unpack(to,from); + return unpack(to, from, max_length, low_byte_first); } virtual uint packed_col_length(const uchar *to, uint length) { return length;} @@ -568,6 +592,7 @@ public: {} int store_decimal(const my_decimal *d); + uint32 max_data_length() const; }; /* base class for float and double and decimal (old one) */ @@ -588,6 +613,10 @@ public: int truncate(double *nr, double max_length); uint32 max_display_length() { return field_length; } uint size_of() const { return sizeof(*this); } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first); + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, bool low_byte_first); }; @@ -616,6 +645,16 @@ public: void overflow(bool negative); bool zero_pack() const { return 0; } void sql_type(String &str) const; + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first) + { + return Field::unpack(to, from, param_data, low_byte_first); + } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, bool low_byte_first) + { + return Field::pack(to, from, max_length, low_byte_first); + } }; @@ -666,7 +705,8 @@ public: uint row_pack_length() { return pack_length(); } int compatible_field_size(uint field_metadata); uint is_equal(Create_field *new_field); - virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data); + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first); }; @@ -697,6 +737,20 @@ public: uint32 pack_length() const { return 1; } void sql_type(String &str) const; uint32 max_display_length() { return 4; } + + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, bool low_byte_first) + { + *to= *from; + return to + 1; + } + + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first) + { + *to= *from; + return from + 1; + } }; @@ -732,8 +786,47 @@ public: uint32 pack_length() const { return 2; } void sql_type(String &str) const; uint32 max_display_length() { return 6; } -}; + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, bool low_byte_first) + { + int16 val; +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + val = sint2korr(from); + else +#endif + shortget(val, from); + +#ifdef WORDS_BIGENDIAN + if (low_byte_first) + int2store(to, val); + else +#endif + shortstore(to, val); + return to + sizeof(val); + } + + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first) + { + int16 val; +#ifdef WORDS_BIGENDIAN + if (low_byte_first) + val = sint2korr(from); + else +#endif + shortget(val, from); + +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + int2store(to, val); + else +#endif + shortstore(to, val); + return from + sizeof(val); + } +}; class Field_medium :public Field_num { public: @@ -762,6 +855,18 @@ public: uint32 pack_length() const { return 3; } void sql_type(String &str) const; uint32 max_display_length() { return 8; } + + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, bool low_byte_first) + { + return Field::pack(to, from, max_length, low_byte_first); + } + + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first) + { + return Field::unpack(to, from, param_data, low_byte_first); + } }; @@ -797,6 +902,45 @@ public: uint32 pack_length() const { return 4; } void sql_type(String &str) const; uint32 max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, bool low_byte_first) + { + int32 val; +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + val = sint4korr(from); + else +#endif + longget(val, from); + +#ifdef WORDS_BIGENDIAN + if (low_byte_first) + int4store(to, val); + else +#endif + longstore(to, val); + return to + sizeof(val); + } + + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first) + { + int32 val; +#ifdef WORDS_BIGENDIAN + if (low_byte_first) + val = sint4korr(from); + else +#endif + longget(val, from); + +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + int4store(to, val); + else +#endif + longstore(to, val); + return from + sizeof(val); + } }; @@ -839,6 +983,45 @@ public: void sql_type(String &str) const; bool can_be_compared_as_longlong() const { return TRUE; } uint32 max_display_length() { return 20; } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, bool low_byte_first) + { + int64 val; +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + val = sint8korr(from); + else +#endif + longlongget(val, from); + +#ifdef WORDS_BIGENDIAN + if (low_byte_first) + int8store(to, val); + else +#endif + longlongstore(to, val); + return to + sizeof(val); + } + + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first) + { + int64 val; +#ifdef WORDS_BIGENDIAN + if (low_byte_first) + val = sint8korr(from); + else +#endif + longlongget(val, from); + +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + int8store(to, val); + else +#endif + longlongstore(to, val); + return from + sizeof(val); + } }; #endif @@ -1219,9 +1402,10 @@ public: int cmp(const uchar *,const uchar *); void sort_string(uchar *buff,uint length); void sql_type(String &str) const; - uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0); - virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data); - const uchar *unpack(uchar* to, const uchar *from); + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, bool low_byte_first); + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first); uint pack_length_from_metadata(uint field_metadata) { return (field_metadata & 0x00ff); } uint row_pack_length() { return (field_length + 1); } @@ -1299,13 +1483,15 @@ public: uint get_key_image(uchar *buff,uint length, imagetype type); void set_key_image(const uchar *buff,uint length); void sql_type(String &str) const; - uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0); - uchar *pack_key(uchar *to, const uchar *from, uint max_length); + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, bool low_byte_first); + uchar *pack_key(uchar *to, const uchar *from, uint max_length, bool low_byte_first); uchar *pack_key_from_key_image(uchar* to, const uchar *from, - uint max_length); - virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data); - const uchar *unpack(uchar* to, const uchar *from); - const uchar *unpack_key(uchar* to, const uchar *from, uint max_length); + uint max_length, bool low_byte_first); + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, bool low_byte_first); + const uchar *unpack_key(uchar* to, const uchar *from, + uint max_length, bool low_byte_first); int pack_cmp(const uchar *a, const uchar *b, uint key_length, my_bool insert_or_update); int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update); @@ -1398,7 +1584,7 @@ public: { return (uint32) (packlength); } uint row_pack_length() { return pack_length_no_ptr(); } uint32 sort_length() const; - inline uint32 max_data_length() const + virtual uint32 max_data_length() const { return (uint32) (((ulonglong) 1 << (packlength*8)) -1); } @@ -1426,13 +1612,13 @@ public: @returns The length in the row plus the size of the data. */ uint32 get_packed_size(const uchar *ptr_arg, bool low_byte_first) - {return packlength + get_length(ptr_arg, low_byte_first);} + {return packlength + get_length(ptr_arg, packlength, low_byte_first);} inline uint32 get_length(uint row_offset= 0) - { return get_length(ptr+row_offset, table->s->db_low_byte_first); } - uint32 get_length(const uchar *ptr, bool low_byte_first); + { return get_length(ptr+row_offset, this->packlength, table->s->db_low_byte_first); } + uint32 get_length(const uchar *ptr, uint packlength, bool low_byte_first); uint32 get_length(const uchar *ptr_arg) - { return get_length(ptr_arg, table->s->db_low_byte_first); } + { return get_length(ptr_arg, this->packlength, table->s->db_low_byte_first); } void put_length(uchar *pos, uint32 length); inline void get_ptr(uchar **str) { @@ -1473,13 +1659,16 @@ public: memcpy_fixed(ptr+packlength,&tmp,sizeof(char*)); return 0; } - uchar *pack(uchar *to, const uchar *from, uint max_length= ~(uint) 0); - uchar *pack_key(uchar *to, const uchar *from, uint max_length); + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, bool low_byte_first); + uchar *pack_key(uchar *to, const uchar *from, + uint max_length, bool low_byte_first); uchar *pack_key_from_key_image(uchar* to, const uchar *from, - uint max_length); - virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data); - const uchar *unpack(uchar *to, const uchar *from); - const uchar *unpack_key(uchar* to, const uchar *from, uint max_length); + uint max_length, bool low_byte_first); + virtual const uchar *unpack(uchar *to, const uchar *from, + uint param_data, bool low_byte_first); + const uchar *unpack_key(uchar* to, const uchar *from, + uint max_length, bool low_byte_first); int pack_cmp(const uchar *a, const uchar *b, uint key_length, my_bool insert_or_update); int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update); @@ -1631,6 +1820,7 @@ public: enum_field_types type() const { return MYSQL_TYPE_BIT; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_BIT; } uint32 key_length() const { return (uint32) (field_length + 7) / 8; } + uint32 max_data_length() const { return (field_length + 7) / 8; } uint32 max_display_length() { return field_length; } uint size_of() const { return sizeof(*this); } Item_result result_type () const { return INT_RESULT; } @@ -1672,9 +1862,10 @@ public: { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); } int compatible_field_size(uint field_metadata); void sql_type(String &str) const; - uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0); - virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data); - const uchar *unpack(uchar* to, const uchar *from); + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, bool low_byte_first); + virtual const uchar *unpack(uchar *to, const uchar *from, + uint param_data, bool low_byte_first); virtual void set_default(); Field *new_key_field(MEM_ROOT *root, struct st_table *new_table, diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 55af0c38aed..be75eff2575 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -321,7 +321,7 @@ ndbcluster_binlog_open_table(THD *thd, NDB_SHARE *share, DBUG_ENTER("ndbcluster_binlog_open_table"); safe_mutex_assert_owner(&LOCK_open); - init_tmp_table_share(table_share, share->db, 0, share->table_name, + init_tmp_table_share(thd, table_share, share->db, 0, share->table_name, share->key); if ((error= open_table_def(thd, table_share, 0))) { diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 76668a5b810..a792d5c4161 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1531,6 +1531,14 @@ int ha_partition::copy_partitions(ulonglong *copied, ulonglong *deleted) longlong func_value; DBUG_ENTER("ha_partition::copy_partitions"); + if (m_part_info->linear_hash_ind) + { + if (m_part_info->part_type == HASH_PARTITION) + set_linear_hash_mask(m_part_info, m_part_info->no_parts); + else + set_linear_hash_mask(m_part_info, m_part_info->no_subparts); + } + while (reorg_part < m_reorged_parts) { handler *file= m_reorged_file[reorg_part]; @@ -3990,7 +3998,8 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same) } else if (!(error= file->index_next(buf))) { - if (compare_key(end_range) <= 0) + if (!(file->table_flags() & HA_READ_ORDER) || + compare_key(end_range) <= 0) { m_last_part= m_part_spec.start_part; DBUG_RETURN(0); // Row was in range @@ -4067,7 +4076,8 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf) } if (!error) { - if (compare_key(end_range) <= 0) + if (!(file->table_flags() & HA_READ_ORDER) || + compare_key(end_range) <= 0) { m_last_part= i; DBUG_RETURN(0); diff --git a/sql/handler.cc b/sql/handler.cc index 8a2355c8a87..a4926071598 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2643,7 +2643,7 @@ int ha_create_table(THD *thd, const char *path, TABLE_SHARE share; DBUG_ENTER("ha_create_table"); - init_tmp_table_share(&share, db, 0, table_name, path); + init_tmp_table_share(thd, &share, db, 0, table_name, path); if (open_table_def(thd, &share, 0) || open_table_from_share(thd, &share, "", 0, (uint) READ_ALL, 0, &table, TRUE)) @@ -2709,7 +2709,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) if (error) DBUG_RETURN(2); - init_tmp_table_share(&share, db, 0, name, path); + init_tmp_table_share(thd, &share, db, 0, name, path); if (open_table_def(thd, &share, 0)) { DBUG_RETURN(3); @@ -3717,11 +3717,12 @@ int handler::ha_reset() int handler::ha_write_row(uchar *buf) { int error; + DBUG_ENTER("handler::ha_write_row"); if (unlikely(error= write_row(buf))) - return error; + DBUG_RETURN(error); if (unlikely(error= binlog_log_row<Write_rows_log_event>(table, 0, buf))) - return error; - return 0; + DBUG_RETURN(error); /* purecov: inspected */ + DBUG_RETURN(0); } diff --git a/sql/handler.h b/sql/handler.h index b91d8a39b88..140b44704a9 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1637,13 +1637,22 @@ public: virtual int repair_partitions(THD *thd) { return HA_ERR_WRONG_COMMAND; } - /* lock_count() can be more than one if the table is a MERGE */ + /** + @note lock_count() can return > 1 if the table is MERGE or partitioned. + */ virtual uint lock_count(void) const { return 1; } /** Is not invoked for non-transactional temporary tables. + @note store_lock() can return more than one lock if the table is MERGE + or partitioned. + @note that one can NOT rely on table->in_use in store_lock(). It may refer to a different thread if called from mysql_lock_abort_for_thread(). + + @note If the table is MERGE, store_lock() can return less locks + than lock_count() claimed. This can happen when the MERGE children + are not attached when this is called from another thread. */ virtual THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, diff --git a/sql/item.cc b/sql/item.cc index 108dddc8939..ede92253f80 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1240,7 +1240,17 @@ bool Item_name_const::is_null() Item::Type Item_name_const::type() const { - return value_item->type(); + /* + As + 1. one can try to create the Item_name_const passing non-constant + arguments, although it's incorrect and + 2. the type() method can be called before the fix_fields() to get + type information for a further type cast, e.g. + if (item->type() == FIELD_ITEM) + ((Item_field *) item)->... + we return NULL_ITEM in the case to avoid wrong casting. + */ + return valid_args ? value_item->type() : NULL_ITEM; } diff --git a/sql/item.h b/sql/item.h index 7693a2ffec7..b98389bc8d4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1242,11 +1242,13 @@ class Item_name_const : public Item { Item *value_item; Item *name_item; + bool valid_args; public: Item_name_const(Item *name_arg, Item *val): value_item(val), name_item(name_arg) { - if(!value_item->basic_const_item()) + if (!(valid_args= name_item->basic_const_item() & + value_item->basic_const_item())) my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST"); Item::maybe_null= TRUE; } @@ -2627,10 +2629,19 @@ protected: For all other uses of Item_cache, cached_field doesn't matter. */ Field *cached_field; + enum enum_field_types cached_field_type; public: - Item_cache(): example(0), used_table_map(0), cached_field(0) + Item_cache(): + example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING) { - fixed= 1; null_value= 1; + fixed= 1; + null_value= 1; + } + Item_cache(enum_field_types field_type_arg): + example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg) + { + fixed= 1; + null_value= 1; } void set_used_tables(table_map map) { used_table_map= map; } @@ -2649,6 +2660,7 @@ public: }; virtual void store(Item *)= 0; enum Type type() const { return CACHE_ITEM; } + enum_field_types field_type() const { return cached_field_type; } static Item_cache* get_cache(const Item *item); table_map used_tables() const { return used_table_map; } virtual void keep_array() {} @@ -2672,6 +2684,8 @@ protected: longlong value; public: Item_cache_int(): Item_cache(), value(0) {} + Item_cache_int(enum_field_types field_type_arg): + Item_cache(field_type_arg), value(0) {} void store(Item *item); void store(Item *item, longlong val_arg); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 94e24e51df5..00ae23fdb2b 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -949,12 +949,15 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg, { value= item->val_int(); *is_null= item->null_value; + enum_field_types f_type= item->field_type(); /* Item_date_add_interval may return MYSQL_TYPE_STRING as the result field type. To detect that the DATE value has been returned we - compare it with 1000000L - any DATE value should be less than it. + compare it with 100000000L - any DATE value should be less than it. + Don't shift cached DATETIME values up for the second time. */ - if (item->field_type() == MYSQL_TYPE_DATE || value < 100000000L) + if (f_type == MYSQL_TYPE_DATE || + (f_type != MYSQL_TYPE_DATETIME && value < 100000000L)) value*= 1000000L; } else @@ -991,7 +994,7 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg, if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM || ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC)) { - Item_cache_int *cache= new Item_cache_int(); + Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME); /* Mark the cache as non-const to prevent re-caching. */ cache->set_used_tables(1); cache->store(item, value); @@ -1707,26 +1710,29 @@ bool Item_func_opt_neg::eq(const Item *item, bool binary_cmp) const void Item_func_interval::fix_length_and_dec() { + uint rows= row->cols(); + use_decimal_comparison= ((row->element_index(0)->result_type() == DECIMAL_RESULT) || (row->element_index(0)->result_type() == INT_RESULT)); - if (row->cols() > 8) + if (rows > 8) { - bool consts=1; + bool not_null_consts= TRUE; - for (uint i=1 ; consts && i < row->cols() ; i++) + for (uint i= 1; not_null_consts && i < rows; i++) { - consts&= row->element_index(i)->const_item(); + Item *el= row->element_index(i); + not_null_consts&= el->const_item() & !el->is_null(); } - if (consts && + if (not_null_consts && (intervals= - (interval_range*) sql_alloc(sizeof(interval_range)*(row->cols()-1)))) + (interval_range*) sql_alloc(sizeof(interval_range) * (rows - 1)))) { if (use_decimal_comparison) { - for (uint i=1 ; i < row->cols(); i++) + for (uint i= 1; i < rows; i++) { Item *el= row->element_index(i); interval_range *range= intervals + (i-1); @@ -1751,7 +1757,7 @@ void Item_func_interval::fix_length_and_dec() } else { - for (uint i=1 ; i < row->cols(); i++) + for (uint i= 1; i < rows; i++) { intervals[i-1].dbl= row->element_index(i)->val_real(); } @@ -1842,12 +1848,22 @@ longlong Item_func_interval::val_int() ((el->result_type() == DECIMAL_RESULT) || (el->result_type() == INT_RESULT))) { - my_decimal e_dec_buf, *e_dec= row->element_index(i)->val_decimal(&e_dec_buf); + my_decimal e_dec_buf, *e_dec= el->val_decimal(&e_dec_buf); + /* Skip NULL ranges. */ + if (el->null_value) + continue; if (my_decimal_cmp(e_dec, dec) > 0) - return i-1; + return i - 1; + } + else + { + double val= el->val_real(); + /* Skip NULL ranges. */ + if (el->null_value) + continue; + if (val > value) + return i - 1; } - else if (row->element_index(i)->val_real() > value) - return i-1; } return i-1; } @@ -2626,6 +2642,23 @@ bool Item_func_case::fix_fields(THD *thd, Item **ref) } +void Item_func_case::agg_str_lengths(Item* arg) +{ + set_if_bigger(max_length, arg->max_length); + set_if_bigger(decimals, arg->decimals); + unsigned_flag= unsigned_flag && arg->unsigned_flag; +} + + +void Item_func_case::agg_num_lengths(Item *arg) +{ + uint len= my_decimal_length_to_precision(arg->max_length, arg->decimals, + arg->unsigned_flag) - arg->decimals; + set_if_bigger(max_length, len); + set_if_bigger(decimals, arg->decimals); + unsigned_flag= unsigned_flag && arg->unsigned_flag; +} + void Item_func_case::fix_length_and_dec() { @@ -2689,15 +2722,22 @@ void Item_func_case::fix_length_and_dec() max_length=0; decimals=0; - for (uint i=0 ; i < ncases ; i+=2) + unsigned_flag= TRUE; + if (cached_result_type == STRING_RESULT) { - set_if_bigger(max_length,args[i+1]->max_length); - set_if_bigger(decimals,args[i+1]->decimals); + for (uint i= 0; i < ncases; i+= 2) + agg_str_lengths(args[i + 1]); + if (else_expr_num != -1) + agg_str_lengths(args[else_expr_num]); } - if (else_expr_num != -1) + else { - set_if_bigger(max_length,args[else_expr_num]->max_length); - set_if_bigger(decimals,args[else_expr_num]->decimals); + for (uint i= 0; i < ncases; i+= 2) + agg_num_lengths(args[i + 1]); + if (else_expr_num != -1) + agg_num_lengths(args[else_expr_num]); + max_length= my_decimal_precision_to_length(max_length + decimals, decimals, + unsigned_flag); } } @@ -2901,7 +2941,7 @@ static inline int cmp_ulongs (ulonglong a_val, ulonglong b_val) SYNOPSIS cmp_longlong() - cmp_arg an argument passed to the calling function (qsort2) + cmp_arg an argument passed to the calling function (my_qsort2) a left argument b right argument @@ -4410,6 +4450,51 @@ void Item_func_like::cleanup() #ifdef USE_REGEX bool +Item_func_regex::regcomp(bool send_error) +{ + char buff[MAX_FIELD_WIDTH]; + String tmp(buff,sizeof(buff),&my_charset_bin); + String *res= args[1]->val_str(&tmp); + int error; + + if (args[1]->null_value) + return TRUE; + + if (regex_compiled) + { + if (!stringcmp(res, &prev_regexp)) + return FALSE; + prev_regexp.copy(*res); + my_regfree(&preg); + regex_compiled= 0; + } + + if (cmp_collation.collation != regex_lib_charset) + { + /* Convert UCS2 strings to UTF8 */ + uint dummy_errors; + if (conv.copy(res->ptr(), res->length(), res->charset(), + regex_lib_charset, &dummy_errors)) + return TRUE; + res= &conv; + } + + if ((error= my_regcomp(&preg, res->c_ptr_safe(), + regex_lib_flags, regex_lib_charset))) + { + if (send_error) + { + (void) my_regerror(error, &preg, buff, sizeof(buff)); + my_error(ER_REGEXP_ERROR, MYF(0), buff); + } + return TRUE; + } + regex_compiled= 1; + return FALSE; +} + + +bool Item_func_regex::fix_fields(THD *thd, Item **ref) { DBUG_ASSERT(fixed == 0); @@ -4425,35 +4510,34 @@ Item_func_regex::fix_fields(THD *thd, Item **ref) if (agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV, 1)) return TRUE; + regex_lib_flags= (cmp_collation.collation->state & + (MY_CS_BINSORT | MY_CS_CSSORT)) ? + REG_EXTENDED | REG_NOSUB : + REG_EXTENDED | REG_NOSUB | REG_ICASE; + /* + If the case of UCS2 and other non-ASCII character sets, + we will convert patterns and strings to UTF8. + */ + regex_lib_charset= (cmp_collation.collation->mbminlen > 1) ? + &my_charset_utf8_general_ci : + cmp_collation.collation; + used_tables_cache=args[0]->used_tables() | args[1]->used_tables(); not_null_tables_cache= (args[0]->not_null_tables() | args[1]->not_null_tables()); const_item_cache=args[0]->const_item() && args[1]->const_item(); if (!regex_compiled && args[1]->const_item()) { - char buff[MAX_FIELD_WIDTH]; - String tmp(buff,sizeof(buff),&my_charset_bin); - String *res=args[1]->val_str(&tmp); if (args[1]->null_value) { // Will always return NULL maybe_null=1; fixed= 1; return FALSE; } - int error; - if ((error= my_regcomp(&preg,res->c_ptr(), - ((cmp_collation.collation->state & - (MY_CS_BINSORT | MY_CS_CSSORT)) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE), - cmp_collation.collation))) - { - (void) my_regerror(error,&preg,buff,sizeof(buff)); - my_error(ER_REGEXP_ERROR, MYF(0), buff); + if (regcomp(TRUE)) return TRUE; - } - regex_compiled=regex_is_const=1; - maybe_null=args[0]->maybe_null; + regex_is_const= 1; + maybe_null= args[0]->maybe_null; } else maybe_null=1; @@ -4466,47 +4550,25 @@ longlong Item_func_regex::val_int() { DBUG_ASSERT(fixed == 1); char buff[MAX_FIELD_WIDTH]; - String *res, tmp(buff,sizeof(buff),&my_charset_bin); + String tmp(buff,sizeof(buff),&my_charset_bin); + String *res= args[0]->val_str(&tmp); - res=args[0]->val_str(&tmp); - if (args[0]->null_value) - { - null_value=1; + if ((null_value= (args[0]->null_value || + (!regex_is_const && regcomp(FALSE))))) return 0; - } - if (!regex_is_const) - { - char buff2[MAX_FIELD_WIDTH]; - String *res2, tmp2(buff2,sizeof(buff2),&my_charset_bin); - res2= args[1]->val_str(&tmp2); - if (args[1]->null_value) + if (cmp_collation.collation != regex_lib_charset) + { + /* Convert UCS2 strings to UTF8 */ + uint dummy_errors; + if (conv.copy(res->ptr(), res->length(), res->charset(), + regex_lib_charset, &dummy_errors)) { - null_value=1; + null_value= 1; return 0; } - if (!regex_compiled || stringcmp(res2,&prev_regexp)) - { - prev_regexp.copy(*res2); - if (regex_compiled) - { - my_regfree(&preg); - regex_compiled=0; - } - if (my_regcomp(&preg,res2->c_ptr_safe(), - ((cmp_collation.collation->state & - (MY_CS_BINSORT | MY_CS_CSSORT)) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE), - cmp_collation.collation)) - { - null_value=1; - return 0; - } - regex_compiled=1; - } + res= &conv; } - null_value=0; return my_regexec(&preg,res->c_ptr_safe(),0,(my_regmatch_t*) 0,0) ? 0 : 1; } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index e9aeef7fc3e..188d87a69ca 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -742,7 +742,7 @@ public: virtual uchar *get_value(Item *item)=0; void sort() { - qsort2(base,used_count,size,compare,collation); + my_qsort2(base,used_count,size,compare,collation); } int find(Item *item); @@ -1145,6 +1145,8 @@ public: Item *find_item(String *str); CHARSET_INFO *compare_collation() { return cmp_collation.collation; } void cleanup(); + void agg_str_lengths(Item *arg); + void agg_num_lengths(Item *arg); }; /* @@ -1382,6 +1384,10 @@ class Item_func_regex :public Item_bool_func bool regex_is_const; String prev_regexp; DTCollation cmp_collation; + CHARSET_INFO *regex_lib_charset; + int regex_lib_flags; + String conv; + bool regcomp(bool send_error); public: Item_func_regex(Item *a,Item *b) :Item_bool_func(a,b), regex_compiled(0),regex_is_const(0) {} diff --git a/sql/item_func.cc b/sql/item_func.cc index 41de960a37e..c89474f46b3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3727,13 +3727,12 @@ longlong Item_func_sleep::val_int() break; error= 0; } - + pthread_mutex_unlock(&LOCK_user_locks); pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; thd->mysys_var->current_cond= 0; pthread_mutex_unlock(&thd->mysys_var->mutex); - pthread_mutex_unlock(&LOCK_user_locks); pthread_cond_destroy(&cond); return test(!error); // Return 1 killed diff --git a/sql/item_func.h b/sql/item_func.h index 87894810b7f..e09b584de95 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -789,7 +789,7 @@ public: max_length= args[0]->max_length; decimals=args[0]->decimals; /* The item could be a NULL constant. */ - null_value= args[0]->null_value; + null_value= args[0]->is_null(); } }; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 03c65c9d654..a7624c5bbcd 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -356,10 +356,35 @@ String *Item_func_concat::val_str(String *str) } else { // Two big const strings - if (tmp_value.alloc(max_length) || - tmp_value.copy(*res) || - tmp_value.append(*res2)) + /* + NOTE: We should be prudent in the initial allocation unit -- the + size of the arguments is a function of data distribution, which + can be any. Instead of overcommitting at the first row, we grow + the allocated amount by the factor of 2. This ensures that no + more than 25% of memory will be overcommitted on average. + */ + + uint concat_len= res->length() + res2->length(); + + if (tmp_value.alloced_length() < concat_len) + { + if (tmp_value.alloced_length() == 0) + { + if (tmp_value.alloc(concat_len)) + goto null; + } + else + { + uint new_len = max(tmp_value.alloced_length() * 2, concat_len); + + if (tmp_value.realloc(new_len)) + goto null; + } + } + + if (tmp_value.copy(*res) || tmp_value.append(*res2)) goto null; + res= &tmp_value; use_as_buff=str; } @@ -679,8 +704,33 @@ String *Item_func_concat_ws::val_str(String *str) } else { // Two big const strings - if (tmp_value.alloc(max_length) || - tmp_value.copy(*res) || + /* + NOTE: We should be prudent in the initial allocation unit -- the + size of the arguments is a function of data distribution, which can + be any. Instead of overcommitting at the first row, we grow the + allocated amount by the factor of 2. This ensures that no more than + 25% of memory will be overcommitted on average. + */ + + uint concat_len= res->length() + sep_str->length() + res2->length(); + + if (tmp_value.alloced_length() < concat_len) + { + if (tmp_value.alloced_length() == 0) + { + if (tmp_value.alloc(concat_len)) + goto null; + } + else + { + uint new_len = max(tmp_value.alloced_length() * 2, concat_len); + + if (tmp_value.realloc(new_len)) + goto null; + } + } + + if (tmp_value.copy(*res) || tmp_value.append(*sep_str) || tmp_value.append(*res2)) goto null; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 3608568bd5e..0d7cd66acff 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -657,7 +657,12 @@ public: } String* val_str(String* str); const char *func_name() const { return "inet_ntoa"; } - void fix_length_and_dec() { decimals = 0; max_length=3*8+7; maybe_null=1;} + void fix_length_and_dec() + { + decimals= 0; + max_length= 3 * 8 + 7; + maybe_null= 1; + } }; class Item_func_quote :public Item_str_func diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index e7d513e9d6a..3d4a6de83ac 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -3241,38 +3241,42 @@ get_date_time_result_type(const char *format, uint length) void Item_func_str_to_date::fix_length_and_dec() { - char format_buff[64]; - String format_str(format_buff, sizeof(format_buff), &my_charset_bin), *format; maybe_null= 1; decimals=0; cached_field_type= MYSQL_TYPE_DATETIME; max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; cached_timestamp_type= MYSQL_TIMESTAMP_NONE; - format= args[1]->val_str(&format_str); - if (!args[1]->null_value && (const_item= args[1]->const_item())) + if ((const_item= args[1]->const_item())) { - cached_format_type= get_date_time_result_type(format->ptr(), - format->length()); - switch (cached_format_type) { - case DATE_ONLY: - cached_timestamp_type= MYSQL_TIMESTAMP_DATE; - cached_field_type= MYSQL_TYPE_DATE; - max_length= MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; - break; - case TIME_ONLY: - case TIME_MICROSECOND: - cached_timestamp_type= MYSQL_TIMESTAMP_TIME; - cached_field_type= MYSQL_TYPE_TIME; - max_length= MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; - break; - default: - cached_timestamp_type= MYSQL_TIMESTAMP_DATETIME; - cached_field_type= MYSQL_TYPE_DATETIME; - break; + char format_buff[64]; + String format_str(format_buff, sizeof(format_buff), &my_charset_bin); + String *format= args[1]->val_str(&format_str); + if (!args[1]->null_value) + { + cached_format_type= get_date_time_result_type(format->ptr(), + format->length()); + switch (cached_format_type) { + case DATE_ONLY: + cached_timestamp_type= MYSQL_TIMESTAMP_DATE; + cached_field_type= MYSQL_TYPE_DATE; + max_length= MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN; + break; + case TIME_ONLY: + case TIME_MICROSECOND: + cached_timestamp_type= MYSQL_TIMESTAMP_TIME; + cached_field_type= MYSQL_TYPE_TIME; + max_length= MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN; + break; + default: + cached_timestamp_type= MYSQL_TIMESTAMP_DATETIME; + cached_field_type= MYSQL_TYPE_DATETIME; + break; + } } } } + bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date) { DATE_TIME_FORMAT date_time_format; diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 1a6c15a4d2e..68d85418324 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -2612,35 +2612,27 @@ typedef struct uint level; String *pxml; // parsed XML uint pos[MAX_LEVEL]; // Tag position stack + uint parent; // Offset of the parent of the current node } MY_XML_USER_DATA; -/* - Find the parent node - - SYNOPSYS - Find the parent node, i.e. a tag or attrubute node on the given level. - - RETURN - 1 - success - 0 - failure -*/ -static uint xml_parent_tag(MY_XML_NODE *items, uint nitems, uint level) +static bool +append_node(String *str, MY_XML_NODE *node) { - if (!nitems) - return 0; - - MY_XML_NODE *p, *last= &items[nitems-1]; - for (p= last; p >= items; p--) - { - if (p->level == level && - (p->type == MY_XML_NODE_TAG || - p->type == MY_XML_NODE_ATTR)) - { - return p - items; - } - } - return 0; + /* + If "str" doesn't have space for a new node, + it will allocate two times more space that it has had so far. + (2*len+512) is a heuristic value, + which gave the best performance during tests. + The ideas behind this formula are: + - It allows to have a very small number of reallocs: + about 10 reallocs on a 1Mb-long XML value. + - At the same time, it avoids excessive memory use. + */ + if (str->reserve(sizeof(MY_XML_NODE), 2 * str->length() + 512)) + return TRUE; + str->q_append((const char*) node, sizeof(MY_XML_NODE)); + return FALSE; } @@ -2662,19 +2654,17 @@ extern "C" int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len); int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len) { MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data; - MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr(); uint numnodes= data->pxml->length() / sizeof(MY_XML_NODE); - uint parent= xml_parent_tag(nodes, numnodes, data->level - 1); MY_XML_NODE node; + node.parent= data->parent; // Set parent for the new node to old parent + data->parent= numnodes; // Remember current node as new parent data->pos[data->level]= numnodes; node.level= data->level++; node.type= st->current_node_type; // TAG or ATTR node.beg= attr; node.end= attr + len; - node.parent= parent; - data->pxml->append((const char*) &node, sizeof(MY_XML_NODE)); - return MY_XML_OK; + return append_node(data->pxml, &node) ? MY_XML_ERROR : MY_XML_OK; } @@ -2695,18 +2685,14 @@ extern "C" int xml_value(MY_XML_PARSER *st,const char *attr, size_t len); int xml_value(MY_XML_PARSER *st,const char *attr, size_t len) { MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data; - MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr(); - uint numnodes= data->pxml->length() / sizeof(MY_XML_NODE); - uint parent= xml_parent_tag(nodes, numnodes, data->level - 1); MY_XML_NODE node; + node.parent= data->parent; // Set parent for the new text node to old parent node.level= data->level; node.type= MY_XML_NODE_TEXT; node.beg= attr; node.end= attr + len; - node.parent= parent; - data->pxml->append((const char*) &node, sizeof(MY_XML_NODE)); - return MY_XML_OK; + return append_node(data->pxml, &node) ? MY_XML_ERROR : MY_XML_OK; } @@ -2731,6 +2717,7 @@ int xml_leave(MY_XML_PARSER *st,const char *attr, size_t len) data->level--; MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr(); + data->parent= nodes[data->parent].parent; nodes+= data->pos[data->level]; nodes->tagend= st->cur; @@ -2761,6 +2748,7 @@ String *Item_xml_str_func::parse_xml(String *raw_xml, String *parsed_xml_buf) p.flags= MY_XML_FLAG_RELATIVE_NAMES | MY_XML_FLAG_SKIP_TEXT_NORMALIZATION; user_data.level= 0; user_data.pxml= parsed_xml_buf; + user_data.parent= 0; my_xml_set_enter_handler(&p, xml_enter); my_xml_set_value_handler(&p, xml_value); my_xml_set_leave_handler(&p, xml_leave); diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h index 278c98baf7c..dadbb5ccf42 100644 --- a/sql/item_xmlfunc.h +++ b/sql/item_xmlfunc.h @@ -28,8 +28,16 @@ protected: String tmp_value, pxml; Item *nodeset_func; public: - Item_xml_str_func(Item *a, Item *b): Item_str_func(a,b) {} - Item_xml_str_func(Item *a, Item *b, Item *c): Item_str_func(a,b,c) {} + Item_xml_str_func(Item *a, Item *b): + Item_str_func(a,b) + { + maybe_null= TRUE; + } + Item_xml_str_func(Item *a, Item *b, Item *c): + Item_str_func(a,b,c) + { + maybe_null= TRUE; + } void fix_length_and_dec(); String *parse_xml(String *raw_xml, String *parsed_xml_buf); }; diff --git a/sql/lock.cc b/sql/lock.cc index 29a07858bc1..ef4a0cc3d83 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -847,9 +847,6 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, locks= locks_buf= sql_lock->locks= (THR_LOCK_DATA**) (sql_lock + 1); to= table_buf= sql_lock->table= (TABLE**) (locks + tables * 2); sql_lock->table_count=lock_count; - sql_lock->lock_count=tables; - DBUG_PRINT("info", ("sql_lock->table_count %d sql_lock->lock_count %d", - sql_lock->table_count, sql_lock->lock_count)); for (i=0 ; i < count ; i++) { @@ -889,6 +886,23 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, for ( ; org_locks != locks ; org_locks++) (*org_locks)->debug_print_param= (void *) table; } + /* + We do not use 'tables', because there are cases where store_lock() + returns less locks than lock_count() claimed. This can happen when + a FLUSH TABLES tries to abort locks from a MERGE table of another + thread. When that thread has just opened the table, but not yet + attached its children, it cannot return the locks. lock_count() + always returns the number of locks that an attached table has. + This is done to avoid the reverse situation: If lock_count() would + return 0 for a non-attached MERGE table, and that table becomes + attached between the calls to lock_count() and store_lock(), then + we would have allocated too little memory for the lock data. Now + we may allocate too much, but better safe than memory overrun. + And in the FLUSH case, the memory is released quickly anyway. + */ + sql_lock->lock_count= locks - locks_buf; + DBUG_PRINT("info", ("sql_lock->table_count %d sql_lock->lock_count %d", + sql_lock->table_count, sql_lock->lock_count)); DBUG_RETURN(sql_lock); } diff --git a/sql/log.cc b/sql/log.cc index 688ed03d5d1..9fdede9ef2c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2158,13 +2158,9 @@ const char *MYSQL_LOG::generate_name(const char *log_name, { if (!log_name || !log_name[0]) { - /* - TODO: The following should be using fn_format(); We just need to - first change fn_format() to cut the file name if it's too long. - */ - strmake(buff, pidfile_name, FN_REFLEN - 5); - strmov(fn_ext(buff), suffix); - return (const char *)buff; + strmake(buff, pidfile_name, FN_REFLEN - strlen(suffix) - 1); + return (const char *) + fn_format(buff, buff, "", suffix, MYF(MY_REPLACE_EXT|MY_REPLACE_DIR)); } // get rid of extension if the log is binary to avoid problems if (strip_ext) @@ -3569,9 +3565,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) (!binlog_filter->db_ok(local_db))) { VOID(pthread_mutex_unlock(&LOCK_log)); - DBUG_PRINT("info",("OPTION_BIN_LOG is %s, db_ok('%s') == %d", - (thd->options & OPTION_BIN_LOG) ? "set" : "clear", - local_db, binlog_filter->db_ok(local_db))); DBUG_RETURN(0); } #endif /* HAVE_REPLICATION */ diff --git a/sql/log.h b/sql/log.h index bef0101c8b5..20a1b7e8e6d 100644 --- a/sql/log.h +++ b/sql/log.h @@ -130,7 +130,13 @@ typedef struct st_log_info my_off_t pos; bool fatal; // if the purge happens to give us a negative offset pthread_mutex_t lock; - st_log_info():fatal(0) { pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST);} + st_log_info() + : index_file_offset(0), index_file_start_offset(0), + pos(0), fatal(0) + { + log_file_name[0] = '\0'; + pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST); + } ~st_log_info() { pthread_mutex_destroy(&lock);} } LOG_INFO; diff --git a/sql/log_event.cc b/sql/log_event.cc index a6d07e72033..2b3037aedcc 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -36,6 +36,64 @@ #define FLAGSTR(V,F) ((V)&(F)?#F" ":"") +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) && !defined(DBUG_OFF) && !defined(_lint) +static const char *HA_ERR(int i) +{ + switch (i) { + case HA_ERR_KEY_NOT_FOUND: return "HA_ERR_KEY_NOT_FOUND"; + case HA_ERR_FOUND_DUPP_KEY: return "HA_ERR_FOUND_DUPP_KEY"; + case HA_ERR_RECORD_CHANGED: return "HA_ERR_RECORD_CHANGED"; + case HA_ERR_WRONG_INDEX: return "HA_ERR_WRONG_INDEX"; + case HA_ERR_CRASHED: return "HA_ERR_CRASHED"; + case HA_ERR_WRONG_IN_RECORD: return "HA_ERR_WRONG_IN_RECORD"; + case HA_ERR_OUT_OF_MEM: return "HA_ERR_OUT_OF_MEM"; + case HA_ERR_NOT_A_TABLE: return "HA_ERR_NOT_A_TABLE"; + case HA_ERR_WRONG_COMMAND: return "HA_ERR_WRONG_COMMAND"; + case HA_ERR_OLD_FILE: return "HA_ERR_OLD_FILE"; + case HA_ERR_NO_ACTIVE_RECORD: return "HA_ERR_NO_ACTIVE_RECORD"; + case HA_ERR_RECORD_DELETED: return "HA_ERR_RECORD_DELETED"; + case HA_ERR_RECORD_FILE_FULL: return "HA_ERR_RECORD_FILE_FULL"; + case HA_ERR_INDEX_FILE_FULL: return "HA_ERR_INDEX_FILE_FULL"; + case HA_ERR_END_OF_FILE: return "HA_ERR_END_OF_FILE"; + case HA_ERR_UNSUPPORTED: return "HA_ERR_UNSUPPORTED"; + case HA_ERR_TO_BIG_ROW: return "HA_ERR_TO_BIG_ROW"; + case HA_WRONG_CREATE_OPTION: return "HA_WRONG_CREATE_OPTION"; + case HA_ERR_FOUND_DUPP_UNIQUE: return "HA_ERR_FOUND_DUPP_UNIQUE"; + case HA_ERR_UNKNOWN_CHARSET: return "HA_ERR_UNKNOWN_CHARSET"; + case HA_ERR_WRONG_MRG_TABLE_DEF: return "HA_ERR_WRONG_MRG_TABLE_DEF"; + case HA_ERR_CRASHED_ON_REPAIR: return "HA_ERR_CRASHED_ON_REPAIR"; + case HA_ERR_CRASHED_ON_USAGE: return "HA_ERR_CRASHED_ON_USAGE"; + case HA_ERR_LOCK_WAIT_TIMEOUT: return "HA_ERR_LOCK_WAIT_TIMEOUT"; + case HA_ERR_LOCK_TABLE_FULL: return "HA_ERR_LOCK_TABLE_FULL"; + case HA_ERR_READ_ONLY_TRANSACTION: return "HA_ERR_READ_ONLY_TRANSACTION"; + case HA_ERR_LOCK_DEADLOCK: return "HA_ERR_LOCK_DEADLOCK"; + case HA_ERR_CANNOT_ADD_FOREIGN: return "HA_ERR_CANNOT_ADD_FOREIGN"; + case HA_ERR_NO_REFERENCED_ROW: return "HA_ERR_NO_REFERENCED_ROW"; + case HA_ERR_ROW_IS_REFERENCED: return "HA_ERR_ROW_IS_REFERENCED"; + case HA_ERR_NO_SAVEPOINT: return "HA_ERR_NO_SAVEPOINT"; + case HA_ERR_NON_UNIQUE_BLOCK_SIZE: return "HA_ERR_NON_UNIQUE_BLOCK_SIZE"; + case HA_ERR_NO_SUCH_TABLE: return "HA_ERR_NO_SUCH_TABLE"; + case HA_ERR_TABLE_EXIST: return "HA_ERR_TABLE_EXIST"; + case HA_ERR_NO_CONNECTION: return "HA_ERR_NO_CONNECTION"; + case HA_ERR_NULL_IN_SPATIAL: return "HA_ERR_NULL_IN_SPATIAL"; + case HA_ERR_TABLE_DEF_CHANGED: return "HA_ERR_TABLE_DEF_CHANGED"; + case HA_ERR_NO_PARTITION_FOUND: return "HA_ERR_NO_PARTITION_FOUND"; + case HA_ERR_RBR_LOGGING_FAILED: return "HA_ERR_RBR_LOGGING_FAILED"; + case HA_ERR_DROP_INDEX_FK: return "HA_ERR_DROP_INDEX_FK"; + case HA_ERR_FOREIGN_DUPLICATE_KEY: return "HA_ERR_FOREIGN_DUPLICATE_KEY"; + case HA_ERR_TABLE_NEEDS_UPGRADE: return "HA_ERR_TABLE_NEEDS_UPGRADE"; + case HA_ERR_TABLE_READONLY: return "HA_ERR_TABLE_READONLY"; + case HA_ERR_AUTOINC_READ_FAILED: return "HA_ERR_AUTOINC_READ_FAILED"; + case HA_ERR_AUTOINC_ERANGE: return "HA_ERR_AUTOINC_ERANGE"; + case HA_ERR_GENERIC: return "HA_ERR_GENERIC"; + case HA_ERR_RECORD_IS_THE_SAME: return "HA_ERR_RECORD_IS_THE_SAME"; + case HA_ERR_LOGGING_IMPOSSIBLE: return "HA_ERR_LOGGING_IMPOSSIBLE"; + case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT"; + } + return "<unknown error>"; +} +#endif + /* Cache that will automatically be written to a dedicated file on destruction. @@ -114,6 +172,9 @@ private: flag_set m_flags; }; +#ifndef DBUG_OFF +uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation +#endif /* pretty_print_str() @@ -555,8 +616,32 @@ int Log_event::do_update_pos(Relay_log_info *rli) Matz: I don't think we will need this check with this refactoring. */ if (rli) - rli->stmt_done(log_pos, when); - + { + /* + bug#29309 simulation: resetting the flag to force + wrong behaviour of artificial event to update + rli->last_master_timestamp for only one time - + the first FLUSH LOGS in the test. + */ + DBUG_EXECUTE_IF("let_first_flush_log_change_timestamp", + if (debug_not_change_ts_if_art_event == 1 + && is_artificial_event()) + { + debug_not_change_ts_if_art_event= 0; + }); +#ifndef DBUG_OFF + rli->stmt_done(log_pos, + is_artificial_event() && + debug_not_change_ts_if_art_event > 0 ? 0 : when); +#else + rli->stmt_done(log_pos, is_artificial_event()? 0 : when); +#endif + DBUG_EXECUTE_IF("let_first_flush_log_change_timestamp", + if (debug_not_change_ts_if_art_event == 0) + { + debug_not_change_ts_if_art_event= 2; + }); + } return 0; // Cannot fail currently } @@ -570,7 +655,8 @@ Log_event::do_shall_skip(Relay_log_info *rli) (ulong) server_id, (ulong) ::server_id, rli->replicate_same_server_id, rli->slave_skip_counter)); - if (server_id == ::server_id && !rli->replicate_same_server_id) + if (server_id == ::server_id && !rli->replicate_same_server_id || + rli->slave_skip_counter == 1 && rli->is_in_group()) return EVENT_SKIP_IGNORE; else if (rli->slave_skip_counter > 0) return EVENT_SKIP_COUNT; @@ -1227,6 +1313,16 @@ void Log_event::print_timestamp(IO_CACHE* file, time_t* ts) #endif /* MYSQL_CLIENT */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) +inline Log_event::enum_skip_reason +Log_event::continue_group(Relay_log_info *rli) +{ + if (rli->slave_skip_counter == 1) + return Log_event::EVENT_SKIP_IGNORE; + return Log_event::do_shall_skip(rli); +} +#endif + /************************************************************************** Query_log_event methods **************************************************************************/ @@ -1290,6 +1386,11 @@ static void write_str_with_code_and_len(char **dst, const char *src, bool Query_log_event::write(IO_CACHE* file) { + /** + @todo if catalog can be of length FN_REFLEN==512, then we are not + replicating it correctly, since the length is stored in a byte + /sven + */ uchar buf[QUERY_HEADER_LEN+ 1+4+ // code of flags2 and flags2 1+8+ // code of sql_mode and sql_mode @@ -1516,6 +1617,10 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, time(&end_time); exec_time = (ulong) (end_time - thd_arg->start_time); + /** + @todo this means that if we have no catalog, then it is replicated + as an existing catalog of length zero. is that safe? /sven + */ catalog_len = (catalog) ? (uint32) strlen(catalog) : 0; /* status_vars_len is set just before writing the event */ db_len = (db) ? (uint32) strlen(db) : 0; @@ -1525,7 +1630,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, /* If we don't use flags2 for anything else than options contained in thd_arg->options, it would be more efficient to flags2=thd_arg->options - (OPTIONS_WRITTEN_TO_BINLOG would be used only at reading time). + (OPTIONS_WRITTEN_TO_BIN_LOG would be used only at reading time). But it's likely that we don't want to use 32 bits for 3 bits; in the future we will probably want to reclaim the 29 bits. So we need the &. */ @@ -1556,18 +1661,48 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, /* 2 utility functions for the next method */ -/* - Get the pointer for a string (src) that contains the length in - the first byte. Set the output string (dst) to the string value - and place the length of the string in the byte after the string. +/** + Read a string with length from memory. + + This function reads the string-with-length stored at + <code>src</code> and extract the length into <code>*len</code> and + a pointer to the start of the string into <code>*dst</code>. The + string can then be copied using <code>memcpy()</code> with the + number of bytes given in <code>*len</code>. + + @param src Pointer to variable holding a pointer to the memory to + read the string from. + @param dst Pointer to variable holding a pointer where the actual + string starts. Starting from this position, the string + can be copied using @c memcpy(). + @param len Pointer to variable where the length will be stored. + @param end One-past-the-end of the memory where the string is + stored. + + @return Zero if the entire string can be copied successfully, + @c UINT_MAX if the length could not be read from memory + (that is, if <code>*src >= end</code>), otherwise the + number of bytes that are missing to read the full + string, which happends <code>*dst + *len >= end</code>. */ -static void get_str_len_and_pointer(const Log_event::Byte **src, - const char **dst, - uint *len) -{ - if ((*len= **src)) - *dst= (char *)*src + 1; // Will be copied later - (*src)+= *len + 1; +static int +get_str_len_and_pointer(const Log_event::Byte **src, + const char **dst, + uint *len, + const Log_event::Byte *end) +{ + if (*src >= end) + return -1; // Will be UINT_MAX in two-complement arithmetics + uint length= **src; + if (length > 0) + { + if (*src + length >= end) + return *src + length - end + 1; // Number of bytes missing + *dst= (char *)*src + 1; // Will be copied later + } + *len= length; + *src+= length + 1; + return 0; } static void copy_str_and_move(const char **src, @@ -1580,6 +1715,46 @@ static void copy_str_and_move(const char **src, *(*dst)++= 0; } + +#ifndef DBUG_OFF +static char const * +code_name(int code) +{ + static char buf[255]; + switch (code) { + case Q_FLAGS2_CODE: return "Q_FLAGS2_CODE"; + case Q_SQL_MODE_CODE: return "Q_SQL_MODE_CODE"; + case Q_CATALOG_CODE: return "Q_CATALOG_CODE"; + case Q_AUTO_INCREMENT: return "Q_AUTO_INCREMENT"; + case Q_CHARSET_CODE: return "Q_CHARSET_CODE"; + case Q_TIME_ZONE_CODE: return "Q_TIME_ZONE_CODE"; + case Q_CATALOG_NZ_CODE: return "Q_CATALOG_NZ_CODE"; + case Q_LC_TIME_NAMES_CODE: return "Q_LC_TIME_NAMES_CODE"; + case Q_CHARSET_DATABASE_CODE: return "Q_CHARSET_DATABASE_CODE"; + } + sprintf(buf, "CODE#%d", code); + return buf; +} +#endif + +/** + Macro to check that there is enough space to read from memory. + + @param PTR Pointer to memory + @param END End of memory + @param CNT Number of bytes that should be read. + */ +#define CHECK_SPACE(PTR,END,CNT) \ + do { \ + DBUG_PRINT("info", ("Read %s", code_name(pos[-1]))); \ + DBUG_ASSERT((PTR) + (CNT) <= (END)); \ + if ((PTR) + (CNT) > (END)) { \ + DBUG_PRINT("info", ("query= 0")); \ + query= 0; \ + DBUG_VOID_RETURN; \ + } \ + } while (0) + /* Query_log_event::Query_log_event() This is used by the SQL slave thread to prepare the event before execution. @@ -1632,6 +1807,19 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, if (tmp) { status_vars_len= uint2korr(buf + Q_STATUS_VARS_LEN_OFFSET); + /* + Check if status variable length is corrupt and will lead to very + wrong data. We could be even more strict and require data_len to + be even bigger, but this will suffice to catch most corruption + errors that can lead to a crash. + */ + if (status_vars_len > min(data_len, MAX_SIZE_LOG_EVENT_STATUS)) + { + DBUG_PRINT("info", ("status_vars_len (%u) > data_len (%lu); query= 0", + status_vars_len, data_len)); + query= 0; + DBUG_VOID_RETURN; + } data_len-= status_vars_len; DBUG_PRINT("info", ("Query_log_event has status_vars_len: %u", (uint) status_vars_len)); @@ -1651,6 +1839,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, { switch (*pos++) { case Q_FLAGS2_CODE: + CHECK_SPACE(pos, end, 4); flags2_inited= 1; flags2= uint4korr(pos); DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", (ulong) flags2)); @@ -1661,6 +1850,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, #ifndef DBUG_OFF char buff[22]; #endif + CHECK_SPACE(pos, end, 8); sql_mode_inited= 1; sql_mode= (ulong) uint8korr(pos); // QQ: Fix when sql_mode is ulonglong DBUG_PRINT("info",("In Query_log_event, read sql_mode: %s", @@ -1669,15 +1859,24 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, break; } case Q_CATALOG_NZ_CODE: - get_str_len_and_pointer(&pos, &catalog, &catalog_len); + DBUG_PRINT("info", ("case Q_CATALOG_NZ_CODE; pos: 0x%lx; end: 0x%lx", + (ulong) pos, (ulong) end)); + if (get_str_len_and_pointer(&pos, &catalog, &catalog_len, end)) + { + DBUG_PRINT("info", ("query= 0")); + query= 0; + DBUG_VOID_RETURN; + } break; case Q_AUTO_INCREMENT: + CHECK_SPACE(pos, end, 4); auto_increment_increment= uint2korr(pos); auto_increment_offset= uint2korr(pos+2); pos+= 4; break; case Q_CHARSET_CODE: { + CHECK_SPACE(pos, end, 6); charset_inited= 1; memcpy(charset, pos, 6); pos+= 6; @@ -1685,20 +1884,29 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, } case Q_TIME_ZONE_CODE: { - get_str_len_and_pointer(&pos, &time_zone_str, &time_zone_len); + if (get_str_len_and_pointer(&pos, &time_zone_str, &time_zone_len, end)) + { + DBUG_PRINT("info", ("Q_TIME_ZONE_CODE: query= 0")); + query= 0; + DBUG_VOID_RETURN; + } break; } case Q_CATALOG_CODE: /* for 5.0.x where 0<=x<=3 masters */ + CHECK_SPACE(pos, end, 1); if ((catalog_len= *pos)) catalog= (char*) pos+1; // Will be copied later + CHECK_SPACE(pos, end, catalog_len + 2); pos+= catalog_len+2; // leap over end 0 catalog_nz= 0; // catalog has end 0 in event break; case Q_LC_TIME_NAMES_CODE: + CHECK_SPACE(pos, end, 2); lc_time_names_number= uint2korr(pos); pos+= 2; break; case Q_CHARSET_DATABASE_CODE: + CHECK_SPACE(pos, end, 2); charset_database_number= uint2korr(pos); pos+= 2; break; @@ -1726,6 +1934,11 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, DBUG_VOID_RETURN; if (catalog_len) // If catalog is given { + /** + @todo we should clean up and do only copy_str_and_move; it + works for both cases. Then we can remove the catalog_nz + flag. /sven + */ if (likely(catalog_nz)) // true except if event comes from 5.0.0|1|2|3. copy_str_and_move(&catalog, &start, catalog_len); else @@ -1738,6 +1951,13 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, if (time_zone_len) copy_str_and_move(&time_zone_str, &start, time_zone_len); + /** + if time_zone_len or catalog_len are 0, then time_zone and catalog + are uninitialized at this point. shouldn't they point to the + zero-length null-terminated strings we allocated space for in the + my_alloc call above? /sven + */ + /* A 2nd variable part; this is common to all versions */ memcpy((char*) start, end, data_len); // Copy db and query start[data_len]= '\0'; // End query with \0 (For safetly) @@ -2200,6 +2420,7 @@ end: */ thd->catalog= 0; thd->set_db(NULL, 0); /* will free the current database */ + DBUG_PRINT("info", ("end: query= 0")); thd->query= 0; // just to be sure thd->query_length= 0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); @@ -2235,6 +2456,30 @@ int Query_log_event::do_update_pos(Relay_log_info *rli) } +Log_event::enum_skip_reason +Query_log_event::do_shall_skip(Relay_log_info *rli) +{ + DBUG_ENTER("Query_log_event::do_shall_skip"); + DBUG_PRINT("debug", ("query: %s; q_len: %d", query, q_len)); + DBUG_ASSERT(query && q_len > 0); + + if (rli->slave_skip_counter > 0) + { + if (strcmp("BEGIN", query) == 0) + { + thd->options|= OPTION_BEGIN; + DBUG_RETURN(Log_event::continue_group(rli)); + } + + if (strcmp("COMMIT", query) == 0 || strcmp("ROLLBACK", query) == 0) + { + thd->options&= ~OPTION_BEGIN; + DBUG_RETURN(Log_event::EVENT_SKIP_COUNT); + } + } + DBUG_RETURN(Log_event::do_shall_skip(rli)); +} + #endif @@ -2774,7 +3019,7 @@ uint Load_log_event::get_query_buffer_length() 21 + sql_ex.field_term_len*4 + 2 + // " FIELDS TERMINATED BY 'str'" 23 + sql_ex.enclosed_len*4 + 2 + // " OPTIONALLY ENCLOSED BY 'str'" 12 + sql_ex.escaped_len*4 + 2 + // " ESCAPED BY 'str'" - 21 + sql_ex.line_term_len*4 + 2 + // " FIELDS TERMINATED BY 'str'" + 21 + sql_ex.line_term_len*4 + 2 + // " LINES TERMINATED BY 'str'" 19 + sql_ex.line_start_len*4 + 2 + // " LINES STARTING BY 'str'" 15 + 22 + // " IGNORE xxx LINES" 3 + (num_fields-1)*2 + field_block_len; // " (field1, field2, ...)" @@ -3871,10 +4116,7 @@ Intvar_log_event::do_shall_skip(Relay_log_info *rli) that we do not change the value of the slave skip counter since it will be decreased by the following insert event. */ - if (rli->slave_skip_counter == 1) - return Log_event::EVENT_SKIP_IGNORE; - else - return Log_event::do_shall_skip(rli); + return continue_group(rli); } #endif @@ -3970,10 +4212,7 @@ Rand_log_event::do_shall_skip(Relay_log_info *rli) that we do not change the value of the slave skip counter since it will be decreased by the following insert event. */ - if (rli->slave_skip_counter == 1) - return Log_event::EVENT_SKIP_IGNORE; - else - return Log_event::do_shall_skip(rli); + return continue_group(rli); } #endif /* !MYSQL_CLIENT */ @@ -4049,6 +4288,17 @@ int Xid_log_event::do_apply_event(Relay_log_info const *rli) "COMMIT /* implicit, from Xid_log_event */"); return end_trans(thd, COMMIT); } + +Log_event::enum_skip_reason +Xid_log_event::do_shall_skip(Relay_log_info *rli) +{ + DBUG_ENTER("Xid_log_event::do_shall_skip"); + if (rli->slave_skip_counter > 0) { + thd->options&= ~OPTION_BEGIN; + DBUG_RETURN(Log_event::EVENT_SKIP_COUNT); + } + DBUG_RETURN(Log_event::do_shall_skip(rli)); +} #endif /* !MYSQL_CLIENT */ @@ -4427,10 +4677,7 @@ User_var_log_event::do_shall_skip(Relay_log_info *rli) that we do not change the value of the slave skip counter since it will be decreased by the following insert event. */ - if (rli->slave_skip_counter == 1) - return Log_event::EVENT_SKIP_IGNORE; - else - return Log_event::do_shall_skip(rli); + return continue_group(rli); } #endif /* !MYSQL_CLIENT */ @@ -5366,6 +5613,19 @@ int Begin_load_query_log_event::get_create_or_append() const #endif /* defined( HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) +Log_event::enum_skip_reason +Begin_load_query_log_event::do_shall_skip(Relay_log_info *rli) +{ + /* + If the slave skip counter is 1, then we should not start executing + on the next event. + */ + return continue_group(rli); +} +#endif + + /************************************************************************** Execute_load_query_log_event methods **************************************************************************/ @@ -5374,12 +5634,13 @@ int Begin_load_query_log_event::get_create_or_append() const #ifndef MYSQL_CLIENT Execute_load_query_log_event:: Execute_load_query_log_event(THD *thd_arg, const char* query_arg, - ulong query_length_arg, uint fn_pos_start_arg, - uint fn_pos_end_arg, - enum_load_dup_handling dup_handling_arg, - bool using_trans, bool suppress_use): + ulong query_length_arg, uint fn_pos_start_arg, + uint fn_pos_end_arg, + enum_load_dup_handling dup_handling_arg, + bool using_trans, bool suppress_use, + THD::killed_state killed_err_arg): Query_log_event(thd_arg, query_arg, query_length_arg, using_trans, - suppress_use), + suppress_use, killed_err_arg), file_id(thd_arg->file_id), fn_pos_start(fn_pos_start_arg), fn_pos_end(fn_pos_end_arg), dup_handling(dup_handling_arg) { @@ -5577,6 +5838,10 @@ bool sql_ex_info::write_data(IO_CACHE* file) } else { + /** + @todo This is sensitive to field padding. We should write a + char[7], not an old_sql_ex. /sven + */ old_sql_ex old_ex; old_ex.field_term= *field_term; old_ex.enclosed= *enclosed; @@ -6146,14 +6411,19 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) table->in_use = old_thd; switch (error) { - /* Some recoverable errors */ - case HA_ERR_RECORD_CHANGED: - case HA_ERR_KEY_NOT_FOUND: /* Idempotency support: OK if - tuple does not exist */ - error= 0; case 0: break; + /* Some recoverable errors */ + case HA_ERR_RECORD_CHANGED: + case HA_ERR_RECORD_DELETED: + case HA_ERR_KEY_NOT_FOUND: + case HA_ERR_END_OF_FILE: + /* Idempotency support: OK if tuple does not exist */ + DBUG_PRINT("info", ("error: %s", HA_ERR(error))); + error= 0; + break; + default: rli->report(ERROR_LEVEL, thd->net.last_errno, "Error in %s event: row application failed. %s", @@ -6170,6 +6440,10 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) m_curr_row_end. */ + DBUG_PRINT("info", ("error: %d", error)); + DBUG_PRINT("info", ("curr_row: 0x%lu; curr_row_end: 0x%lu; rows_end: 0x%lu", + (ulong) m_curr_row, (ulong) m_curr_row_end, (ulong) m_rows_end)); + if (!m_curr_row_end && !error) unpack_current_row(rli); @@ -6469,6 +6743,16 @@ void Rows_log_event::print_helper(FILE *file, data) in the table map are initialized as zero (0). The array size is the same as the columns for the table on the slave. + Additionally, values saved for field metadata on the master are saved as a + string of bytes (uchar) in the binlog. A field may require 1 or more bytes + to store the information. In cases where values require multiple bytes + (e.g. values > 255), the endian-safe methods are used to properly encode + the values on the master and decode them on the slave. When the field + metadata values are captured on the slave, they are stored in an array of + type uint16. This allows the least number of casts to prevent casting bugs + when the field metadata is used in comparisons of field attributes. When + the field metadata is used for calculating addresses in pointer math, the + type used is uint32. */ /** @@ -6866,10 +7150,7 @@ Table_map_log_event::do_shall_skip(Relay_log_info *rli) If the slave skip counter is 1, then we should not start executing on the next event. */ - if (rli->slave_skip_counter == 1) - return Log_event::EVENT_SKIP_IGNORE; - else - return Log_event::do_shall_skip(rli); + return continue_group(rli); } int Table_map_log_event::do_update_pos(Relay_log_info *rli) @@ -7383,6 +7664,9 @@ static bool record_compare(TABLE *table) records. Check that the other engines also return correct records. */ + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + DBUG_DUMP("record[1]", table->record[1], table->s->reclength); + bool result= FALSE; uchar saved_x[2], saved_filler[2]; @@ -7471,7 +7755,7 @@ record_compare_exit: int Rows_log_event::find_row(const Relay_log_info *rli) { - DBUG_ENTER("find_row"); + DBUG_ENTER("Rows_log_event::find_row"); DBUG_ASSERT(m_table && m_table->in_use != NULL); @@ -7700,7 +7984,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) DBUG_DUMP("record found", table->record[0], table->s->reclength); table->file->ha_rnd_end(); - DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0); + DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == HA_ERR_RECORD_DELETED || error == 0); DBUG_RETURN(error); } @@ -7900,7 +8184,15 @@ Update_rows_log_event::do_exec_row(const Relay_log_info *const rli) int error= find_row(rli); if (error) + { + /* + We need to read the second image in the event of error to be + able to skip to the next pair of updates + */ + m_curr_row= m_curr_row_end; + unpack_current_row(rli); return error; + } /* This is the situation after locating BI: diff --git a/sql/log_event.h b/sql/log_event.h index 0c66d1b190f..4bd496af2a4 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -18,8 +18,10 @@ @{ @file - - Binary log event definitions. + + @brief Binary log event definitions. This includes generic code + common to all types of log events, as well as specific code for each + type of log event. */ @@ -37,6 +39,23 @@ #include "rpl_reporting.h" #endif +/** + Either assert or return an error. + + In debug build, the condition will be checked, but in non-debug + builds, the error code given will be returned instead. + + @param COND Condition to check + @param ERRNO Error number to return in non-debug builds +*/ +#ifdef DBUG_OFF +#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \ + do { if (!(COND)) return ERRNO; } while (0) +#else +#define ASSERT_OR_RETURN_ERROR(COND, ERRNO) \ + DBUG_ASSERT(COND) +#endif + #define LOG_READ_EOF -1 #define LOG_READ_BOGUS -2 #define LOG_READ_IO -3 @@ -394,15 +413,19 @@ struct sql_ex_info #define LOG_EVENT_BINLOG_IN_USE_F 0x1 -/* - If the query depends on the thread (for example: TEMPORARY TABLE). - Currently this is used by mysqlbinlog to know it must print - SET @@PSEUDO_THREAD_ID=xx; before the query (it would not hurt to print it - for every query but this would be slow). +/** + @def LOG_EVENT_THREAD_SPECIFIC_F + + If the query depends on the thread (for example: TEMPORARY TABLE). + Currently this is used by mysqlbinlog to know it must print + SET @@PSEUDO_THREAD_ID=xx; before the query (it would not hurt to print it + for every query but this would be slow). */ #define LOG_EVENT_THREAD_SPECIFIC_F 0x4 -/* +/** + @def LOG_EVENT_SUPPRESS_USE_F + Suppress the generation of 'USE' statements before the actual statement. This flag should be set for any events that does not need the current database set to function correctly. Most notable cases @@ -421,23 +444,26 @@ struct sql_ex_info */ #define LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F 0x10 -/* - OPTIONS_WRITTEN_TO_BIN_LOG are the bits of thd->options which must be - written to the binlog. OPTIONS_WRITTEN_TO_BINLOG could be written - into the Format_description_log_event, so that if later we don't want - to replicate a variable we did replicate, or the contrary, it's - doable. But it should not be too hard to decide once for all of what - we replicate and what we don't, among the fixed 32 bits of - thd->options. - I (Guilhem) have read through every option's usage, and it looks like - OPTION_AUTO_IS_NULL and OPTION_NO_FOREIGN_KEYS are the only ones - which alter how the query modifies the table. It's good to replicate - OPTION_RELAXED_UNIQUE_CHECKS too because otherwise, the slave may - insert data slower than the master, in InnoDB. - OPTION_BIG_SELECTS is not needed (the slave thread runs with - max_join_size=HA_POS_ERROR) and OPTION_BIG_TABLES is not needed - either, as the manual says (because a too big in-memory temp table is - automatically written to disk). +/** + @def OPTIONS_WRITTEN_TO_BIN_LOG + + OPTIONS_WRITTEN_TO_BIN_LOG are the bits of thd->options which must + be written to the binlog. OPTIONS_WRITTEN_TO_BIN_LOG could be + written into the Format_description_log_event, so that if later we + don't want to replicate a variable we did replicate, or the + contrary, it's doable. But it should not be too hard to decide once + for all of what we replicate and what we don't, among the fixed 32 + bits of thd->options. + + I (Guilhem) have read through every option's usage, and it looks + like OPTION_AUTO_IS_NULL and OPTION_NO_FOREIGN_KEYS are the only + ones which alter how the query modifies the table. It's good to + replicate OPTION_RELAXED_UNIQUE_CHECKS too because otherwise, the + slave may insert data slower than the master, in InnoDB. + OPTION_BIG_SELECTS is not needed (the slave thread runs with + max_join_size=HA_POS_ERROR) and OPTION_BIG_TABLES is not needed + either, as the manual says (because a too big in-memory temp table + is automatically written to disk). */ #define OPTIONS_WRITTEN_TO_BIN_LOG \ (OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS | \ @@ -452,6 +478,11 @@ struct sql_ex_info #endif #undef EXPECTED_OPTIONS /* You shouldn't use this one */ +/** + @enum Log_event_type + + Enumeration type for the different types of log events. +*/ enum Log_event_type { /* @@ -612,13 +643,90 @@ typedef struct st_print_event_info #endif -/***************************************************************************** - - Log_event class +/** + @class Log_event This is the abstract base class for binary log events. - - ****************************************************************************/ + + @section Log_event_binary_format Binary Format + + Any Log_event saved on disk consists of the following three + components. + + @li Common-Header + @li Post-Header + @li Body + + The Common-Header, documented below, always has the same form and + length within one version of MySQL. Each event type specifies a + form and length of the Post-Header common to all events of the type. + The Body may be of different form and length even for different + events of the same type. The binary formats of Post-Header and Body + are documented separately in each subclass. The binary format of + Common-Header is as follows. + + <table> + <caption>Common-Header</caption> + + <tr> + <th>Name</th> + <th>Format<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>timestamp</td> + <td>4 byte unsigned integer</td> + <td>The number of seconds since 1970. + </td> + </tr> + + <tr> + <td>type</td> + <td>1 byte enumeration</td> + <td>See enum #Log_event_type.</td> + </tr> + + <tr> + <td>master_id</td> + <td>4 byte integer</td> + <td>Server ID of the server that created the event.</td> + </tr> + + <tr> + <td>total_size</td> + <td>4 byte integer</td> + <td>The total size of this event, in bytes. In other words, this + is the sum of the sizes of Common-Header, Post-Header, and Body. + </td> + </tr> + + <tr> + <td>master_position</td> + <td>4 byte integer</td> + <td>The position of the next event in the master binary log, in + bytes from the beginning of the file. + </td> + </tr> + + <tr> + <td>flags</td> + <td>2 byte bitfield</td> + <td>See Log_event::flags.</td> + </tr> + </table> + + Summing up the numbers above, we see that the total size of the + common header is 19 bytes. + + @subsection Log_event_endianness_and_string_formats Endianness and String Formats + + All numbers, whether they are 16-, 32-, or 64-bit, are stored in + little endian, i.e., the least significant byte first. + + Strings are stored in various formats. The format of each string is + documented separately. +*/ class Log_event { public: @@ -692,8 +800,8 @@ public: */ uint32 server_id; - /* - Some 16 flags. Look above for LOG_EVENT_TIME_F, + /** + Some 16 flags. See the definitions above for LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F, and LOG_EVENT_SUPPRESS_USE_F for notes. */ @@ -871,6 +979,25 @@ public: protected: /** + Helper function to ignore an event w.r.t. the slave skip counter. + + This function can be used inside do_shall_skip() for functions + that cannot end a group. If the slave skip counter is 1 when + seeing such an event, the event shall be ignored, the counter + left intact, and processing continue with the next event. + + A typical usage is: + @code + enum_skip_reason do_shall_skip(Relay_log_info *rli) { + return continue_group(rli); + } + @endcode + + @return Skip reason + */ + enum_skip_reason continue_group(Relay_log_info *rli); + + /** Primitive to apply an event to the database. This is where the change to the database is made. @@ -950,6 +1077,7 @@ protected: #endif }; + /* One class for each type of event. Two constructors for each class: @@ -963,13 +1091,332 @@ protected: mysqlbinlog. This constructor must be format-tolerant. */ -/***************************************************************************** - - Query Log Event class - - Logs SQL queries +/** + @class Query_log_event + + Logs SQL queries. + + @section Query_log_event_binary_format Binary format + + The Post-Header has five components: + + <table> + <caption>Post-Header for Query_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>slave_proxy_id</td> + <td>4 byte unsigned integer</td> + <td>An integer identifying the client thread, which is unique on + the server. (Note, however, that two threads on different servers + may have the same slave_proxy_id.) This is used when a client + thread creates a temporary table. Temporary tables are local to + the client, and the slave_proxy_id is used to distinguish + temporary tables belonging to different clients. + </td> + </tr> + + <tr> + <td>exec_time</td> + <td>4 byte integer</td> + <td>???TODO</td> + </tr> + + <tr> + <td>db_len</td> + <td>1 byte integer</td> + <td>The length of the name of the currently selected + database. + </td> + </tr> + + <tr> + <td>error_code</td> + <td>2 byte integer</td> + <td>Error code generated by the master. If the master fails, the + slave will fail with the same error code, except for the error + codes ER_DB_CREATE_EXISTS==1007 and ER_DB_DROP_EXISTS==1008. + </td> + </tr> + + <tr> + <td>status_vars_len</td> + <td>2 byte integer</td> + <td>The length of the status_vars block of the Body, in bytes. See + <a href="#query_log_event_status_vars">below</a>. + </td> + </tr> + + <tr> + <td>Post-Header-For-Derived</td> + <td>0 bytes</td> + <td>This field is only written by the subclass + Execute_load_query_log_event. In this base class, it takes 0 + bytes. See separate documentation for + Execute_load_query_log_event. + </td> + </tr> + </table> + + The Body has the following components: + + <table> + <caption>Body for Query_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td><a name="query_log_event_status_vars" /> status_vars</td> + <td>variable length</td> + <td>Zero or more status variables. Each status variable consists + of one byte identifying the variable stored, followed by the value + of the variable. The possible variables are listed separately in + the table below. MySQL always writes events in the order defined + below; however, it is capable of reading them in any order. + </td> + </tr> + + <tr> + <td>db</td> + <td>db_len+1</td> + <td>The currently selected database, as a null-terminated string. + + (The trailing zero is redundant since the length is already known; + it is db_len from Post-Header.) + </td> + </tr> + + <tr> + <td>query</td> + <td>variable length string without trailing zero, extending to the + end of the event (determined by the length field of the + Common-Header) + </td> + <td>The SQL query.</td> + </tr> + </table> + + The following table lists the status variables that may appear in + the status_vars field. + + <table> + <caption>Status variables for Query_log_event</caption> + + <tr> + <th>Status variable</th> + <th>1-byte identifier</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>flags2</td> + <td>Q_FLAGS2_CODE == 0</td> + <td>4 byte bitfield</td> + <td>The flags in thd->options, binary AND-ed with + OPTIONS_WRITTEN_TO_BIN_LOG. The thd->options bitfield contains + options for SELECT. OPTIONS_WRITTEN identifies those options that + need to be written to the binlog (not all do). Specifically, + OPTIONS_WRITTEN_TO_BIN_LOG equals (OPTION_AUTO_IS_NULL | + OPTION_NO_FOREIGN_KEY_CHECKS | OPTION_RELAXED_UNIQUE_CHECKS | + OPTION_NOT_AUTOCOMMIT), or 0x0c084000 in hex. + + These flags correspond to the SQL variables SQL_AUTO_IS_NULL, + FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, and AUTOCOMMIT, documented in + the "SET Syntax" section of the MySQL Manual. + + This field is always written to the binlog in version >= 5.0, and + never written in version < 5.0. + </td> + </tr> + + <tr> + <td>sql_mode</td> + <td>Q_SQL_MODE_CODE == 1</td> + <td>8 byte integer</td> + <td>The sql_mode variable. See the section "SQL Modes" in the + MySQL manual, and see mysql_priv.h for a list of the possible + flags. Currently (2007-10-04), the following flags are available: + <pre> + MODE_REAL_AS_FLOAT==0x1 + MODE_PIPES_AS_CONCAT==0x2 + MODE_ANSI_QUOTES==0x4 + MODE_IGNORE_SPACE==0x8 + MODE_NOT_USED==0x10 + MODE_ONLY_FULL_GROUP_BY==0x20 + MODE_NO_UNSIGNED_SUBTRACTION==0x40 + MODE_NO_DIR_IN_CREATE==0x80 + MODE_POSTGRESQL==0x100 + MODE_ORACLE==0x200 + MODE_MSSQL==0x400 + MODE_DB2==0x800 + MODE_MAXDB==0x1000 + MODE_NO_KEY_OPTIONS==0x2000 + MODE_NO_TABLE_OPTIONS==0x4000 + MODE_NO_FIELD_OPTIONS==0x8000 + MODE_MYSQL323==0x10000 + MODE_MYSQL323==0x20000 + MODE_MYSQL40==0x40000 + MODE_ANSI==0x80000 + MODE_NO_AUTO_VALUE_ON_ZERO==0x100000 + MODE_NO_BACKSLASH_ESCAPES==0x200000 + MODE_STRICT_TRANS_TABLES==0x400000 + MODE_STRICT_ALL_TABLES==0x800000 + MODE_NO_ZERO_IN_DATE==0x1000000 + MODE_NO_ZERO_DATE==0x2000000 + MODE_INVALID_DATES==0x4000000 + MODE_ERROR_FOR_DIVISION_BY_ZERO==0x8000000 + MODE_TRADITIONAL==0x10000000 + MODE_NO_AUTO_CREATE_USER==0x20000000 + MODE_HIGH_NOT_PRECEDENCE==0x40000000 + MODE_PAD_CHAR_TO_FULL_LENGTH==0x80000000 + </pre> + All these flags are replicated from the server. However, all + flags except MODE_NO_DIR_IN_CREATE are honored by the slave; the + slave always preserves its old value of MODE_NO_DIR_IN_CREATE. + For a rationale, see comment in Query_log_event::do_apply_event in + log_event.cc. + + This field is always written to the binlog. + </td> + </tr> + + <tr> + <td>catalog</td> + <td>Q_CATALOG_NZ_CODE == 6</td> + <td>Variable-length string: the length in bytes (1 byte) followed + by the characters (at most 255 bytes) + </td> + <td>Stores the client's current catalog. Every database belongs + to a catalog, the same way that every table belongs to a + database. Currently, there is only one catalog, 'std'. + + This field is written if the length of the catalog is > 0; + otherwise it is not written. + </td> + </tr> + + <tr> + <td>auto_increment</td> + <td>Q_AUTO_INCREMENT == 3</td> + <td>two 2 byte unsigned integers, totally 2+2=4 bytes</td> + + <td>The two variables auto_increment_increment and + auto_increment_offset, in that order. For more information, see + "System variables" in the MySQL manual. + + This field is written if auto_increment>1; otherwise it is not + written. + </td> + </tr> + + <tr> + <td>charset</td> + <td>Q_CHARSET_CODE == 4</td> + <td>three 2-byte unsigned integers (i.e., 6 bytes)</td> + <td>The three variables character_set_client, + collation_connection, and collation_server, in that order. + `character_set_client' is a code identifying the character set and + collation used by the client to encode the query. + `collation_connection' identifies the character set and collation + that the master converts the query to when it receives it; this is + useful when comparing literal strings. `collation_server' is the + default character set and collation used when a new database is + created. + + See also "Connection Character Sets and Collations" in the MySQL + 5.1 manual. + + All three variables are codes identifying a (character set, + collation) pair. To see which codes map to which pairs, run the + query "SELECT id, character_set_name, collation_name FROM + COLLATIONS". + + Cf. Q_CHARSET_DATABASE_NUMBER below. + + This field is always written. + </td> + </tr> + + <tr> + <td>time_zone</td> + <td>Q_TIME_ZONE_CODE == 5</td> + <td>Variable-length string: the length in bytes (1 byte) followed + by the characters (at most 255 bytes). + <td>The time_zone of the master. + + See also "System Variables" and "MySQL Server Time Zone Support" + in the MySQL manual. + + This field is written if the length of the time zone string is > + 0; otherwise, it is not written. + </td> + </tr> + + <tr> + <td>lc_time_names_number</td> + <td>Q_LC_TIME_NAMES_CODE == 7</td> + <td>2 byte integer</td> + <td>A code identifying a table of month and day names. The + mapping from codes to languages is defined in sql_locale.cc. + + This field is written if it is != 0, i.e., if the locale is not + en_US. + </td> + </tr> + + <tr> + <td>charset_database_number</td> + <td>Q_CHARSET_DATABASE_NUMBER == 8</td> + <td>2 byte integer</td> + + <td>The value of the collation_database system variable (in the + source code stored in thd->variables.collation_database), which + holds the code for a (character set, collation) pair as described + above (see Q_CHARSET_CODE). + + `collation_database' was used in old versions (???WHEN). Its + value was loaded when issuing a "use db" command and could be + changed by issuing a "SET collation_database=xxx" command. It + used to affect the "LOAD DATA INFILE" and "CREATE TABLE" commands. + + In newer versions, "CREATE TABLE" has been changed to take the + character set from the database of the created table, rather than + the database of the current database. This makes a difference + when creating a table in another database than the current one. + "LOAD DATA INFILE" has not yet changed to do this, but there are + plans to eventually do it, and to make collation_database + read-only. + + This field is written if it is not 0. + </td> + </tr> + </table> + + @subsection Query_log_event_notes_on_previous_versions Notes on Previous Versions + + @li Status vars were introduced in version 5.0. To read earlier + versions correctly, check the length of the Post-Header. + + @li The status variable Q_CATALOG_CODE == 2 existed in MySQL 5.0.x, + where 0<=x<=3. It was identical to Q_CATALOG_CODE, except that the + string had a trailing '\0'. The '\0' was removed in 5.0.4 since it + was redundant (the string length is stored before the string). The + Q_CATALOG_CODE will never be written by a new master, but can still + be understood by a new slave. + + @li See Q_CHARSET_DATABASE_NUMBER in the table above. - ****************************************************************************/ +*/ class Query_log_event: public Log_event { protected: @@ -1027,7 +1474,7 @@ public: /* 'flags2' is a second set of flags (on top of those in Log_event), for session variables. These are thd->options which is & against a mask - (OPTIONS_WRITTEN_TO_BINLOG). + (OPTIONS_WRITTEN_TO_BIN_LOG). flags2_inited helps make a difference between flags2==0 (3.23 or 4.x master, we don't know flags2, so use the slave server's global options) and flags2==0 (5.0 master, we know this has a meaning of flags all down which @@ -1086,6 +1533,7 @@ public: public: /* !!! Public in this patch to allow old usage */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual enum_skip_reason do_shall_skip(Relay_log_info *rli); virtual int do_apply_event(Relay_log_info const *rli); virtual int do_update_pos(Relay_log_info *rli); @@ -1096,13 +1544,16 @@ public: /* !!! Public in this patch to allow old usage */ }; -/***************************************************************************** +/** + @class Muted_query_log_event - Muted Query Log Event class + Pretends to log SQL queries, but doesn't actually do so. - Pretends to Log SQL queries, but doesn't actually do so. + @section Muted_query_log_event_binary_format Binary Format - ****************************************************************************/ + This log event is not stored, and thus the binary format is 0 bytes + long. Note that not even the Common-Header is stored. +*/ class Muted_query_log_event: public Query_log_event { public: @@ -1119,14 +1570,54 @@ public: #ifdef HAVE_REPLICATION -/***************************************************************************** +/** + @class Slave_log_event - Slave Log Event class Note that this class is currently not used at all; no code writes a - Slave_log_event (though some code in repl_failsafe.cc reads Slave_log_event). - So it's not a problem if this code is not maintained. - - ****************************************************************************/ + Slave_log_event (though some code in repl_failsafe.cc reads + Slave_log_event). So it's not a problem if this code is not + maintained. + + @section Slave_log_event_binary_format Binary Format + + This event type has no Post-Header. The Body has the following + four components. + + <table> + <caption>Body for Slave_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>master_pos</td> + <td>8 byte integer</td> + <td>???TODO + </td> + </tr> + + <tr> + <td>master_port</td> + <td>2 byte integer</td> + <td>???TODO</td> + </tr> + + <tr> + <td>master_host</td> + <td>null-terminated string</td> + <td>???TODO</td> + </tr> + + <tr> + <td>master_log</td> + <td>null-terminated string</td> + <td>???TODO</td> + </tr> + </table> +*/ class Slave_log_event: public Log_event { protected: @@ -1165,11 +1656,202 @@ private: #endif /* HAVE_REPLICATION */ -/***************************************************************************** - - Load Log Event class +/** + @class Load_log_event + + This log event corresponds to a "LOAD DATA INFILE" SQL query on the + following form: + + @verbatim + (1) USE db; + (2) LOAD DATA [LOCAL] INFILE 'file_name' + (3) [REPLACE | IGNORE] + (4) INTO TABLE 'table_name' + (5) [FIELDS + (6) [TERMINATED BY 'field_term'] + (7) [[OPTIONALLY] ENCLOSED BY 'enclosed'] + (8) [ESCAPED BY 'escaped'] + (9) ] + (10) [LINES + (11) [TERMINATED BY 'line_term'] + (12) [LINES STARTING BY 'line_start'] + (13) ] + (14) [IGNORE skip_lines LINES] + (15) (field_1, field_2, ..., field_n)@endverbatim + + @section Load_log_event_binary_format Binary Format + + The Post-Header consists of the following six components. + + <table> + <caption>Post-Header for Load_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>slave_proxy_id</td> + <td>4 byte unsigned integer</td> + <td>An integer identifying the client thread, which is unique on + the server. (Note, however, that the same slave_proxy_id may + appear on different servers.) This is used when a client thread + creates a temporary table. Temporary tables are local to the + client, and the slave_proxy_id is used to distinguish temporary + tables belonging to different clients. + </td> + </tr> + + <tr> + <td>exec_time</td> + <td>4 byte unsigned integer</td> + <td>???TODO</td> + </tr> + + <tr> + <td>skip_lines</td> + <td>4 byte unsigned integer</td> + <td>The number on line (14) above, if present, or 0 if line (14) + is left out. + </td> + </tr> + + <tr> + <td>table_name_len</td> + <td>1 byte unsigned integer</td> + <td>The length of 'table_name' on line (4) above.</td> + </tr> + + <tr> + <td>db_len</td> + <td>1 byte unsigned integer</td> + <td>The length of 'db' on line (1) above.</td> + </tr> + + <tr> + <td>num_fields</td> + <td>4 byte unsigned integer</td> + <td>The number n of fields on line (15) above.</td> + </tr> + </table> + + The Body contains the following components. + + <table> + <caption>Body of Load_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>sql_ex</td> + <td>variable length</td> + + <td>Describes the part of the query on lines (3) and + (5)–(13) above. More precisely, it stores the five strings + (on lines) field_term (6), enclosed (7), escaped (8), line_term + (11), and line_start (12); as well as a bitfield indicating the + presence of the keywords REPLACE (3), IGNORE (3), and OPTIONALLY + (7). + + The data is stored in one of two formats, called "old" and "new". + The type field of Common-Header determines which of these two + formats is used: type LOAD_EVENT means that the old format is + used, and type NEW_LOAD_EVENT means that the new format is used. + When MySQL writes a Load_log_event, it uses the new format if at + least one of the five strings is two or more bytes long. + Otherwise (i.e., if all strings are 0 or 1 bytes long), the old + format is used. + + The new and old format differ in the way the five strings are + stored. + + <ul> + <li> In the new format, the strings are stored in the order + field_term, enclosed, escaped, line_term, line_start. Each string + consists of a length (1 byte), followed by a sequence of + characters (0-255 bytes). Finally, a boolean combination of the + following flags is stored in 1 byte: REPLACE_FLAG==0x4, + IGNORE_FLAG==0x8, and OPT_ENCLOSED_FLAG==0x2. If a flag is set, + it indicates the presence of the corresponding keyword in the SQL + query. + + <li> In the old format, we know that each string has length 0 or + 1. Therefore, only the first byte of each string is stored. The + order of the strings is the same as in the new format. These five + bytes are followed by the same 1-byte bitfield as in the new + format. Finally, a 1 byte bitfield called empty_flags is stored. + The low 5 bits of empty_flags indicate which of the five strings + have length 0. For each of the following flags that is set, the + corresponding string has length 0; for the flags that are not set, + the string has length 1: FIELD_TERM_EMPTY==0x1, + ENCLOSED_EMPTY==0x2, LINE_TERM_EMPTY==0x4, LINE_START_EMPTY==0x8, + ESCAPED_EMPTY==0x10. + </ul> + + Thus, the size of the new format is 6 bytes + the sum of the sizes + of the five strings. The size of the old format is always 7 + bytes. + </td> + </tr> + + <tr> + <td>field_lens</td> + <td>num_fields 1-byte unsigned integers</td> + <td>An array of num_fields integers representing the length of + each field in the query. (num_fields is from the Post-Header). + </td> + </tr> + + <tr> + <td>fields</td> + <td>num_fields null-terminated strings</td> + <td>An array of num_fields null-terminated strings, each + representing a field in the query. (The trailing zero is + redundant, since the length are stored in the num_fields array.) + The total length of all strings equals to the sum of all + field_lens, plus num_fields bytes for all the trailing zeros. + </td> + </tr> + + <tr> + <td>table_name</td> + <td>null-terminated string of length table_len+1 bytes</td> + <td>The 'table_name' from the query, as a null-terminated string. + (The trailing zero is actually redundant since the table_len is + known from Post-Header.) + </td> + </tr> + + <tr> + <td>db</td> + <td>null-terminated string of length db_len+1 bytes</td> + <td>The 'db' from the query, as a null-terminated string. + (The trailing zero is actually redundant since the db_len is known + from Post-Header.) + </td> + </tr> + + <tr> + <td>file_name</td> + <td>variable length string without trailing zero, extending to the + end of the event (determined by the length field of the + Common-Header) + </td> + <td>The 'file_name' from the query. + </td> + </tr> + + </table> + + @subsection Load_log_event_notes_on_previous_versions Notes on Previous Versions - ****************************************************************************/ +*/ class Load_log_event: public Log_event { private: @@ -1276,9 +1958,8 @@ public: /* !!! Public in this patch to allow old usage */ extern char server_version[SERVER_VERSION_LENGTH]; -/***************************************************************************** - - Start Log Event_v3 class +/** + @class Start_log_event_v3 Start_log_event_v3 is the Start_log_event of binlog format 3 (MySQL 3.23 and 4.x). @@ -1288,8 +1969,8 @@ extern char server_version[SERVER_VERSION_LENGTH]; MySQL 5.0 whenever it starts sending a new binlog if the requested position is >4 (otherwise if ==4 the event will be sent naturally). - ****************************************************************************/ - + @section Start_log_event_v3_binary_format Binary Format +*/ class Start_log_event_v3: public Log_event { public: @@ -1372,10 +2053,14 @@ protected: }; -/* - For binlog version 4. - This event is saved by threads which read it, as they need it for future - use (to decode the ordinary events). +/** + @class Format_description_log_event + + For binlog version 4. + This event is saved by threads which read it, as they need it for future + use (to decode the ordinary events). + + @section Format_description_log_event_binary_format Binary Format */ class Format_description_log_event: public Start_log_event_v3 @@ -1429,13 +2114,41 @@ protected: }; -/***************************************************************************** +/** + @class Intvar_log_event - Intvar Log Event class + Logs special variables related to auto_increment values. - Logs special variables such as auto_increment values + @section Intvar_log_event_binary_format Binary Format - ****************************************************************************/ + The Post-Header has two components: + + <table> + <caption>Post-Header for Intvar_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>Type</td> + <td>1 byte enumeration</td> + <td>One byte identifying the type of variable stored. Currently, + two identifiers are supported: LAST_INSERT_ID_EVENT==1 and + INSERT_ID_EVENT==2. + </td> + </tr> + + <tr> + <td>value</td> + <td>8 byte unsigned integer</td> + <td>The value of the variable.</td> + </tr> + + </table> +*/ class Intvar_log_event: public Log_event { @@ -1474,16 +2187,24 @@ private: }; -/***************************************************************************** - - Rand Log Event class +/** + @class Rand_log_event Logs random seed used by the next RAND(), and by PASSWORD() in 4.1.0. 4.1.1 does not need it (it's repeatable again) so this event needn't be written in 4.1.1 for PASSWORD() (but the fact that it is written is just a waste, it does not cause bugs). - ****************************************************************************/ + @section Rand_log_event_binary_format Binary Format + This event type has no Post-Header. The Body of this event type has + two components: + + @li seed1 (8 bytes): 64 bit random seed1. + @li seed2 (8 bytes): 64 bit random seed2. + + The state of the random number generation consists of 128 bits, + which are stored internally as two 64-bit numbers. +*/ class Rand_log_event: public Log_event { @@ -1520,14 +2241,14 @@ private: #endif }; -/***************************************************************************** - - Xid Log Event class +/** + @class Xid_log_event Logs xid of the transaction-to-be-committed in the 2pc protocol. Has no meaning in replication, slaves ignore it. - ****************************************************************************/ + @section Xid_log_event_binary_format Binary Format +*/ #ifdef MYSQL_CLIENT typedef ulonglong my_xid; // this line is the same as in handler.h #endif @@ -1559,17 +2280,18 @@ class Xid_log_event: public Log_event private: #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) virtual int do_apply_event(Relay_log_info const *rli); + enum_skip_reason do_shall_skip(Relay_log_info *rli); #endif }; -/***************************************************************************** - - User var Log Event class +/** + @class User_var_log_event Every time a query uses the value of a user variable, a User_var_log_event is written before the Query_log_event, to set the user variable. - ****************************************************************************/ + @section User_var_log_event_binary_format Binary Format +*/ class User_var_log_event: public Log_event { @@ -1611,11 +2333,14 @@ private: }; -/***************************************************************************** +/** + @class Stop_log_event - Stop Log Event class + @section Stop_log_event_binary_format Binary Format - ****************************************************************************/ + The Post-Header and Body for this event type are empty; it only has + the Common-Header. +*/ class Stop_log_event: public Log_event { public: @@ -1651,13 +2376,54 @@ private: #endif }; -/***************************************************************************** - - Rotate Log Event class +/** + @class Rotate_log_event This will be deprecated when we move to using sequence ids. - ****************************************************************************/ + @section Rotate_log_event_binary_format Binary Format + + The Post-Header has one component: + + <table> + <caption>Post-Header for Rotate_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>pos</td> + <td>8 byte integer</td> + <td>???TODO</td> + </tr> + + </table> + + The Body has one component: + + <table> + <caption>Body for Rotate_log_event</caption> + + <tr> + <th>Name</th> + <th>Size<br/></th> + <th>Description</th> + </tr> + + <tr> + <td>new_log_ident</td> + <td>variable length string without trailing zero, extending to the + end of the event (determined by the length field of the + Common-Header) + </td> + <td>???TODO</td> + </tr> + + </table> +*/ class Rotate_log_event: public Log_event { @@ -1704,9 +2470,11 @@ private: /* the classes below are for the new LOAD DATA INFILE logging */ -/***************************************************************************** - Create File Log Event class - ****************************************************************************/ +/** + @class Create_file_log_event + + @section Create_file_log_event_binary_format Binary Format +*/ class Create_file_log_event: public Load_log_event { @@ -1775,11 +2543,11 @@ private: }; -/***************************************************************************** - - Append Block Log Event class +/** + @class Append_block_log_event - ****************************************************************************/ + @section Append_block_log_event_binary_format Binary Format +*/ class Append_block_log_event: public Log_event { @@ -1830,11 +2598,11 @@ private: }; -/***************************************************************************** - - Delete File Log Event class +/** + @class Delete_file_log_event - ****************************************************************************/ + @section Delete_file_log_event_binary_format Binary Format +*/ class Delete_file_log_event: public Log_event { @@ -1871,11 +2639,11 @@ private: }; -/***************************************************************************** - - Execute Load Log Event class +/** + @class Execute_load_log_event - ****************************************************************************/ + @section Delete_file_log_event_binary_format Binary Format +*/ class Execute_load_log_event: public Log_event { @@ -1911,15 +2679,15 @@ private: }; -/*************************************************************************** - - Begin load query Log Event class +/** + @class Begin_load_query_log_event Event for the first block of file to be loaded, its only difference from Append_block event is that this event creates or truncates existing file before writing data. -****************************************************************************/ + @section Begin_load_query_log_event_binary_format Binary Format +*/ class Begin_load_query_log_event: public Append_block_log_event { public: @@ -1937,6 +2705,10 @@ public: *description_event); ~Begin_load_query_log_event() {} Log_event_type get_type_code() { return BEGIN_LOAD_QUERY_EVENT; } +private: +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + virtual enum_skip_reason do_shall_skip(Relay_log_info *rli); +#endif }; @@ -1946,15 +2718,15 @@ public: enum enum_load_dup_handling { LOAD_DUP_ERROR= 0, LOAD_DUP_IGNORE, LOAD_DUP_REPLACE }; -/**************************************************************************** - - Execute load query Log Event class +/** + @class Execute_load_query_log_event Event responsible for LOAD DATA execution, it similar to Query_log_event but before executing the query it substitutes original filename in LOAD DATA query with name of temporary file. -****************************************************************************/ + @section Execute_load_query_log_event_binary_format Binary Format +*/ class Execute_load_query_log_event: public Query_log_event { public: @@ -1972,10 +2744,12 @@ public: #ifndef MYSQL_CLIENT Execute_load_query_log_event(THD* thd, const char* query_arg, - ulong query_length, uint fn_pos_start_arg, - uint fn_pos_end_arg, - enum_load_dup_handling dup_handling_arg, - bool using_trans, bool suppress_use); + ulong query_length, uint fn_pos_start_arg, + uint fn_pos_end_arg, + enum_load_dup_handling dup_handling_arg, + bool using_trans, bool suppress_use, + THD::killed_state + killed_err_arg= THD::KILLED_NO_VALUE); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); #endif /* HAVE_REPLICATION */ @@ -2006,6 +2780,11 @@ private: #ifdef MYSQL_CLIENT +/** + @class Unknown_log_event + + @section Unknown_log_event_binary_format Binary Format +*/ class Unknown_log_event: public Log_event { public: @@ -2026,14 +2805,14 @@ public: #endif char *str_to_hex(char *to, const char *from, uint len); -/***************************************************************************** - - Table map log event class +/** + @class Table_map_log_event Create a mapping from a (database name, table name) couple to a table identifier (an integer number). - ****************************************************************************/ + @section Table_map_log_event_binary_format Binary Format +*/ class Table_map_log_event : public Log_event { public: @@ -2143,9 +2922,8 @@ private: }; -/***************************************************************************** - - Row level log event class. +/** + @class Rows_log_event Common base class for all row-containing log events. @@ -2155,7 +2933,8 @@ private: - Write data header and data body to an IO_CACHE. - Provide an interface for adding an individual row to the event. - ****************************************************************************/ + @section Rows_log_event_binary_format Binary Format +*/ class Rows_log_event : public Log_event @@ -2300,7 +3079,7 @@ protected: uchar *m_rows_cur; /* One-after the end of the data */ uchar *m_rows_end; /* One-after the end of the allocated space */ - flag_set m_flags; /* Flags for row-level events */ + flag_set m_flags; /* Flags for row-level events */ /* helper functions */ @@ -2316,8 +3095,11 @@ protected: int unpack_current_row(const Relay_log_info *const rli) { DBUG_ASSERT(m_table); - return ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols, - &m_curr_row_end, &m_master_reclength); + ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT); + int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols, + &m_curr_row_end, &m_master_reclength); + ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT); + return result; } #endif @@ -2383,15 +3165,15 @@ private: friend class Old_rows_log_event; }; -/***************************************************************************** - - Write row log event class +/** + @class Write_rows_log_event Log row insertions and updates. The event contain several insert/update rows for a table. Note that each event contains only rows for one table. - ****************************************************************************/ + @section Write_rows_log_event_binary_format Binary Format +*/ class Write_rows_log_event : public Rows_log_event { public: @@ -2438,9 +3220,8 @@ private: }; -/***************************************************************************** - - Update rows log event class +/** + @class Update_rows_log_event Log row updates with a before image. The event contain several update rows for a table. Note that each event contains only rows for @@ -2449,7 +3230,8 @@ private: Also note that the row data consists of pairs of row data: one row for the old data and one row for the new data. - ****************************************************************************/ + @section Update_rows_log_event_binary_format Binary Format +*/ class Update_rows_log_event : public Rows_log_event { public: @@ -2511,9 +3293,8 @@ protected: #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ }; -/***************************************************************************** - - Delete rows log event class. +/** + @class Delete_rows_log_event Log row deletions. The event contain several delete rows for a table. Note that each event contains only rows for one table. @@ -2530,7 +3311,8 @@ protected: Row_reader Extract the rows from the event. - ****************************************************************************/ + @section Delete_rows_log_event_binary_format Binary Format +*/ class Delete_rows_log_event : public Rows_log_event { public: @@ -2580,6 +3362,8 @@ protected: #include "log_event_old.h" /** + @class Incident_log_event + Class representing an incident, an occurance out of the ordinary, that happened on the master. @@ -2591,7 +3375,7 @@ protected: <caption>Incident event format</caption> <tr> <th>Symbol</th> - <th>Size<br>(bytes)</th> + <th>Size<br/>(bytes)</th> <th>Description</th> </tr> <tr> @@ -2610,7 +3394,9 @@ protected: <td>The message, if present. Not null terminated.</td> </tr> </table> - */ + + @section Delete_rows_log_event_binary_format Binary Format +*/ class Incident_log_event : public Log_event { public: #ifndef MYSQL_CLIENT diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f6d6c3ae2a2..6f3dda8afdf 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -688,7 +688,6 @@ bool check_single_table_access(THD *thd, ulong privilege, bool check_routine_access(THD *thd,ulong want_access,char *db,char *name, bool is_proc, bool no_errors); bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table); -bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list); bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc); #else inline bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables) @@ -999,7 +998,8 @@ bool check_dup(const char *db, const char *name, TABLE_LIST *tables); bool compare_record(TABLE *table); bool append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name); - +void wait_while_table_is_used(THD *thd, TABLE *table, + enum ha_extra_function function); bool table_cache_init(void); void table_cache_free(void); bool table_def_init(void); @@ -1178,12 +1178,16 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update, uint lock_flags); TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem, bool *refresh, uint flags); +bool name_lock_locked_table(THD *thd, TABLE_LIST *tables); bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in); TABLE *table_cache_insert_placeholder(THD *thd, const char *key, uint key_length); bool lock_table_name_if_not_cached(THD *thd, const char *db, const char *table_name, TABLE **table); TABLE *find_locked_table(THD *thd, const char *db,const char *table_name); +void detach_merge_children(TABLE *table, bool clear_refs); +bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last, + TABLE_LIST *new_child_list, TABLE_LIST **new_last); bool reopen_table(TABLE *table); bool reopen_tables(THD *thd,bool get_locks,bool in_refresh); void close_data_files_and_morph_locks(THD *thd, const char *db, @@ -1325,12 +1329,9 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen); bool mysql_ha_close(THD *thd, TABLE_LIST *tables); bool mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *, List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows); -int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags, - bool is_locked); -/* mysql_ha_flush mode_flags bits */ -#define MYSQL_HA_CLOSE_FINAL 0x00 -#define MYSQL_HA_REOPEN_ON_USAGE 0x01 -#define MYSQL_HA_FLUSH_ALL 0x02 +void mysql_ha_flush(THD *thd); +void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables, bool is_locked); +void mysql_ha_cleanup(THD *thd); /* sql_base.cc */ #define TMP_TABLE_KEY_EXTRA 8 @@ -1434,8 +1435,21 @@ int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order); void wait_for_condition(THD *thd, pthread_mutex_t *mutex, pthread_cond_t *cond); int open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags); -int simple_open_n_lock_tables(THD *thd,TABLE_LIST *tables); -bool open_and_lock_tables(THD *thd,TABLE_LIST *tables); +/* open_and_lock_tables with optional derived handling */ +bool open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived); +/* simple open_and_lock_tables without derived handling */ +inline bool simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables) +{ + return open_and_lock_tables_derived(thd, tables, FALSE); +} +/* open_and_lock_tables with derived handling */ +inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables) +{ + return open_and_lock_tables_derived(thd, tables, TRUE); +} +/* simple open_and_lock_tables without derived handling for single table */ +TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l, + thr_lock_type lock_type); bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags); int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, bool *need_reopen); int decide_logging_format(THD *thd, TABLE_LIST *tables); @@ -2012,7 +2026,8 @@ int format_number(uint inputflag,uint max_length,char * pos,uint length, /* table.cc */ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key, uint key_length); -void init_tmp_table_share(TABLE_SHARE *share, const char *key, uint key_length, +void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key, + uint key_length, const char *table_name, const char *path); void free_table_share(TABLE_SHARE *share); int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index de957b1594c..f27d3bc5fd5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2612,7 +2612,12 @@ int my_message_sql(uint error, const char *str, myf MyFlags) thd->is_slave_error= 1; // needed to catch query errors during replication if (!thd->no_warnings_for_error) + { + thd->no_warnings_for_error= TRUE; push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str); + thd->no_warnings_for_error= FALSE; + } + /* thd->lex->current_select == 0 if lex structure is not inited (not query command (COM_QUERY)) @@ -2952,7 +2957,6 @@ static int init_common_variables(const char *conf_file_name, int argc, global_system_variables.collation_connection= default_charset_info; global_system_variables.character_set_results= default_charset_info; global_system_variables.character_set_client= default_charset_info; - global_system_variables.collation_connection= default_charset_info; if (!(character_set_filesystem= get_charset_by_csname(character_set_filesystem_name, @@ -4614,8 +4618,13 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused))) sock == unix_sock ? VIO_LOCALHOST: 0)) || my_net_init(&thd->net,vio_tmp)) { - if (vio_tmp) - vio_delete(vio_tmp); + /* + Only delete the temporary vio if we didn't already attach it to the + NET object. The destructor in THD will delete any initialized net + structure. + */ + if (vio_tmp && thd->net.vio != vio_tmp) + vio_delete(vio_tmp); else { (void) shutdown(new_sock, SHUT_RDWR); @@ -7762,12 +7771,13 @@ mysqld_get_one_option(int optid, break; } case OPT_ONE_THREAD: - global_system_variables.thread_handling= 2; + global_system_variables.thread_handling= + SCHEDULER_ONE_THREAD_PER_CONNECTION; break; case OPT_THREAD_HANDLING: { global_system_variables.thread_handling= - find_type_or_exit(argument, &thread_handling_typelib, opt->name); + find_type_or_exit(argument, &thread_handling_typelib, opt->name)-1; break; } case OPT_FT_BOOLEAN_SYNTAX: diff --git a/sql/opt_range.cc b/sql/opt_range.cc index bcecdfa0a76..7896da6201b 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -4472,8 +4472,8 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree, ROR_SCAN_INFO's. Step 2: Get best ROR-intersection using an approximate algorithm. */ - qsort(tree->ror_scans, tree->n_ror_scans, sizeof(ROR_SCAN_INFO*), - (qsort_cmp)cmp_ror_scan_info); + my_qsort(tree->ror_scans, tree->n_ror_scans, sizeof(ROR_SCAN_INFO*), + (qsort_cmp)cmp_ror_scan_info); DBUG_EXECUTE("info",print_ror_scans_arr(param->table, "ordered", tree->ror_scans, tree->ror_scans_end);); @@ -4665,8 +4665,8 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param, bitmap_get_first(&(*scan)->covered_fields); } - qsort(ror_scan_mark, ror_scans_end-ror_scan_mark, sizeof(ROR_SCAN_INFO*), - (qsort_cmp)cmp_ror_scan_info_covering); + my_qsort(ror_scan_mark, ror_scans_end-ror_scan_mark, sizeof(ROR_SCAN_INFO*), + (qsort_cmp)cmp_ror_scan_info_covering); DBUG_EXECUTE("info", print_ror_scans_arr(param->table, "remaining scans", diff --git a/sql/partition_info.cc b/sql/partition_info.cc index ab887d5dda0..3b580422da1 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -524,6 +524,13 @@ bool partition_info::check_range_constants() current_largest= part_range_value; range_int_array[i]= part_range_value; } + else if (defined_max_value && + current_largest == part_range_value && + part_range_value == LONGLONG_MAX && + i == (no_parts - 1)) + { + range_int_array[i]= part_range_value; + } else { my_error(ER_RANGE_NOT_INCREASING_ERROR, MYF(0)); @@ -666,8 +673,8 @@ bool partition_info::check_list_constants() if (fixed && no_list_values) { bool first= TRUE; - qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY), - &list_part_cmp); + my_qsort((void*)list_array, no_list_values, sizeof(LIST_PART_ENTRY), + &list_part_cmp); i= 0; LINT_INIT(prev_value); diff --git a/sql/protocol.cc b/sql/protocol.cc index 4e727799773..c147b68ca1f 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -76,6 +76,12 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) DBUG_ASSERT(!thd->spcont); + if (thd->killed == THD::KILL_QUERY || thd->killed == THD::KILL_BAD_DATA) + { + thd->killed= THD::NOT_KILLED; + thd->mysys_var->abort= 0; + } + if (net && net->no_send_error) { thd->clear_error(); diff --git a/sql/records.cc b/sql/records.cc index 81c26da4b4d..349cc4a8329 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -55,6 +55,7 @@ static int rr_index(READ_RECORD *info); void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, bool print_error, uint idx) { + empty_record(table); bzero((char*) info,sizeof(*info)); info->table= table; info->file= table->file; @@ -161,6 +162,7 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, } else { + empty_record(table); info->record= table->record[0]; info->ref_length= table->file->ref_length; } @@ -565,7 +567,8 @@ static int rr_from_cache(READ_RECORD *info) int3store(ref_position,(long) i); ref_position+=3; } - qsort(info->read_positions,length,info->struct_length,(qsort_cmp) rr_cmp); + my_qsort(info->read_positions, length, info->struct_length, + (qsort_cmp) rr_cmp); position=info->read_positions; for (i=0 ; i < length ; i++) diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index 65c8e106112..ed0dc82cf01 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -65,6 +65,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols, my_ptrdiff_t const rec_offset= record - table->record[0]; my_ptrdiff_t const def_offset= table->s->default_values - table->record[0]; + DBUG_ENTER("pack_row"); + /* We write the null bits and the packed records using one pass through all the fields. The null bytes are written little-endian, @@ -96,26 +98,17 @@ pack_row(TABLE *table, MY_BITMAP const* cols, For big-endian machines, we have to make sure that the length is stored in little-endian format, since this is the format used for the binlog. - - We do this by setting the db_low_byte_first, which is used - inside some store_length() to decide what order to write the - bytes in. - - In reality, db_log_byte_first is only set for legacy table - type Isam, but in the event of a bug, we need to guarantee - the endianess when writing to the binlog. - - This is currently broken for NDB due to BUG#29549, so we - will fix it when NDB has fixed their way of handling BLOBs. */ -#if 0 - bool save= table->s->db_low_byte_first; - table->s->db_low_byte_first= TRUE; -#endif - pack_ptr= field->pack(pack_ptr, field->ptr + offset); -#if 0 - table->s->db_low_byte_first= save; +#ifndef DBUG_OFF + const uchar *old_pack_ptr= pack_ptr; #endif + pack_ptr= field->pack(pack_ptr, field->ptr + offset, + field->max_data_length(), TRUE); + DBUG_PRINT("debug", ("field: %s; pack_ptr: 0x%lx;" + " pack_ptr':0x%lx; bytes: %d", + field->field_name, (ulong) old_pack_ptr, + (ulong) pack_ptr, + (int) (pack_ptr - old_pack_ptr))); } null_mask <<= 1; @@ -143,8 +136,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols, packed data. If it doesn't, something is very wrong. */ DBUG_ASSERT(null_ptr == row_data + null_byte_count); - - return static_cast<size_t>(pack_ptr - row_data); + DBUG_DUMP("row_data", row_data, pack_ptr - row_data); + DBUG_RETURN(static_cast<size_t>(pack_ptr - row_data)); } #endif @@ -242,18 +235,16 @@ unpack_row(Relay_log_info const *rli, Use the master's size information if available else call normal unpack operation. */ -#if 0 - bool save= table->s->db_low_byte_first; - table->s->db_low_byte_first= TRUE; -#endif uint16 const metadata= tabledef->field_metadata(i); - if (tabledef && metadata) - pack_ptr= f->unpack(f->ptr, pack_ptr, metadata); - else - pack_ptr= f->unpack(f->ptr, pack_ptr); -#if 0 - table->s->db_low_byte_first= save; +#ifndef DBUG_OFF + uchar const *const old_pack_ptr= pack_ptr; #endif + pack_ptr= f->unpack(f->ptr, pack_ptr, metadata, TRUE); + DBUG_PRINT("debug", ("field: %s; metadata: 0x%x;" + " pack_ptr: 0x%lx; pack_ptr': 0x%lx; bytes: %d", + f->field_name, metadata, + (ulong) old_pack_ptr, (ulong) pack_ptr, + (int) (pack_ptr - old_pack_ptr))); } null_mask <<= 1; @@ -289,6 +280,8 @@ unpack_row(Relay_log_info const *rli, */ DBUG_ASSERT(null_ptr == row_data + master_null_byte_count); + DBUG_DUMP("row_data", row_data, pack_ptr - row_data); + *row_end = pack_ptr; if (master_reclength) { diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 867d55a60a3..15d7d97affd 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1082,6 +1082,9 @@ bool Relay_log_info::cached_charset_compare(char *charset) const void Relay_log_info::stmt_done(my_off_t event_master_log_pos, time_t event_creation_time) { +#ifndef DBUG_OFF + extern uint debug_not_change_ts_if_art_event; +#endif clear_flag(IN_STMT); /* @@ -1121,7 +1124,12 @@ void Relay_log_info::stmt_done(my_off_t event_master_log_pos, is that value may take some time to display in Seconds_Behind_Master - not critical). */ - last_master_timestamp= event_creation_time; +#ifndef DBUG_OFF + if (!(event_creation_time == 0 && debug_not_change_ts_if_art_event > 0)) +#else + if (event_creation_time != 0) +#endif + last_master_timestamp= event_creation_time; } } diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 10ecf1a43d4..a3a57ad4ce9 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -366,6 +366,18 @@ public: } /** + Get the value of a replication state flag. + + @param flag Flag to get value of + + @return @c true if the flag was set, @c false otherwise. + */ + bool get_flag(enum_state_flag flag) + { + return m_flags & (1UL << flag); + } + + /** Clear the value of a replication state flag. @param flag Flag to clear diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index d1ce5bf3b7b..b3ca26d4c2c 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -31,31 +31,34 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const switch (type(col)) { case MYSQL_TYPE_NEWDECIMAL: length= my_decimal_get_binary_size(m_field_metadata[col] >> 8, - m_field_metadata[col] - ((m_field_metadata[col] >> 8) << 8)); + m_field_metadata[col] & 0xff); break; case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_DOUBLE: length= m_field_metadata[col]; break; + /* + The cases for SET and ENUM are include for completeness, however + both are mapped to type MYSQL_TYPE_STRING and their real types + are encoded in the field metadata. + */ case MYSQL_TYPE_SET: case MYSQL_TYPE_ENUM: case MYSQL_TYPE_STRING: { - if (((m_field_metadata[col] & 0xff00) == (MYSQL_TYPE_SET << 8)) || - ((m_field_metadata[col] & 0xff00) == (MYSQL_TYPE_ENUM << 8))) + uchar type= m_field_metadata[col] >> 8U; + if ((type == MYSQL_TYPE_SET) || (type == MYSQL_TYPE_ENUM)) length= m_field_metadata[col] & 0x00ff; else { - length= m_field_metadata[col] & 0x00ff; - DBUG_ASSERT(length > 0); - if (length > 255) - { - DBUG_ASSERT(uint2korr(master_data) > 0); - length= uint2korr(master_data) + 2; - } - else - length= (uint) *master_data + 1; + /* + We are reading the actual size from the master_data record + because this field has the actual lengh stored in the first + byte. + */ + length= (uint) *master_data + 1; + DBUG_ASSERT(length != 0); } break; } @@ -95,6 +98,13 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const break; case MYSQL_TYPE_BIT: { + /* + Decode the size of the bit field from the master. + from_len is the length in bytes from the master + from_bit_len is the number of extra bits stored in the master record + If from_bit_len is not 0, add 1 to the length to account for accurate + number of bytes needed. + */ uint from_len= (m_field_metadata[col] >> 8U) & 0x00ff; uint from_bit_len= m_field_metadata[col] & 0x00ff; DBUG_ASSERT(from_bit_len <= 7); @@ -136,7 +146,7 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const length= *master_data; break; case 2: - length= sint2korr(master_data); + length= uint2korr(master_data); break; case 3: length= uint3korr(master_data); diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 26edbdd1405..375715c7858 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -99,7 +99,7 @@ public: /* These types store a single byte. */ - m_field_metadata[i]= (uchar)field_metadata[index]; + m_field_metadata[i]= field_metadata[index]; index++; break; } @@ -107,14 +107,14 @@ public: case MYSQL_TYPE_ENUM: case MYSQL_TYPE_STRING: { - short int x= field_metadata[index++] << 8U; // real_type - x = x + field_metadata[index++]; // pack or field length + uint16 x= field_metadata[index++] << 8U; // real_type + x+= field_metadata[index++]; // pack or field length m_field_metadata[i]= x; break; } case MYSQL_TYPE_BIT: { - short int x= field_metadata[index++]; + uint16 x= field_metadata[index++]; x = x + (field_metadata[index++] << 8U); m_field_metadata[i]= x; break; @@ -125,14 +125,14 @@ public: These types store two bytes. */ char *ptr= (char *)&field_metadata[index]; - m_field_metadata[i]= sint2korr(ptr); + m_field_metadata[i]= uint2korr(ptr); index= index + 2; break; } case MYSQL_TYPE_NEWDECIMAL: { - short int x= field_metadata[index++] << 8U; // precision - x = x + field_metadata[index++]; // decimals + uint16 x= field_metadata[index++] << 8U; // precision + x+= field_metadata[index++]; // decimals m_field_metadata[i]= x; break; } diff --git a/sql/scheduler.h b/sql/scheduler.h index 8351cefda4c..46bbd300cbb 100644 --- a/sql/scheduler.h +++ b/sql/scheduler.h @@ -40,7 +40,7 @@ public: enum scheduler_types { - SCHEDULER_ONE_THREAD_PER_CONNECTION=1, + SCHEDULER_ONE_THREAD_PER_CONNECTION=0, SCHEDULER_NO_THREADS, SCHEDULER_POOL_OF_THREADS }; diff --git a/sql/set_var.cc b/sql/set_var.cc index 8a6f0ac6285..f1826729914 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -168,7 +168,8 @@ static sys_var_character_set_sv sys_character_set_server(&vars, "character_set_s sys_var_const_str sys_charset_system(&vars, "character_set_system", (char *)my_charset_utf8_general_ci.name); static sys_var_character_set_database sys_character_set_database(&vars, "character_set_database"); -static sys_var_character_set_sv sys_character_set_client(&vars, "character_set_client", +static sys_var_character_set_client sys_character_set_client(&vars, + "character_set_client", &SV::character_set_client, &default_charset_info); static sys_var_character_set_sv sys_character_set_connection(&vars, "character_set_connection", @@ -1907,6 +1908,21 @@ CHARSET_INFO **sys_var_character_set_sv::ci_ptr(THD *thd, enum_var_type type) } +bool sys_var_character_set_client::check(THD *thd, set_var *var) +{ + if (sys_var_character_set_sv::check(thd, var)) + return 1; + /* Currently, UCS-2 cannot be used as a client character set */ + if (var->save_result.charset->mbminlen > 1) + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, + var->save_result.charset->csname); + return 1; + } + return 0; +} + + CHARSET_INFO ** sys_var_character_set_database::ci_ptr(THD *thd, enum_var_type type) { @@ -2148,18 +2164,24 @@ void sys_var_log_state::set_default(THD *thd, enum_var_type type) static int sys_check_log_path(THD *thd, set_var *var) { - char path[FN_REFLEN]; + char path[FN_REFLEN], buff[FN_REFLEN]; MY_STAT f_stat; - const char *var_path= var->value->str_value.ptr(); + String str(buff, sizeof(buff), system_charset_info), *res; + const char *log_file_str; + + if (!(res= var->value->val_str(&str))) + goto err; + + log_file_str= res->c_ptr(); bzero(&f_stat, sizeof(MY_STAT)); - (void) unpack_filename(path, var_path); + (void) unpack_filename(path, log_file_str); if (my_stat(path, &f_stat, MYF(0))) { /* Check if argument is a file and we have 'write' permission */ if (!MY_S_ISREG(f_stat.st_mode) || !(f_stat.st_mode & MY_S_IWRITE)) - return -1; + goto err; } else { @@ -2168,11 +2190,16 @@ static int sys_check_log_path(THD *thd, set_var *var) Check if directory exists and we have permission to create file & write to file */ - (void) dirname_part(path, var_path, &path_length); + (void) dirname_part(path, log_file_str, &path_length); if (my_access(path, (F_OK|W_OK))) - return -1; + goto err; } return 0; + +err: + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, + res ? log_file_str : "NULL"); + return 1; } @@ -2325,6 +2352,13 @@ uchar *sys_var_log_output::value_ptr(THD *thd, enum_var_type type, int set_var_collation_client::check(THD *thd) { + /* Currently, UCS-2 cannot be used as a client character set */ + if (character_set_client->mbminlen > 1) + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client", + character_set_client->csname); + return 1; + } return 0; } @@ -2946,7 +2980,8 @@ SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted) /* sort into order */ if (sorted) - qsort(result, count + fixed_count, sizeof(SHOW_VAR), (qsort_cmp)show_cmp); + my_qsort(result, count + fixed_count, sizeof(SHOW_VAR), + (qsort_cmp) show_cmp); /* make last element empty */ bzero(show, sizeof(SHOW_VAR)); diff --git a/sql/set_var.h b/sql/set_var.h index 2881903133d..4e13409b7f6 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -668,6 +668,20 @@ public: }; +class sys_var_character_set_client: public sys_var_character_set_sv +{ +public: + sys_var_character_set_client(sys_var_chain *chain, const char *name_arg, + CHARSET_INFO *SV::*offset_arg, + CHARSET_INFO **global_default_arg, + bool is_nullable= 0) + : sys_var_character_set_sv(chain, name_arg, offset_arg, global_default_arg, + is_nullable) + { } + bool check(THD *thd, set_var *var); +}; + + class sys_var_character_set_database :public sys_var_character_set { public: diff --git a/sql/slave.cc b/sql/slave.cc index 2f95f8ee2e9..f530f2a810d 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1014,6 +1014,12 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db, goto err; // mysql_parse took care of the error send thd->proc_info = "Opening master dump table"; + /* + Note: If this function starts to fail for MERGE tables, + change the next two lines to these: + tables.table= NULL; // was set by mysql_rm_table() + if (!open_n_lock_single_table(thd, &tables, TL_WRITE)) + */ tables.lock_type = TL_WRITE; if (!open_ltable(thd, &tables, TL_WRITE, 0)) { @@ -1716,7 +1722,14 @@ static int has_temporary_error(THD *thd) DBUG_ENTER("has_temporary_error"); if (thd->is_fatal_error) + { + DBUG_PRINT("info", ("thd->net.last_errno: %s", ER(thd->net.last_errno))); DBUG_RETURN(0); + } + + DBUG_EXECUTE_IF("all_errors_are_temporary_errors", + if (thd->net.last_errno) + thd->net.last_errno= ER_LOCK_DEADLOCK;); /* Temporary error codes: @@ -1725,7 +1738,10 @@ static int has_temporary_error(THD *thd) */ if (thd->net.last_errno == ER_LOCK_DEADLOCK || thd->net.last_errno == ER_LOCK_WAIT_TIMEOUT) + { + DBUG_PRINT("info", ("thd->net.last_errno: %s", ER(thd->net.last_errno))); DBUG_RETURN(1); + } #ifdef HAVE_NDB_BINLOG /* @@ -1796,9 +1812,6 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) int const type_code= ev->get_type_code(); int exec_res= 0; - /* - */ - DBUG_PRINT("exec_event",("%s(type_code: %d; server_id: %d)", ev->get_type_str(), type_code, ev->server_id)); DBUG_PRINT("info", ("thd->options: %s%s; rli->last_event_start_time: %lu", @@ -1807,7 +1820,6 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) rli->last_event_start_time)); - /* Execute the event to change the database and update the binary log coordinates, but first we set some data that is needed for @@ -1855,10 +1867,13 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) // EVENT_SKIP_NOT, "not skipped", // EVENT_SKIP_IGNORE, - "skipped because event originated from this server", + "skipped because event should be ignored", // EVENT_SKIP_COUNT "skipped because event skip counter was non-zero" }; + DBUG_PRINT("info", ("OPTION_BEGIN: %d; IN_STMT: %d", + thd->options & OPTION_BEGIN ? 1 : 0, + rli->get_flag(Relay_log_info::IN_STMT))); DBUG_PRINT("skip_event", ("%s event was %s", ev->get_type_str(), explain[reason])); #endif @@ -1907,7 +1922,8 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) } if (slave_trans_retries) { - if (exec_res && has_temporary_error(thd)) + int temp_err; + if (exec_res && (temp_err= has_temporary_error(thd))) { const char *errmsg; /* @@ -1955,15 +1971,19 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) "the slave_transaction_retries variable.", slave_trans_retries); } - else if (!((thd->options & OPTION_BEGIN) && opt_using_transactions)) + else if (exec_res && !temp_err || + (opt_using_transactions && + rli->group_relay_log_pos == rli->event_relay_log_pos)) { /* - Only reset the retry counter if the event succeeded or - failed with a non-transient error. On a successful event, - the execution will proceed as usual; in the case of a + Only reset the retry counter if the entire group succeeded + or failed with a non-transient error. On a successful + event, the execution will proceed as usual; in the case of a non-transient error, the slave will stop with an error. */ rli->trans_retries= 0; // restart from fresh + DBUG_PRINT("info", ("Resetting retry counter, rli->trans_retries: %lu", + rli->trans_retries)); } } DBUG_RETURN(exec_res); @@ -2456,6 +2476,7 @@ pthread_handler_t handle_slave_sql(void *arg) rli->ignore_log_space_limit= 0; pthread_mutex_unlock(&rli->log_space_lock); rli->trans_retries= 0; // start from "no error" + DBUG_PRINT("info", ("rli->trans_retries: %lu", rli->trans_retries)); if (init_relay_log_pos(rli, rli->group_relay_log_name, @@ -3587,7 +3608,16 @@ static Log_event* next_event(Relay_log_info* rli) a new event and is queuing it; the false "0" will exist until SQL finishes executing the new event; it will be look abnormal only if the events have old timestamps (then you get "many", 0, "many"). - Transient phases like this can't really be fixed. + + Transient phases like this can be fixed with implemeting + Heartbeat event which provides the slave the status of the + master at time the master does not have any new update to send. + Seconds_Behind_Master would be zero only when master has no + more updates in binlog for slave. The heartbeat can be sent + in a (small) fraction of slave_net_timeout. Until it's done + rli->last_master_timestamp is temporarely (for time of + waiting for the following event) reset whenever EOF is + reached. */ time_t save_timestamp= rli->last_master_timestamp; rli->last_master_timestamp= 0; diff --git a/sql/sp_head.cc b/sql/sp_head.cc index c0ea73a6c00..4b432cef5cd 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -102,8 +102,9 @@ sp_get_item_value(THD *thd, Item *item, String *str) case REAL_RESULT: case INT_RESULT: case DECIMAL_RESULT: - return item->val_str(str); - + if (item->field_type() != MYSQL_TYPE_BIT) + return item->val_str(str); + else {/* Bit type is handled as binary string */} case STRING_RESULT: { String *result= item->val_str(str); @@ -465,14 +466,16 @@ check_routine_name(LEX_STRING *ident) */ void * -sp_head::operator new(size_t size) +sp_head::operator new(size_t size) throw() { DBUG_ENTER("sp_head::operator new"); MEM_ROOT own_root; sp_head *sp; - init_alloc_root(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); + init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); sp= (sp_head *) alloc_root(&own_root, size); + if (sp == NULL) + return NULL; sp->main_mem_root= own_root; DBUG_PRINT("info", ("mem_root 0x%lx", (ulong) &sp->mem_root)); DBUG_RETURN(sp); @@ -483,6 +486,10 @@ sp_head::operator delete(void *ptr, size_t size) { DBUG_ENTER("sp_head::operator delete"); MEM_ROOT own_root; + + if (ptr == NULL) + DBUG_VOID_RETURN; + sp_head *sp= (sp_head *) ptr; /* Make a copy of main_mem_root as free_root will free the sp */ @@ -536,6 +543,9 @@ sp_head::init(LEX *lex) lex->spcont= m_pcont= new sp_pcontext(); + if (!lex->spcont) + DBUG_VOID_RETURN; + /* Altough trg_table_fields list is used only in triggers we init for all types of stored procedures to simplify reset_lex()/restore_lex() code. @@ -1069,7 +1079,7 @@ sp_head::execute(THD *thd) DBUG_RETURN(TRUE); /* init per-instruction memroot */ - init_alloc_root(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0); + init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0); DBUG_ASSERT(!(m_flags & IS_INVOKED)); m_flags|= IS_INVOKED; @@ -1961,16 +1971,29 @@ sp_head::execute_procedure(THD *thd, List<Item> *args) } -// Reset lex during parsing, before we parse a sub statement. -void +/** + @brief Reset lex during parsing, before we parse a sub statement. + + @param thd Thread handler. + + @return Error state + @retval true An error occurred. + @retval false Success. +*/ + +bool sp_head::reset_lex(THD *thd) { DBUG_ENTER("sp_head::reset_lex"); LEX *sublex; LEX *oldlex= thd->lex; + sublex= new (thd->mem_root)st_lex_local; + if (sublex == 0) + DBUG_RETURN(TRUE); + + thd->lex= sublex; (void)m_lex.push_front(oldlex); - thd->lex= sublex= new st_lex; /* Reset most stuff. */ lex_start(thd); @@ -1991,7 +2014,7 @@ sp_head::reset_lex(THD *thd) sublex->interval_list.empty(); sublex->type= 0; - DBUG_VOID_RETURN; + DBUG_RETURN(FALSE); } // Restore lex during parsing, after we have parsed a sub statement. @@ -3856,7 +3879,7 @@ sp_add_to_query_tables(THD *thd, LEX *lex, if (!(table= (TABLE_LIST *)thd->calloc(sizeof(TABLE_LIST)))) { - my_error(ER_OUTOFMEMORY, MYF(0), sizeof(TABLE_LIST)); + thd->fatal_error(); return NULL; } table->db_length= strlen(db); diff --git a/sql/sp_head.h b/sql/sp_head.h index d74170534bd..86a77a434ff 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -260,10 +260,10 @@ public: Security_context m_security_ctx; static void * - operator new(size_t size); + operator new(size_t size) throw (); static void - operator delete(void *ptr, size_t size); + operator delete(void *ptr, size_t size) throw (); sp_head(); @@ -326,7 +326,7 @@ public: } // Resets lex in 'thd' and keeps a copy of the old one. - void + bool reset_lex(THD *thd); // Restores lex in 'thd' from our copy, but keeps some status from the diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 311b76c6149..58ba8c28fb7 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -365,8 +365,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) #endif VOID(push_dynamic(&acl_hosts,(uchar*) &host)); } - qsort((uchar*) dynamic_element(&acl_hosts,0,ACL_HOST*),acl_hosts.elements, - sizeof(ACL_HOST),(qsort_cmp) acl_compare); + my_qsort((uchar*) dynamic_element(&acl_hosts,0,ACL_HOST*),acl_hosts.elements, + sizeof(ACL_HOST),(qsort_cmp) acl_compare); end_read_record(&read_record_info); freeze_size(&acl_hosts); @@ -553,8 +553,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) allow_all_hosts=1; // Anyone can connect } } - qsort((uchar*) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements, - sizeof(ACL_USER),(qsort_cmp) acl_compare); + my_qsort((uchar*) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements, + sizeof(ACL_USER),(qsort_cmp) acl_compare); end_read_record(&read_record_info); freeze_size(&acl_users); @@ -612,8 +612,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) #endif VOID(push_dynamic(&acl_dbs,(uchar*) &db)); } - qsort((uchar*) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements, - sizeof(ACL_DB),(qsort_cmp) acl_compare); + my_qsort((uchar*) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements, + sizeof(ACL_DB),(qsort_cmp) acl_compare); end_read_record(&read_record_info); freeze_size(&acl_dbs); init_check_host(); @@ -1243,8 +1243,8 @@ static void acl_insert_user(const char *user, const char *host, if (!acl_user.host.hostname || (acl_user.host.hostname[0] == wild_many && !acl_user.host.hostname[1])) allow_all_hosts=1; // Anyone can connect /* purecov: tested */ - qsort((uchar*) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements, - sizeof(ACL_USER),(qsort_cmp) acl_compare); + my_qsort((uchar*) dynamic_element(&acl_users,0,ACL_USER*),acl_users.elements, + sizeof(ACL_USER),(qsort_cmp) acl_compare); /* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */ rebuild_check_host(); @@ -1306,8 +1306,8 @@ static void acl_insert_db(const char *user, const char *host, const char *db, acl_db.access=privileges; acl_db.sort=get_sort(3,acl_db.host.hostname,acl_db.db,acl_db.user); VOID(push_dynamic(&acl_dbs,(uchar*) &acl_db)); - qsort((uchar*) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements, - sizeof(ACL_DB),(qsort_cmp) acl_compare); + my_qsort((uchar*) dynamic_element(&acl_dbs,0,ACL_DB*),acl_dbs.elements, + sizeof(ACL_DB),(qsort_cmp) acl_compare); } @@ -3472,16 +3472,13 @@ void grant_free(void) } -/* - Initialize structures responsible for table/column-level privilege checking - and load information for them from tables in the 'mysql' database. - - SYNOPSIS - grant_init() +/** + @brief Initialize structures responsible for table/column-level privilege + checking and load information for them from tables in the 'mysql' database. - RETURN VALUES - 0 ok - 1 Could not initialize grant's + @return Error status + @retval 0 OK + @retval 1 Could not initialize grant subsystem. */ my_bool grant_init() @@ -3503,96 +3500,144 @@ my_bool grant_init() } -/* - Initialize structures responsible for table/column-level privilege - checking and load information about grants from open privilege tables. +/** + @brief Helper function to grant_reload_procs_priv - SYNOPSIS - grant_load() - thd Current thread - tables List containing open "mysql.tables_priv" and - "mysql.columns_priv" tables. + Reads the procs_priv table into memory hash. - RETURN VALUES - FALSE - success - TRUE - error + @param table A pointer to the procs_priv table structure. + + @see grant_reload + @see grant_reload_procs_priv + + @return Error state + @retval TRUE An error occurred + @retval FALSE Success */ -static my_bool grant_load(TABLE_LIST *tables) +static my_bool grant_load_procs_priv(TABLE *p_table) { MEM_ROOT *memex_ptr; my_bool return_val= 1; - TABLE *t_table, *c_table, *p_table; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; MEM_ROOT **save_mem_root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); DBUG_ENTER("grant_load"); - - (void) hash_init(&column_priv_hash,system_charset_info, - 0,0,0, (hash_get_key) get_grant_table, - (hash_free_key) free_grant_table,0); (void) hash_init(&proc_priv_hash,system_charset_info, - 0,0,0, (hash_get_key) get_grant_table, - 0,0); + 0,0,0, (hash_get_key) get_grant_table, + 0,0); (void) hash_init(&func_priv_hash,system_charset_info, - 0,0,0, (hash_get_key) get_grant_table, - 0,0); - init_sql_alloc(&memex, ACL_ALLOC_BLOCK_SIZE, 0); - - t_table = tables[0].table; - c_table = tables[1].table; - p_table= tables[2].table; - t_table->file->ha_index_init(0, 1); + 0,0,0, (hash_get_key) get_grant_table, + 0,0); p_table->file->ha_index_init(0, 1); - t_table->use_all_columns(); - c_table->use_all_columns(); p_table->use_all_columns(); - if (!t_table->file->index_first(t_table->record[0])) + + if (!p_table->file->index_first(p_table->record[0])) { memex_ptr= &memex; my_pthread_setspecific_ptr(THR_MALLOC, &memex_ptr); do { - GRANT_TABLE *mem_check; - if (!(mem_check=new (memex_ptr) GRANT_TABLE(t_table,c_table))) + GRANT_NAME *mem_check; + HASH *hash; + if (!(mem_check=new (memex_ptr) GRANT_NAME(p_table))) { - /* This could only happen if we are out memory */ - goto end_unlock; + /* This could only happen if we are out memory */ + goto end_unlock; } if (check_no_resolve) { if (hostname_requires_resolving(mem_check->host.hostname)) { - sql_print_warning("'tables_priv' entry '%s %s@%s' " + sql_print_warning("'procs_priv' entry '%s %s@%s' " "ignored in --skip-name-resolve mode.", - mem_check->tname, - mem_check->user ? mem_check->user : "", + mem_check->tname, mem_check->user, mem_check->host.hostname ? mem_check->host.hostname : ""); - continue; - } + continue; + } + } + if (p_table->field[4]->val_int() == TYPE_ENUM_PROCEDURE) + { + hash= &proc_priv_hash; + } + else + if (p_table->field[4]->val_int() == TYPE_ENUM_FUNCTION) + { + hash= &func_priv_hash; + } + else + { + sql_print_warning("'procs_priv' entry '%s' " + "ignored, bad routine type", + mem_check->tname); + continue; } + mem_check->privs= fix_rights_for_procedure(mem_check->privs); if (! mem_check->ok()) - delete mem_check; - else if (my_hash_insert(&column_priv_hash,(uchar*) mem_check)) + delete mem_check; + else if (my_hash_insert(hash, (uchar*) mem_check)) { - delete mem_check; - goto end_unlock; + delete mem_check; + goto end_unlock; } } - while (!t_table->file->index_next(t_table->record[0])); + while (!p_table->file->index_next(p_table->record[0])); } - if (!p_table->file->index_first(p_table->record[0])) + /* Return ok */ + return_val= 0; + +end_unlock: + p_table->file->ha_index_end(); + my_pthread_setspecific_ptr(THR_MALLOC, save_mem_root_ptr); + DBUG_RETURN(return_val); +} + + +/** + @brief Initialize structures responsible for table/column-level privilege + checking and load information about grants from open privilege tables. + + @param thd Current thread + @param tables List containing open "mysql.tables_priv" and + "mysql.columns_priv" tables. + + @see grant_reload + + @return Error state + @retval FALSE Success + @retval TRUE Error +*/ + +static my_bool grant_load(TABLE_LIST *tables) +{ + MEM_ROOT *memex_ptr; + my_bool return_val= 1; + TABLE *t_table= 0, *c_table= 0; + bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; + MEM_ROOT **save_mem_root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, + THR_MALLOC); + DBUG_ENTER("grant_load"); + (void) hash_init(&column_priv_hash,system_charset_info, + 0,0,0, (hash_get_key) get_grant_table, + (hash_free_key) free_grant_table,0); + + t_table = tables[0].table; + c_table = tables[1].table; + t_table->file->ha_index_init(0, 1); + t_table->use_all_columns(); + c_table->use_all_columns(); + + if (!t_table->file->index_first(t_table->record[0])) { memex_ptr= &memex; my_pthread_setspecific_ptr(THR_MALLOC, &memex_ptr); do { - GRANT_NAME *mem_check; - HASH *hash; - if (!(mem_check=new (&memex) GRANT_NAME(p_table))) + GRANT_TABLE *mem_check; + if (!(mem_check=new (memex_ptr) GRANT_TABLE(t_table,c_table))) { /* This could only happen if we are out memory */ goto end_unlock; @@ -3602,74 +3647,111 @@ static my_bool grant_load(TABLE_LIST *tables) { if (hostname_requires_resolving(mem_check->host.hostname)) { - sql_print_warning("'procs_priv' entry '%s %s@%s' " + sql_print_warning("'tables_priv' entry '%s %s@%s' " "ignored in --skip-name-resolve mode.", - mem_check->tname, mem_check->user, + mem_check->tname, + mem_check->user ? mem_check->user : "", mem_check->host.hostname ? mem_check->host.hostname : ""); continue; } } - if (p_table->field[4]->val_int() == TYPE_ENUM_PROCEDURE) - { - hash= &proc_priv_hash; - } - else - if (p_table->field[4]->val_int() == TYPE_ENUM_FUNCTION) - { - hash= &func_priv_hash; - } - else - { - sql_print_warning("'procs_priv' entry '%s' " - "ignored, bad routine type", - mem_check->tname); - continue; - } - mem_check->privs= fix_rights_for_procedure(mem_check->privs); if (! mem_check->ok()) delete mem_check; - else if (my_hash_insert(hash, (uchar*) mem_check)) + else if (my_hash_insert(&column_priv_hash,(uchar*) mem_check)) { delete mem_check; goto end_unlock; } } - while (!p_table->file->index_next(p_table->record[0])); + while (!t_table->file->index_next(t_table->record[0])); } + return_val=0; // Return ok end_unlock: t_table->file->ha_index_end(); - p_table->file->ha_index_end(); my_pthread_setspecific_ptr(THR_MALLOC, save_mem_root_ptr); DBUG_RETURN(return_val); } -/* - Reload information about table and column level privileges if possible. +/** + @brief Helper function to grant_reload. Reloads procs_priv table is it + exists. - SYNOPSIS - grant_reload() - thd Current thread + @param thd A pointer to the thread handler object. - NOTES - Locked tables are checked by acl_reload() and doesn't have to be checked - in this call. - This function is also used for initialization of structures responsible - for table/column-level privilege checking. + @see grant_reload - RETURN VALUE - FALSE Success - TRUE Error + @return Error state + @retval FALSE Success + @retval TRUE An error has occurred. +*/ + +static my_bool grant_reload_procs_priv(THD *thd) +{ + HASH old_proc_priv_hash, old_func_priv_hash; + TABLE_LIST table; + my_bool return_val= FALSE; + DBUG_ENTER("grant_reload_procs_priv"); + + bzero((char*) &table, sizeof(table)); + table.alias= table.table_name= (char*) "procs_priv"; + table.db= (char *) "mysql"; + table.lock_type= TL_READ; + + if (simple_open_n_lock_tables(thd, &table)) + { + close_thread_tables(thd); + DBUG_RETURN(TRUE); + } + + /* Save a copy of the current hash if we need to undo the grant load */ + old_proc_priv_hash= proc_priv_hash; + old_func_priv_hash= func_priv_hash; + + rw_wrlock(&LOCK_grant); + if ((return_val= grant_load_procs_priv(table.table))) + { + /* Error; Reverting to old hash */ + DBUG_PRINT("error",("Reverting to old privileges")); + grant_free(); + proc_priv_hash= old_proc_priv_hash; + func_priv_hash= old_func_priv_hash; + } + else + { + hash_free(&old_proc_priv_hash); + hash_free(&old_func_priv_hash); + } + rw_unlock(&LOCK_grant); + + close_thread_tables(thd); + DBUG_RETURN(return_val); +} + + +/** + @brief Reload information about table and column level privileges if possible + + @param thd Current thread + + Locked tables are checked by acl_reload() and doesn't have to be checked + in this call. + This function is also used for initialization of structures responsible + for table/column-level privilege checking. + + @return Error state + @retval FALSE Success + @retval TRUE Error */ my_bool grant_reload(THD *thd) { - TABLE_LIST tables[3]; - HASH old_column_priv_hash, old_proc_priv_hash, old_func_priv_hash; + TABLE_LIST tables[2]; + HASH old_column_priv_hash; MEM_ROOT old_mem; my_bool return_val= 1; DBUG_ENTER("grant_reload"); @@ -3681,11 +3763,9 @@ my_bool grant_reload(THD *thd) bzero((char*) tables, sizeof(tables)); tables[0].alias= tables[0].table_name= (char*) "tables_priv"; tables[1].alias= tables[1].table_name= (char*) "columns_priv"; - tables[2].alias= tables[2].table_name= (char*) "procs_priv"; - tables[0].db= tables[1].db= tables[2].db= (char *) "mysql"; + tables[0].db= tables[1].db= (char *) "mysql"; tables[0].next_local= tables[0].next_global= tables+1; - tables[1].next_local= tables[1].next_global= tables+2; - tables[0].lock_type= tables[1].lock_type= tables[2].lock_type= TL_READ; + tables[0].lock_type= tables[1].lock_type= TL_READ; /* To avoid deadlocks we should obtain table locks before @@ -3695,35 +3775,45 @@ my_bool grant_reload(THD *thd) goto end; rw_wrlock(&LOCK_grant); - grant_version++; old_column_priv_hash= column_priv_hash; - old_proc_priv_hash= proc_priv_hash; - old_func_priv_hash= func_priv_hash; + + /* + Create a new memory pool but save the current memory pool to make an undo + opertion possible in case of failure. + */ old_mem= memex; + init_sql_alloc(&memex, ACL_ALLOC_BLOCK_SIZE, 0); if ((return_val= grant_load(tables))) { // Error. Revert to old hash DBUG_PRINT("error",("Reverting to old privileges")); grant_free(); /* purecov: deadcode */ column_priv_hash= old_column_priv_hash; /* purecov: deadcode */ - proc_priv_hash= old_proc_priv_hash; - func_priv_hash= old_func_priv_hash; memex= old_mem; /* purecov: deadcode */ } else { hash_free(&old_column_priv_hash); - hash_free(&old_proc_priv_hash); - hash_free(&old_func_priv_hash); free_root(&old_mem,MYF(0)); } rw_unlock(&LOCK_grant); -end: close_thread_tables(thd); + + /* + It is ok failing to load procs_priv table because we may be + working with 4.1 privilege tables. + */ + if (grant_reload_procs_priv(thd)) + my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0), "mysql.procs_priv"); + + rw_wrlock(&LOCK_grant); + grant_version++; + rw_unlock(&LOCK_grant); + +end: DBUG_RETURN(return_val); } - /**************************************************************************** Check table level grants diff --git a/sql/sql_array.h b/sql/sql_array.h index ab6fdd0c5c0..e1b22921519 100644 --- a/sql/sql_array.h +++ b/sql/sql_array.h @@ -62,7 +62,7 @@ public: void sort(CMP_FUNC cmp_func) { - qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func); + my_qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func); } }; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6896ccd1b8c..4474671eadf 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -87,7 +87,6 @@ bool Prelock_error_handler::safely_trapped_errors() @defgroup Data_Dictionary Data Dictionary @{ */ - TABLE *unused_tables; /* Used by mysql_test */ HASH open_cache; /* Used by mysql_test */ static HASH table_def_cache; @@ -684,6 +683,9 @@ TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name) to open the table thd->killed will be set if we run out of memory + + If closing a MERGE child, the calling function has to take care for + closing the parent too, if necessary. */ @@ -712,6 +714,12 @@ void close_handle_and_leave_table_as_lock(TABLE *table) share->tmp_table= INTERNAL_TMP_TABLE; // for intern_close_table() } + /* + When closing a MERGE parent or child table, detach the children first. + Do not clear child table references to allow for reopen. + */ + if (table->child_l || table->parent) + detach_merge_children(table, FALSE); table->file->close(); table->db_stat= 0; // Mark file closed release_table_share(table->s, RELEASE_NORMAL); @@ -812,6 +820,10 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *db, const char *wild) void intern_close_table(TABLE *table) { // Free all structures DBUG_ENTER("intern_close_table"); + DBUG_PRINT("tcache", ("table: '%s'.'%s' 0x%lx", + table->s ? table->s->db.str : "?", + table->s ? table->s->table_name.str : "?", + (long) table)); free_io_cache(table); delete table->triggers; @@ -835,6 +847,9 @@ static void free_cache_entry(TABLE *table) { DBUG_ENTER("free_cache_entry"); + /* Assert that MERGE children are not attached before final close. */ + DBUG_ASSERT(!table->is_children_attached()); + intern_close_table(table); if (!table->in_use) { @@ -901,6 +916,54 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, pthread_mutex_lock(&oldest_unused_share->mutex); VOID(hash_delete(&table_def_cache, (uchar*) oldest_unused_share)); } + DBUG_PRINT("tcache", ("incremented global refresh_version to: %lu", + refresh_version)); + if (if_wait_for_refresh) + { + /* + Other threads could wait in a loop in open_and_lock_tables(), + trying to lock one or more of our tables. + + If they wait for the locks in thr_multi_lock(), their lock + request is aborted. They loop in open_and_lock_tables() and + enter open_table(). Here they notice the table is refreshed and + wait for COND_refresh. Then they loop again in + open_and_lock_tables() and this time open_table() succeeds. At + this moment, if we (the FLUSH TABLES thread) are scheduled and + on another FLUSH TABLES enter close_cached_tables(), they could + awake while we sleep below, waiting for others threads (us) to + close their open tables. If this happens, the other threads + would find the tables unlocked. They would get the locks, one + after the other, and could do their destructive work. This is an + issue if we have LOCK TABLES in effect. + + The problem is that the other threads passed all checks in + open_table() before we refresh the table. + + The fix for this problem is to set some_tables_deleted for all + threads with open tables. These threads can still get their + locks, but will immediately release them again after checking + this variable. They will then loop in open_and_lock_tables() + again. There they will wait until we update all tables version + below. + + Setting some_tables_deleted is done by remove_table_from_cache() + in the other branch. + + In other words (reviewer suggestion): You need this setting of + some_tables_deleted for the case when table was opened and all + related checks were passed before incrementing refresh_version + (which you already have) but attempt to lock the table happened + after the call to close_old_data_files() i.e. after removal of + current thread locks. + */ + for (uint idx=0 ; idx < open_cache.records ; idx++) + { + TABLE *table=(TABLE*) hash_element(&open_cache,idx); + if (table->in_use) + table->in_use->some_tables_deleted= 1; + } + } } else { @@ -929,8 +992,8 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, thd->proc_info="Flushing tables"; close_old_data_files(thd,thd->open_tables,1,1); - mysql_ha_flush(thd, tables, MYSQL_HA_REOPEN_ON_USAGE | MYSQL_HA_FLUSH_ALL, - TRUE); + mysql_ha_flush(thd); + bool found=1; /* Wait until all threads has closed all the tables we had locked */ DBUG_PRINT("info", @@ -1073,6 +1136,14 @@ static void mark_temp_tables_as_free_for_reuse(THD *thd) { table->query_id= 0; table->file->ha_reset(); + /* + Detach temporary MERGE children from temporary parent to allow new + attach at next open. Do not do the detach, if close_thread_tables() + is called from a sub-statement. The temporary table might still be + used in the top-level statement. + */ + if (table->child_l || table->parent) + detach_merge_children(table, TRUE); } } } @@ -1170,9 +1241,17 @@ static void close_open_tables(THD *thd) void close_thread_tables(THD *thd) { + TABLE *table; prelocked_mode_type prelocked_mode= thd->prelocked_mode; DBUG_ENTER("close_thread_tables"); +#ifdef EXTRA_DEBUG + DBUG_PRINT("tcache", ("open tables:")); + for (table= thd->open_tables; table; table= table->next) + DBUG_PRINT("tcache", ("table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); +#endif + /* We are assuming here that thd->derived_tables contains ONLY derived tables for this substatement. i.e. instead of approach which uses @@ -1186,7 +1265,7 @@ void close_thread_tables(THD *thd) */ if (thd->derived_tables) { - TABLE *table, *next; + TABLE *next; /* Close all derived tables generated in queries like SELECT * FROM (SELECT * FROM t1) @@ -1266,6 +1345,13 @@ void close_thread_tables(THD *thd) if (!thd->active_transaction()) thd->transaction.xid_state.xid.null(); + /* + Note that we need to hold LOCK_open while changing the + open_tables list. Another thread may work on it. + (See: remove_table_from_cache(), mysql_wait_completed_table()) + Closing a MERGE child before the parent would be fatal if the + other thread tries to abort the MERGE lock in between. + */ if (thd->open_tables) close_open_tables(thd); @@ -1292,8 +1378,17 @@ bool close_thread_table(THD *thd, TABLE **table_ptr) DBUG_ENTER("close_thread_table"); DBUG_ASSERT(table->key_read == 0); DBUG_ASSERT(!table->file || table->file->inited == handler::NONE); + DBUG_PRINT("tcache", ("table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); *table_ptr=table->next; + /* + When closing a MERGE parent or child table, detach the children first. + Clear child table references to force new assignment at next open. + */ + if (table->child_l || table->parent) + detach_merge_children(table, TRUE); + if (table->needs_reopen_or_name_lock() || thd->version != refresh_version || !table->db_stat) { @@ -1308,6 +1403,9 @@ bool close_thread_table(THD *thd, TABLE **table_ptr) */ DBUG_ASSERT(!table->open_placeholder); + /* Assert that MERGE children are not attached in unused_tables. */ + DBUG_ASSERT(!table->is_children_attached()); + /* Free memory and reset for next loop */ table->file->ha_reset(); table->in_use=0; @@ -1729,6 +1827,8 @@ int drop_temporary_table(THD *thd, TABLE_LIST *table_list) { TABLE *table; DBUG_ENTER("drop_temporary_table"); + DBUG_PRINT("tmptable", ("closing table: '%s'.'%s'", + table_list->db, table_list->table_name)); if (!(table= find_temporary_table(thd, table_list))) DBUG_RETURN(1); @@ -1756,6 +1856,24 @@ int drop_temporary_table(THD *thd, TABLE_LIST *table_list) void close_temporary_table(THD *thd, TABLE *table, bool free_share, bool delete_table) { + DBUG_ENTER("close_temporary_table"); + DBUG_PRINT("tmptable", ("closing table: '%s'.'%s' 0x%lx alias: '%s'", + table->s->db.str, table->s->table_name.str, + (long) table, table->alias)); + + /* + When closing a MERGE parent or child table, detach the children + first. Clear child table references as MERGE table cannot be + reopened after final close of one of its tables. + + This is necessary here because it is sometimes called with attached + tables and without prior close_thread_tables(). E.g. in + mysql_alter_table(), mysql_rm_table_part2(), mysql_truncate(), + drop_open_table(). + */ + if (table->child_l || table->parent) + detach_merge_children(table, TRUE); + if (table->prev) { table->prev->next= table->next; @@ -1782,6 +1900,7 @@ void close_temporary_table(THD *thd, TABLE *table, slave_open_temp_tables--; } close_temporary(table, free_share, delete_table); + DBUG_VOID_RETURN; } @@ -1797,6 +1916,8 @@ void close_temporary(TABLE *table, bool free_share, bool delete_table) { handlerton *table_type= table->s->db_type(); DBUG_ENTER("close_temporary"); + DBUG_PRINT("tmptable", ("closing table: '%s'.'%s'", + table->s->db.str, table->s->table_name.str)); free_io_cache(table); closefrm(table, 0); @@ -1843,6 +1964,9 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *db, static void relink_unused(TABLE *table) { + /* Assert that MERGE children are not attached in unused_tables. */ + DBUG_ASSERT(!table->is_children_attached()); + if (table != unused_tables) { table->prev->next=table->next; /* Remove from unused list */ @@ -1858,6 +1982,77 @@ static void relink_unused(TABLE *table) /** + @brief Prepare an open merge table for close. + + @param[in] thd thread context + @param[in] table table to prepare + @param[in,out] prev_pp pointer to pointer of previous table + + @detail + If the table is a MERGE parent, just detach the children. + If the table is a MERGE child, close the parent (incl. detach). +*/ + +static void unlink_open_merge(THD *thd, TABLE *table, TABLE ***prev_pp) +{ + DBUG_ENTER("unlink_open_merge"); + + if (table->parent) + { + /* + If MERGE child, close parent too. Closing includes detaching. + + This is used for example in ALTER TABLE t1 RENAME TO t5 under + LOCK TABLES where t1 is a MERGE child: + CREATE TABLE t1 (c1 INT); + CREATE TABLE t2 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1); + LOCK TABLES t1 WRITE, t2 WRITE; + ALTER TABLE t1 RENAME TO t5; + */ + TABLE *parent= table->parent; + TABLE **prv_p; + + /* Find parent in open_tables list. */ + for (prv_p= &thd->open_tables; + *prv_p && (*prv_p != parent); + prv_p= &(*prv_p)->next) {} + if (*prv_p) + { + /* Special treatment required if child follows parent in list. */ + if (*prev_pp == &parent->next) + *prev_pp= prv_p; + /* + Remove parent from open_tables list and close it. + This includes detaching and hence clearing parent references. + */ + close_thread_table(thd, prv_p); + } + } + else if (table->child_l) + { + /* + When closing a MERGE parent, detach the children first. It is + not necessary to clear the child or parent table reference of + this table because the TABLE is freed. But we need to clear + the child or parent references of the other belonging tables + so that they cannot be moved into the unused_tables chain with + these pointers set. + + This is used for example in ALTER TABLE t2 RENAME TO t5 under + LOCK TABLES where t2 is a MERGE parent: + CREATE TABLE t1 (c1 INT); + CREATE TABLE t2 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1); + LOCK TABLES t1 WRITE, t2 WRITE; + ALTER TABLE t2 RENAME TO t5; + */ + detach_merge_children(table, TRUE); + } + + DBUG_VOID_RETURN; +} + + +/** @brief Remove all instances of table from thread's open list and table cache. @@ -1868,7 +2063,7 @@ static void relink_unused(TABLE *table) FALSE - otherwise @note When unlock parameter is FALSE or current thread doesn't have - any tables locked with LOCK TABLES tables are assumed to be + any tables locked with LOCK TABLES, tables are assumed to be not locked (for example already unlocked). */ @@ -1876,31 +2071,45 @@ void unlink_open_table(THD *thd, TABLE *find, bool unlock) { char key[MAX_DBKEY_LENGTH]; uint key_length= find->s->table_cache_key.length; - TABLE *list, **prev, *next; + TABLE *list, **prev; DBUG_ENTER("unlink_open_table"); safe_mutex_assert_owner(&LOCK_open); - list= thd->open_tables; - prev= &thd->open_tables; memcpy(key, find->s->table_cache_key.str, key_length); - for (; list ; list=next) + /* + Note that we need to hold LOCK_open while changing the + open_tables list. Another thread may work on it. + (See: remove_table_from_cache(), mysql_wait_completed_table()) + Closing a MERGE child before the parent would be fatal if the + other thread tries to abort the MERGE lock in between. + */ + for (prev= &thd->open_tables; *prev; ) { - next=list->next; + list= *prev; + if (list->s->table_cache_key.length == key_length && !memcmp(list->s->table_cache_key.str, key, key_length)) { if (unlock && thd->locked_tables) - mysql_lock_remove(thd, thd->locked_tables, list, TRUE); + mysql_lock_remove(thd, thd->locked_tables, + list->parent ? list->parent : list, TRUE); + + /* Prepare MERGE table for close. Close parent if necessary. */ + unlink_open_merge(thd, list, &prev); + + /* Remove table from open_tables list. */ + *prev= list->next; + /* Close table. */ VOID(hash_delete(&open_cache,(uchar*) list)); // Close table } else { - *prev=list; // put in use list + /* Step to next entry in open_tables list. */ prev= &list->next; } } - *prev=0; + // Notify any 'refresh' threads broadcast_refresh(); DBUG_VOID_RETURN; @@ -1990,6 +2199,41 @@ void wait_for_condition(THD *thd, pthread_mutex_t *mutex, pthread_cond_t *cond) } +/** + Exclusively name-lock a table that is already write-locked by the + current thread. + + @param thd current thread context + @param tables able list containing one table to open. + + @return FALSE on success, TRUE otherwise. +*/ + +bool name_lock_locked_table(THD *thd, TABLE_LIST *tables) +{ + DBUG_ENTER("name_lock_locked_table"); + + /* Under LOCK TABLES we must only accept write locked tables. */ + tables->table= find_locked_table(thd, tables->db, tables->table_name); + + if (!tables->table) + my_error(ER_TABLE_NOT_LOCKED, MYF(0), tables->alias); + else if (tables->table->reginfo.lock_type < TL_WRITE_LOW_PRIORITY) + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), tables->alias); + else + { + /* + Ensures that table is opened only by this thread and that no + other statement will open this table. + */ + wait_while_table_is_used(thd, tables->table, HA_EXTRA_FORCE_REOPEN); + DBUG_RETURN(FALSE); + } + + DBUG_RETURN(TRUE); +} + + /* Open table which is already name-locked by this thread. @@ -2383,9 +2627,14 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table->s->table_name.str); DBUG_RETURN(0); } + /* + When looking for a usable TABLE, ignore MERGE children, as they + belong to their parent and cannot be used explicitly. + */ if (!my_strcasecmp(system_charset_info, table->alias, alias) && table->query_id != thd->query_id && /* skip tables already used */ - !(thd->prelocked_mode && table->query_id)) + !(thd->prelocked_mode && table->query_id) && + !table->parent) { int distance= ((int) table->reginfo.lock_type - (int) table_list->lock_type); @@ -2516,7 +2765,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, deadlock may occur. */ if (thd->handler_tables) - mysql_ha_flush(thd, (TABLE_LIST*) NULL, MYSQL_HA_REOPEN_ON_USAGE, TRUE); + mysql_ha_flush(thd); /* Actually try to find the table in the open_cache. @@ -2534,6 +2783,8 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table= (TABLE*) hash_next(&open_cache, (uchar*) key, key_length, &state)) { + DBUG_PRINT("tcache", ("in_use table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); /* Here we flush tables marked for flush. Normally, table->s->version contains the value of @@ -2622,6 +2873,8 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, } if (table) { + DBUG_PRINT("tcache", ("unused table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); /* Unlink the table from "unused_tables" list. */ if (table == unused_tables) { // First unused @@ -2637,6 +2890,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, { /* Insert a new TABLE instance into the open cache */ int error; + DBUG_PRINT("tcache", ("opening new table")); /* Free cache if too big */ while (open_cache.records > table_cache_size && unused_tables) VOID(hash_delete(&open_cache,(uchar*) unused_tables)); /* purecov: tested */ @@ -2703,7 +2957,9 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, VOID(pthread_mutex_unlock(&LOCK_open)); DBUG_RETURN(0); // VIEW } - DBUG_PRINT("info", ("inserting table 0x%lx into the cache", (long) table)); + DBUG_PRINT("info", ("inserting table '%s'.'%s' 0x%lx into the cache", + table->s->db.str, table->s->table_name.str, + (long) table)); VOID(my_hash_insert(&open_cache,(uchar*) table)); } @@ -2793,9 +3049,12 @@ bool reopen_table(TABLE *table) TABLE_LIST table_list; THD *thd= table->in_use; DBUG_ENTER("reopen_table"); + DBUG_PRINT("tcache", ("table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); DBUG_ASSERT(table->s->ref_count == 0); DBUG_ASSERT(!table->sort.io_cache); + DBUG_ASSERT(!table->children_attached); #ifdef EXTRA_DEBUG if (table->db_stat) @@ -2836,6 +3095,17 @@ bool reopen_table(TABLE *table) tmp.next= table->next; tmp.prev= table->prev; + /* Preserve MERGE parent. */ + tmp.parent= table->parent; + /* Fix MERGE child list and check for unchanged union. */ + if ((table->child_l || tmp.child_l) && + fix_merge_after_open(table->child_l, table->child_last_l, + tmp.child_l, tmp.child_last_l)) + { + VOID(closefrm(&tmp, 1)); // close file, free everything + goto end; + } + delete table->triggers; if (table->file) VOID(closefrm(table, 1)); // close file, free everything @@ -2857,6 +3127,11 @@ bool reopen_table(TABLE *table) } if (table->triggers) table->triggers->set_table(table); + /* + Do not attach MERGE children here. The children might be reopened + after the parent. Attach children after reopening all tables that + require reopen. See for example reopen_tables(). + */ broadcast_refresh(); error=0; @@ -2878,6 +3153,9 @@ bool reopen_table(TABLE *table) then there is only one table open and locked. This means that the function probably has to be adjusted before it can be used anywhere outside ALTER TABLE. + + @note Must not use TABLE_SHARE::table_name/db of the table being closed, + the strings are used in a loop even after the share may be freed. */ void close_data_files_and_morph_locks(THD *thd, const char *db, @@ -2909,7 +3187,22 @@ void close_data_files_and_morph_locks(THD *thd, const char *db, !strcmp(table->s->db.str, db)) { if (thd->locked_tables) - mysql_lock_remove(thd, thd->locked_tables, table, TRUE); + { + if (table->parent) + { + /* + If MERGE child, need to reopen parent too. This means that + the first child to be closed will detach all children from + the parent and close it. OTOH in most cases a MERGE table + won't have multiple children with the same db.table_name. + */ + mysql_lock_remove(thd, thd->locked_tables, table->parent, TRUE); + table->parent->open_placeholder= 1; + close_handle_and_leave_table_as_lock(table->parent); + } + else + mysql_lock_remove(thd, thd->locked_tables, table, TRUE); + } table->open_placeholder= 1; close_handle_and_leave_table_as_lock(table); } @@ -2919,6 +3212,62 @@ void close_data_files_and_morph_locks(THD *thd, const char *db, /** + @brief Reattach MERGE children after reopen. + + @param[in] thd thread context + @param[in,out] err_tables_p pointer to pointer of tables in error + + @return status + @retval FALSE OK, err_tables_p unchanged + @retval TRUE Error, err_tables_p contains table(s) +*/ + +static bool reattach_merge(THD *thd, TABLE **err_tables_p) +{ + TABLE *table; + TABLE *next; + TABLE **prv_p= &thd->open_tables; + bool error= FALSE; + DBUG_ENTER("reattach_merge"); + + for (table= thd->open_tables; table; table= next) + { + next= table->next; + DBUG_PRINT("tcache", ("check table: '%s'.'%s' 0x%lx next: 0x%lx", + table->s->db.str, table->s->table_name.str, + (long) table, (long) next)); + /* Reattach children for MERGE tables with "closed data files" only. */ + if (table->child_l && !table->children_attached) + { + DBUG_PRINT("tcache", ("MERGE parent, attach children")); + if(table->file->extra(HA_EXTRA_ATTACH_CHILDREN)) + { + my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias); + error= TRUE; + /* Remove table from open_tables. */ + *prv_p= next; + if (next) + prv_p= &next->next; + /* Stack table on error list. */ + table->next= *err_tables_p; + *err_tables_p= table; + continue; + } + else + { + table->children_attached= TRUE; + DBUG_PRINT("myrg", ("attached parent: '%s'.'%s' 0x%lx", + table->s->db.str, + table->s->table_name.str, (long) table)); + } + } + prv_p= &table->next; + } + DBUG_RETURN(error); +} + + +/** @brief Reopen all tables with closed data files. @param thd Thread context @@ -2942,7 +3291,9 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh) { TABLE *table,*next,**prev; TABLE **tables,**tables_ptr; // For locks + TABLE *err_tables= NULL; bool error=0, not_used; + bool merge_table_found= FALSE; DBUG_ENTER("reopen_tables"); if (!thd->open_tables) @@ -2951,10 +3302,15 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh) safe_mutex_assert_owner(&LOCK_open); if (get_locks) { - /* The ptr is checked later */ + /* + The ptr is checked later + Do not handle locks of MERGE children. + */ uint opens=0; for (table= thd->open_tables; table ; table=table->next) - opens++; + if (!table->parent) + opens++; + DBUG_PRINT("tcache", ("open tables to lock: %u", opens)); tables= (TABLE**) my_alloca(sizeof(TABLE*)*opens); } else @@ -2966,17 +3322,37 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh) { uint db_stat=table->db_stat; next=table->next; + DBUG_PRINT("tcache", ("open table: '%s'.'%s' 0x%lx " + "parent: 0x%lx db_stat: %u", + table->s->db.str, table->s->table_name.str, + (long) table, (long) table->parent, db_stat)); + if (table->child_l && !db_stat) + merge_table_found= TRUE; if (!tables || (!db_stat && reopen_table(table))) { my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias); + /* + If we could not allocate 'tables', we may close open tables + here. If a MERGE table is affected, detach the children first. + It is not necessary to clear the child or parent table reference + of this table because the TABLE is freed. But we need to clear + the child or parent references of the other belonging tables so + that they cannot be moved into the unused_tables chain with + these pointers set. + */ + if (table->child_l || table->parent) + detach_merge_children(table, TRUE); VOID(hash_delete(&open_cache,(uchar*) table)); error=1; } else { + DBUG_PRINT("tcache", ("opened. need lock: %d", + get_locks && !db_stat && !table->parent)); *prev= table; prev= &table->next; - if (get_locks && !db_stat) + /* Do not handle locks of MERGE children. */ + if (get_locks && !db_stat && !table->parent) *tables_ptr++= table; // need new lock on this if (in_refresh) { @@ -2985,25 +3361,52 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh) } } } + *prev=0; + /* + When all tables are open again, we can re-attach MERGE children to + their parents. All TABLE objects are still present. + */ + DBUG_PRINT("tcache", ("re-attaching MERGE tables: %d", merge_table_found)); + if (!error && merge_table_found && reattach_merge(thd, &err_tables)) + { + while (err_tables) + { + VOID(hash_delete(&open_cache, (uchar*) err_tables)); + err_tables= err_tables->next; + } + } + DBUG_PRINT("tcache", ("open tables to lock: %u", + (uint) (tables_ptr - tables))); if (tables != tables_ptr) // Should we get back old locks { MYSQL_LOCK *lock; - /* We should always get these locks */ + /* + We should always get these locks. Anyway, we must not go into + wait_for_tables() as it tries to acquire LOCK_open, which is + already locked. + */ thd->some_tables_deleted=0; if ((lock= mysql_lock_tables(thd, tables, (uint) (tables_ptr - tables), - 0, ¬_used))) + MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN, ¬_used))) { thd->locked_tables=mysql_lock_merge(thd->locked_tables,lock); } else + { + /* + This case should only happen if there is a bug in the reopen logic. + Need to issue error message to have a reply for the application. + Not exactly what happened though, but close enough. + */ + my_error(ER_LOCK_DEADLOCK, MYF(0)); error=1; + } } if (get_locks && tables) { my_afree((uchar*) tables); } broadcast_refresh(); - *prev=0; DBUG_RETURN(error); } @@ -3022,14 +3425,19 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh) @param send_refresh Should we awake waiters even if we didn't close any tables? */ -void close_old_data_files(THD *thd, TABLE *table, bool morph_locks, - bool send_refresh) +static void close_old_data_files(THD *thd, TABLE *table, bool morph_locks, + bool send_refresh) { bool found= send_refresh; DBUG_ENTER("close_old_data_files"); for (; table ; table=table->next) { + DBUG_PRINT("tcache", ("checking table: '%s'.'%s' 0x%lx", + table->s->db.str, table->s->table_name.str, + (long) table)); + DBUG_PRINT("tcache", ("needs refresh: %d is open: %u", + table->needs_reopen_or_name_lock(), table->db_stat)); /* Reopen marked for flush. */ @@ -3041,13 +3449,33 @@ void close_old_data_files(THD *thd, TABLE *table, bool morph_locks, if (morph_locks) { /* - Wake up threads waiting for table-level lock on this table - so they won't sneak in when we will temporarily remove our - lock on it. This will also give them a chance to close their - instances of this table. + Forward lock handling to MERGE parent. But unlock parent + once only. */ - mysql_lock_abort(thd, table, TRUE); - mysql_lock_remove(thd, thd->locked_tables, table, TRUE); + TABLE *ulcktbl= table->parent ? table->parent : table; + if (ulcktbl->lock_count) + { + /* + Wake up threads waiting for table-level lock on this table + so they won't sneak in when we will temporarily remove our + lock on it. This will also give them a chance to close their + instances of this table. + */ + mysql_lock_abort(thd, ulcktbl, TRUE); + mysql_lock_remove(thd, thd->locked_tables, ulcktbl, TRUE); + ulcktbl->lock_count= 0; + } + if ((ulcktbl != table) && ulcktbl->db_stat) + { + /* + Close the parent too. Note that parent can come later in + the list of tables. It will then be noticed as closed and + as a placeholder. When this happens, do not clear the + placeholder flag. See the branch below ("***"). + */ + ulcktbl->open_placeholder= 1; + close_handle_and_leave_table_as_lock(ulcktbl); + } /* We want to protect the table from concurrent DDL operations (like RENAME TABLE) until we will re-open and re-lock it. @@ -3056,7 +3484,7 @@ void close_old_data_files(THD *thd, TABLE *table, bool morph_locks, } close_handle_and_leave_table_as_lock(table); } - else if (table->open_placeholder) + else if (table->open_placeholder && !morph_locks) { /* We come here only in close-for-back-off scenario. So we have to @@ -3064,8 +3492,11 @@ void close_old_data_files(THD *thd, TABLE *table, bool morph_locks, in case of concurrent execution of CREATE TABLE t1 SELECT * FROM t2 and RENAME TABLE t2 TO t1). In close-for-re-open scenario we will probably want to let it stay. + + Note "***": We must not enter this branch if the placeholder + flag has been set because of a former close through a child. + See above the comment that refers to this note. */ - DBUG_ASSERT(!morph_locks); table->open_placeholder= 0; } } @@ -3136,7 +3567,7 @@ bool wait_for_tables(THD *thd) { thd->some_tables_deleted=0; close_old_data_files(thd,thd->open_tables,0,dropping_tables != 0); - mysql_ha_flush(thd, (TABLE_LIST*) NULL, MYSQL_HA_REOPEN_ON_USAGE, TRUE); + mysql_ha_flush(thd); if (!table_is_used(thd->open_tables,1)) break; (void) pthread_cond_wait(&COND_refresh,&LOCK_open); @@ -3186,13 +3617,29 @@ TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name) prev= &thd->open_tables; DBUG_ENTER("drop_locked_tables"); + /* + Note that we need to hold LOCK_open while changing the + open_tables list. Another thread may work on it. + (See: remove_table_from_cache(), mysql_wait_completed_table()) + Closing a MERGE child before the parent would be fatal if the + other thread tries to abort the MERGE lock in between. + */ for (table= thd->open_tables; table ; table=next) { next=table->next; if (!strcmp(table->s->table_name.str, table_name) && !strcmp(table->s->db.str, db)) { - mysql_lock_remove(thd, thd->locked_tables, table, TRUE); + /* If MERGE child, forward lock handling to parent. */ + mysql_lock_remove(thd, thd->locked_tables, + table->parent ? table->parent : table, TRUE); + /* + When closing a MERGE parent or child table, detach the children first. + Clear child table references in case this object is opened again. + */ + if (table->child_l || table->parent) + detach_merge_children(table, TRUE); + if (!found) { found= table; @@ -3241,7 +3688,8 @@ void abort_locked_tables(THD *thd,const char *db, const char *table_name) if (!strcmp(table->s->table_name.str, table_name) && !strcmp(table->s->db.str, db)) { - mysql_lock_abort(thd,table, TRUE); + /* If MERGE child, forward lock handling to parent. */ + mysql_lock_abort(thd, table->parent ? table->parent : table, TRUE); break; } } @@ -3272,7 +3720,8 @@ void abort_locked_tables(THD *thd,const char *db, const char *table_name) share->table_map_id is given a value that with a high certainty is not used by any other table (the only case where a table id can be reused is on wrap-around, which means more than 4 billion table - shares open at the same time). + share opens have been executed while one table was open all the + time). share->table_map_id is not ~0UL. */ @@ -3511,6 +3960,340 @@ err: } +/** + @brief Add list of MERGE children to a TABLE_LIST list. + + @param[in] tlist the parent TABLE_LIST object just opened + + @return status + @retval 0 OK + @retval != 0 Error + + @detail + When a MERGE parent table has just been opened, insert the + TABLE_LIST chain from the MERGE handle into the table list used for + opening tables for this statement. This lets the children be opened + too. +*/ + +static int add_merge_table_list(TABLE_LIST *tlist) +{ + TABLE *parent= tlist->table; + TABLE_LIST *child_l; + DBUG_ENTER("add_merge_table_list"); + DBUG_PRINT("myrg", ("table: '%s'.'%s' 0x%lx", parent->s->db.str, + parent->s->table_name.str, (long) parent)); + + /* Must not call this with attached children. */ + DBUG_ASSERT(!parent->children_attached); + /* Must not call this with children list in place. */ + DBUG_ASSERT(tlist->next_global != parent->child_l); + /* Prevent inclusion of another MERGE table. Could make infinite recursion. */ + if (tlist->parent_l) + { + my_error(ER_ADMIN_WRONG_MRG_TABLE, MYF(0), tlist->alias); + DBUG_RETURN(1); + } + + /* Fix children.*/ + for (child_l= parent->child_l; ; child_l= child_l->next_global) + { + /* + Note: child_l->table may still be set if this parent was taken + from the unused_tables chain. Ignore this fact here. The + reference will be replaced by the handler in + ::extra(HA_EXTRA_ATTACH_CHILDREN). + */ + + /* Set lock type. */ + child_l->lock_type= tlist->lock_type; + + /* Set parent reference. */ + child_l->parent_l= tlist; + + /* Break when this was the last child. */ + if (&child_l->next_global == parent->child_last_l) + break; + } + + /* Insert children into the table list. */ + *parent->child_last_l= tlist->next_global; + tlist->next_global= parent->child_l; + + /* + Do not fix the prev_global pointers. We will remove the + chain soon anyway. + */ + + DBUG_RETURN(0); +} + + +/** + @brief Attach MERGE children to the parent. + + @param[in] tlist the child TABLE_LIST object just opened + + @return status + @retval 0 OK + @retval != 0 Error + + @note + This is called when the last MERGE child has just been opened, let + the handler attach the MyISAM tables to the MERGE table. Remove + MERGE TABLE_LIST chain from the statement list so that it cannot be + changed or freed. +*/ + +static int attach_merge_children(TABLE_LIST *tlist) +{ + TABLE *parent= tlist->parent_l->table; + int error; + DBUG_ENTER("attach_merge_children"); + DBUG_PRINT("myrg", ("table: '%s'.'%s' 0x%lx", parent->s->db.str, + parent->s->table_name.str, (long) parent)); + + /* Must not call this with attached children. */ + DBUG_ASSERT(!parent->children_attached); + /* Must call this with children list in place. */ + DBUG_ASSERT(tlist->parent_l->next_global == parent->child_l); + + /* Attach MyISAM tables to MERGE table. */ + error= parent->file->extra(HA_EXTRA_ATTACH_CHILDREN); + + /* + Remove children from the table list. Even in case of an error. + This should prevent tampering with them. + */ + tlist->parent_l->next_global= *parent->child_last_l; + + /* + Do not fix the last childs next_global pointer. It is needed for + stepping to the next table in the enclosing loop in open_tables(). + Do not fix prev_global pointers. We did not set them. + */ + + if (error) + { + DBUG_PRINT("error", ("attaching MERGE children failed: %d", my_errno)); + parent->file->print_error(error, MYF(0)); + DBUG_RETURN(1); + } + + parent->children_attached= TRUE; + DBUG_PRINT("myrg", ("attached parent: '%s'.'%s' 0x%lx", parent->s->db.str, + parent->s->table_name.str, (long) parent)); + + /* + Note that we have the cildren in the thd->open_tables list at this + point. + */ + + DBUG_RETURN(0); +} + + +/** + @brief Detach MERGE children from the parent. + + @note + Call this before the first table of a MERGE table (parent or child) + is closed. + + When closing thread tables at end of statement, both parent and + children are in thd->open_tables and will be closed. In most cases + the children will be closed before the parent. They are opened after + the parent and thus stacked into thd->open_tables before it. + + To avoid that we touch a closed children in any way, we must detach + the children from the parent when the first belonging table is + closed (parent or child). + + All references to the children should be removed on handler level + and optionally on table level. + + @note + Assure that you call it for a MERGE parent or child only. + Either table->child_l or table->parent must be set. + + @param[in] table the TABLE object of the parent + @param[in] clear_refs if to clear TABLE references + this must be true when called from + close_thread_tables() to enable fresh + open in open_tables() + it must be false when called in preparation + for reopen_tables() +*/ + +void detach_merge_children(TABLE *table, bool clear_refs) +{ + TABLE_LIST *child_l; + TABLE *parent= table->child_l ? table : table->parent; + bool first_detach; + DBUG_ENTER("detach_merge_children"); + /* + Either table->child_l or table->parent must be set. Parent must have + child_l set. + */ + DBUG_ASSERT(parent && parent->child_l); + DBUG_PRINT("myrg", ("table: '%s'.'%s' 0x%lx clear_refs: %d", + table->s->db.str, table->s->table_name.str, + (long) table, clear_refs)); + DBUG_PRINT("myrg", ("parent: '%s'.'%s' 0x%lx", parent->s->db.str, + parent->s->table_name.str, (long) parent)); + + /* + In a open_tables() loop it can happen that not all tables have their + children attached yet. Also this is called for every child and the + parent from close_thread_tables(). + */ + if ((first_detach= parent->children_attached)) + { + VOID(parent->file->extra(HA_EXTRA_DETACH_CHILDREN)); + parent->children_attached= FALSE; + DBUG_PRINT("myrg", ("detached parent: '%s'.'%s' 0x%lx", parent->s->db.str, + parent->s->table_name.str, (long) parent)); + } + else + DBUG_PRINT("myrg", ("parent is already detached")); + + if (clear_refs) + { + /* In any case clear the own parent reference. (***) */ + table->parent= NULL; + + /* + On the first detach, clear all references. If this table is the + parent, we still may need to clear the child references. The first + detach might not have done this. + */ + if (first_detach || (table == parent)) + { + /* Clear TABLE references to force new assignment at next open. */ + for (child_l= parent->child_l; ; child_l= child_l->next_global) + { + /* + Do not DBUG_ASSERT(child_l->table); open_tables might be + incomplete. + + Clear the parent reference of the children only on the first + detach. The children might already be closed. They will clear + it themseves when this function is called for them with + 'clear_refs' true. See above "(***)". + */ + if (first_detach && child_l->table) + child_l->table->parent= NULL; + + /* Clear the table reference to force new assignment at next open. */ + child_l->table= NULL; + + /* Break when this was the last child. */ + if (&child_l->next_global == parent->child_last_l) + break; + } + } + } + + DBUG_VOID_RETURN; +} + + +/** + @brief Fix MERGE children after open. + + @param[in] old_child_list first list member from original table + @param[in] old_last pointer to &next_global of last list member + @param[in] new_child_list first list member from freshly opened table + @param[in] new_last pointer to &next_global of last list member + + @return mismatch + @retval FALSE OK, no mismatch + @retval TRUE Error, lists mismatch + + @detail + Main action is to copy TABLE reference for each member of original + child list to new child list. After a fresh open these references + are NULL. Assign the old children to the new table. Some of them + might also be reopened or will be reopened soon. + + Other action is to verify that the table definition with respect to + the UNION list did not change. + + @note + This function terminates the child list if the respective '*_last' + pointer is non-NULL. Do not call it from a place where the list is + embedded in another list and this would break it. + + Terminating the list is required for example in the first + reopen_table() after open_tables(). open_tables() requires the end + of the list not to be terminated because other tables could follow + behind the child list. + + If a '*_last' pointer is NULL, the respective list is assumed to be + NULL terminated. +*/ + +bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last, + TABLE_LIST *new_child_list, TABLE_LIST **new_last) +{ + bool mismatch= FALSE; + DBUG_ENTER("fix_merge_after_open"); + DBUG_PRINT("myrg", ("old last addr: 0x%lx new last addr: 0x%lx", + (long) old_last, (long) new_last)); + + /* Terminate the lists for easier check of list end. */ + if (old_last) + *old_last= NULL; + if (new_last) + *new_last= NULL; + + for (;;) + { + DBUG_PRINT("myrg", ("old list item: 0x%lx new list item: 0x%lx", + (long) old_child_list, (long) new_child_list)); + /* Break if one of the list is at its end. */ + if (!old_child_list || !new_child_list) + break; + /* Old table has references to child TABLEs. */ + DBUG_ASSERT(old_child_list->table); + /* New table does not yet have references to child TABLEs. */ + DBUG_ASSERT(!new_child_list->table); + DBUG_PRINT("myrg", ("old table: '%s'.'%s' new table: '%s'.'%s'", + old_child_list->db, old_child_list->table_name, + new_child_list->db, new_child_list->table_name)); + /* Child db.table names must match. */ + if (strcmp(old_child_list->table_name, new_child_list->table_name) || + strcmp(old_child_list->db, new_child_list->db)) + break; + /* + Copy TABLE reference. Child TABLE objects are still in place + though not necessarily open yet. + */ + DBUG_PRINT("myrg", ("old table ref: 0x%lx replaces new table ref: 0x%lx", + (long) old_child_list->table, + (long) new_child_list->table)); + new_child_list->table= old_child_list->table; + /* Step both lists. */ + old_child_list= old_child_list->next_global; + new_child_list= new_child_list->next_global; + } + DBUG_PRINT("myrg", ("end of list, mismatch: %d", mismatch)); + /* + If the list pointers are not both NULL after the loop, then the + lists differ. If the are both identical, but not NULL, then they + have at least one table in common and hence the rest of the list + would be identical too. But in this case the loop woul run until the + list end, where both pointers would become NULL. + */ + if (old_child_list != new_child_list) + mismatch= TRUE; + if (mismatch) + my_error(ER_TABLE_DEF_CHANGED, MYF(0)); + + DBUG_RETURN(mismatch); +} + + /* Open all tables in list @@ -3541,7 +4324,7 @@ err: int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) { - TABLE_LIST *tables; + TABLE_LIST *tables= NULL; bool refresh; int result=0; MEM_ROOT new_frm_mem; @@ -3554,7 +4337,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) temporary mem_root for new .frm parsing. TODO: variables for size */ - init_alloc_root(&new_frm_mem, 8024, 8024); + init_sql_alloc(&new_frm_mem, 8024, 8024); thd->current_tablenr= 0; restart: @@ -3601,6 +4384,9 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) */ for (tables= *start; tables ;tables= tables->next_global) { + DBUG_PRINT("tcache", ("opening table: '%s'.'%s' item: 0x%lx", + tables->db, tables->table_name, (long) tables)); + safe_to_ignore_table= FALSE; /* @@ -3652,6 +4438,10 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) else tables->table= open_table(thd, tables, &new_frm_mem, &refresh, flags); } + else + DBUG_PRINT("tcache", ("referenced table: '%s'.'%s' 0x%lx", + tables->db, tables->table_name, + (long) tables->table)); if (!tables->table) { @@ -3683,6 +4473,19 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) goto process_view_routines; } + /* + If in a MERGE table open, we need to remove the children list + from statement table list before restarting. Otherwise the list + will be inserted another time. + */ + if (tables->parent_l) + { + TABLE_LIST *parent_l= tables->parent_l; + /* The parent table should be correctly open at this point. */ + DBUG_ASSERT(parent_l->table); + parent_l->next_global= *parent_l->table->child_last_l; + } + if (refresh) // Refresh in progress { /* @@ -3751,6 +4554,24 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) thd->update_lock_default : tables->lock_type; tables->table->grant= tables->grant; + /* Attach MERGE children if not locked already. */ + DBUG_PRINT("tcache", ("is parent: %d is child: %d", + test(tables->table->child_l), + test(tables->parent_l))); + DBUG_PRINT("tcache", ("in lock tables: %d in prelock mode: %d", + test(thd->locked_tables), test(thd->prelocked_mode))); + if (((!thd->locked_tables && !thd->prelocked_mode) || + tables->table->s->tmp_table) && + ((tables->table->child_l && + add_merge_table_list(tables)) || + (tables->parent_l && + (&tables->next_global == tables->parent_l->table->child_last_l) && + attach_merge_children(tables)))) + { + result= -1; + goto err; + } + process_view_routines: /* Again we may need cache all routines used by this view and add @@ -3783,6 +4604,18 @@ process_view_routines: if (query_tables_last_own) thd->lex->mark_as_requiring_prelocking(query_tables_last_own); + if (result && tables) + { + /* + Some functions determine success as (tables->table != NULL). + tables->table is in thd->open_tables. It won't go lost. If the + error happens on a MERGE child, clear the parents TABLE reference. + */ + if (tables->parent_l) + tables->parent_l->table= NULL; + tables->table= NULL; + } + DBUG_PRINT("tcache", ("returning: %d", result)); DBUG_RETURN(result); } @@ -3822,6 +4655,63 @@ static bool check_lock_and_start_stmt(THD *thd, TABLE *table, } +/** + @brief Open and lock one table + + @param[in] thd thread handle + @param[in] table_l table to open is first table in this list + @param[in] lock_type lock to use for table + + @return table + @retval != NULL OK, opened table returned + @retval NULL Error + + @note + If ok, the following are also set: + table_list->lock_type lock_type + table_list->table table + + @note + If table_l is a list, not a single table, the list is temporarily + broken. + + @detail + This function is meant as a replacement for open_ltable() when + MERGE tables can be opened. open_ltable() cannot open MERGE tables. + + There may be more differences between open_n_lock_single_table() and + open_ltable(). One known difference is that open_ltable() does + neither call decide_logging_format() nor handle some other logging + and locking issues because it does not call lock_tables(). +*/ + +TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l, + thr_lock_type lock_type) +{ + TABLE_LIST *save_next_global; + DBUG_ENTER("open_n_lock_single_table"); + + /* Remember old 'next' pointer. */ + save_next_global= table_l->next_global; + /* Break list. */ + table_l->next_global= NULL; + + /* Set requested lock type. */ + table_l->lock_type= lock_type; + /* Allow to open real tables only. */ + table_l->required_type= FRMTYPE_TABLE; + + /* Open the table. */ + if (simple_open_n_lock_tables(thd, table_l)) + table_l->table= NULL; /* Just to be sure. */ + + /* Restore list. */ + table_l->next_global= save_next_global; + + DBUG_RETURN(table_l->table); +} + + /* Open and lock one table @@ -3863,6 +4753,17 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type, if (table) { + if (table->child_l) + { + /* A MERGE table must not come here. */ + /* purecov: begin tested */ + my_error(ER_WRONG_OBJECT, MYF(0), table->s->db.str, + table->s->table_name.str, "BASE TABLE"); + table= 0; + goto end; + /* purecov: end */ + } + table_list->lock_type= lock_type; table_list->table= table; table->grant= table_list->grant; @@ -3880,56 +4781,21 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type, table= 0; } } + + end: thd->proc_info=0; DBUG_RETURN(table); } /* - Open all tables in list and locks them for read without derived - tables processing. + Open all tables in list, locks them and optionally process derived tables. SYNOPSIS - simple_open_n_lock_tables() - thd - thread handler - tables - list of tables for open&locking - - RETURN - 0 - ok - -1 - error - - NOTE - The lock will automaticaly be freed by close_thread_tables() -*/ - -int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables) -{ - uint counter; - bool need_reopen; - DBUG_ENTER("simple_open_n_lock_tables"); - - for ( ; ; ) - { - if (open_tables(thd, &tables, &counter, 0)) - DBUG_RETURN(-1); - if (!lock_tables(thd, tables, counter, &need_reopen)) - break; - if (!need_reopen) - DBUG_RETURN(-1); - close_tables_for_reopen(thd, &tables); - } - DBUG_RETURN(0); -} - - -/* - Open all tables in list, locks them and process derived tables - tables processing. - - SYNOPSIS - open_and_lock_tables() + open_and_lock_tables_derived() thd - thread handler tables - list of tables for open&locking + derived - if to handle derived tables RETURN FALSE - ok @@ -3937,27 +4803,43 @@ int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables) NOTE The lock will automaticaly be freed by close_thread_tables() + + NOTE + There are two convenience functions: + - simple_open_n_lock_tables(thd, tables) without derived handling + - open_and_lock_tables(thd, tables) with derived handling + Both inline functions call open_and_lock_tables_derived() with + the third argument set appropriately. */ -bool open_and_lock_tables(THD *thd, TABLE_LIST *tables) +bool open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived) { uint counter; bool need_reopen; - DBUG_ENTER("open_and_lock_tables"); + DBUG_ENTER("open_and_lock_tables_derived"); + DBUG_PRINT("enter", ("derived handling: %d", derived)); for ( ; ; ) { if (open_tables(thd, &tables, &counter, 0)) DBUG_RETURN(-1); + + DBUG_EXECUTE_IF("sleep_open_and_lock_after_open", { + const char *old_proc_info= thd->proc_info; + thd->proc_info= "DBUG sleep"; + my_sleep(6000000); + thd->proc_info= old_proc_info;}); + if (!lock_tables(thd, tables, counter, &need_reopen)) break; if (!need_reopen) DBUG_RETURN(-1); close_tables_for_reopen(thd, &tables); } - if (mysql_handle_derived(thd->lex, &mysql_derived_prepare) || - (thd->fill_derived_tables() && - mysql_handle_derived(thd->lex, &mysql_derived_filling))) + if (derived && + (mysql_handle_derived(thd->lex, &mysql_derived_prepare) || + (thd->fill_derived_tables() && + mysql_handle_derived(thd->lex, &mysql_derived_filling)))) DBUG_RETURN(TRUE); /* purecov: inspected */ DBUG_RETURN(0); } @@ -4271,7 +5153,17 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) thd->lock= 0; thd->in_lock_tables=0; - for (table= tables; table != first_not_own; table= table->next_global) + /* + When open_and_lock_tables() is called for a single table out of + a table list, the 'next_global' chain is temporarily broken. We + may not find 'first_not_own' before the end of the "list". + Look for example at those places where open_n_lock_single_table() + is called. That function implements the temporary breaking of + a table list for opening a single table. + */ + for (table= tables; + table && table != first_not_own; + table= table->next_global) { if (!table->placeholder()) { @@ -4298,7 +5190,17 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) else { TABLE_LIST *first_not_own= thd->lex->first_not_own_table(); - for (table= tables; table != first_not_own; table= table->next_global) + /* + When open_and_lock_tables() is called for a single table out of + a table list, the 'next_global' chain is temporarily broken. We + may not find 'first_not_own' before the end of the "list". + Look for example at those places where open_n_lock_single_table() + is called. That function implements the temporary breaking of + a table list for opening a single table. + */ + for (table= tables; + table && table != first_not_own; + table= table->next_global) { if (!table->placeholder() && check_lock_and_start_stmt(thd, table->table, table->lock_type)) @@ -4401,7 +5303,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db, saved_cache_key= strmov(tmp_path, path)+1; memcpy(saved_cache_key, cache_key, key_length); - init_tmp_table_share(share, saved_cache_key, key_length, + init_tmp_table_share(thd, share, saved_cache_key, key_length, strend(saved_cache_key)+1, tmp_path); if (open_table_def(thd, share, 0) || @@ -4434,6 +5336,8 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db, slave_open_temp_tables++; } tmp_table->pos_in_table_list= 0; + DBUG_PRINT("tmptable", ("opened table: '%s'.'%s' 0x%lx", tmp_table->s->db.str, + tmp_table->s->table_name.str, (long) tmp_table)); DBUG_RETURN(tmp_table); } @@ -7115,7 +8019,7 @@ my_bool mysql_rm_tmp_tables(void) /* We should cut file extention before deleting of table */ memcpy(filePathCopy, filePath, filePath_len - ext_len); filePathCopy[filePath_len - ext_len]= 0; - init_tmp_table_share(&share, "", 0, "", filePathCopy); + init_tmp_table_share(thd, &share, "", 0, "", filePathCopy); if (!open_table_def(thd, &share, 0) && ((handler_file= get_new_handler(&share, thd->mem_root, share.db_type())))) @@ -7217,7 +8121,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, TABLE_SHARE *share; bool result= 0, signalled= 0; DBUG_ENTER("remove_table_from_cache"); - DBUG_PRINT("enter", ("Table: '%s.%s' flags: %u", db, table_name, flags)); + DBUG_PRINT("enter", ("table: '%s'.'%s' flags: %u", db, table_name, flags)); key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1; for (;;) @@ -7232,6 +8136,8 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, &state)) { THD *in_use; + DBUG_PRINT("tcache", ("found table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); table->s->version=0L; /* Free when thread is ready */ if (!(in_use=table->in_use)) @@ -7270,13 +8176,19 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, } /* Now we must abort all tables locks used by this thread - as the thread may be waiting to get a lock for another table + as the thread may be waiting to get a lock for another table. + Note that we need to hold LOCK_open while going through the + list. So that the other thread cannot change it. The other + thread must also hold LOCK_open whenever changing the + open_tables list. Aborting the MERGE lock after a child was + closed and before the parent is closed would be fatal. */ for (TABLE *thd_table= in_use->open_tables; thd_table ; thd_table= thd_table->next) { - if (thd_table->db_stat) // If table is open + /* Do not handle locks of MERGE children. */ + if (thd_table->db_stat && !thd_table->parent) // If table is open signalled|= mysql_lock_abort_for_thread(thd, thd_table); } } @@ -7479,7 +8391,9 @@ int abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt) lpt->old_lock_type= lpt->table->reginfo.lock_type; VOID(pthread_mutex_lock(&LOCK_open)); - mysql_lock_abort(lpt->thd, lpt->table, TRUE); + /* If MERGE child, forward lock handling to parent. */ + mysql_lock_abort(lpt->thd, lpt->table->parent ? lpt->table->parent : + lpt->table, TRUE); VOID(remove_table_from_cache(lpt->thd, lpt->db, lpt->table_name, flags)); VOID(pthread_mutex_unlock(&LOCK_open)); DBUG_RETURN(0); @@ -7500,14 +8414,18 @@ int abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt) We also downgrade locks after the upgrade to WRITE_ONLY */ +/* purecov: begin deadcode */ void close_open_tables_and_downgrade(ALTER_PARTITION_PARAM_TYPE *lpt) { VOID(pthread_mutex_lock(&LOCK_open)); remove_table_from_cache(lpt->thd, lpt->db, lpt->table_name, RTFC_WAIT_OTHER_THREAD_FLAG); VOID(pthread_mutex_unlock(&LOCK_open)); - mysql_lock_downgrade_write(lpt->thd, lpt->table, lpt->old_lock_type); + /* If MERGE child, forward lock handling to parent. */ + mysql_lock_downgrade_write(lpt->thd, lpt->table->parent ? lpt->table->parent : + lpt->table, lpt->old_lock_type); } +/* purecov: end */ /* @@ -7573,13 +8491,19 @@ void mysql_wait_completed_table(ALTER_PARTITION_PARAM_TYPE *lpt, TABLE *my_table } /* Now we must abort all tables locks used by this thread - as the thread may be waiting to get a lock for another table + as the thread may be waiting to get a lock for another table. + Note that we need to hold LOCK_open while going through the + list. So that the other thread cannot change it. The other + thread must also hold LOCK_open whenever changing the + open_tables list. Aborting the MERGE lock after a child was + closed and before the parent is closed would be fatal. */ for (TABLE *thd_table= in_use->open_tables; thd_table ; thd_table= thd_table->next) { - if (thd_table->db_stat) // If table is open + /* Do not handle locks of MERGE children. */ + if (thd_table->db_stat && !thd_table->parent) // If table is open mysql_lock_abort_for_thread(lpt->thd, thd_table); } } @@ -7589,8 +8513,10 @@ void mysql_wait_completed_table(ALTER_PARTITION_PARAM_TYPE *lpt, TABLE *my_table those in use for removal after completion. Now we also need to abort all that are locked and are not progressing due to being locked by our lock. We don't upgrade our lock here. + If MERGE child, forward lock handling to parent. */ - mysql_lock_abort(lpt->thd, my_table, FALSE); + mysql_lock_abort(lpt->thd, my_table->parent ? my_table->parent : my_table, + FALSE); VOID(pthread_mutex_unlock(&LOCK_open)); DBUG_VOID_RETURN; } @@ -7849,6 +8775,13 @@ void close_performance_schema_table(THD *thd, Open_tables_state *backup) pthread_mutex_lock(&LOCK_open); found_old_table= false; + /* + Note that we need to hold LOCK_open while changing the + open_tables list. Another thread may work on it. + (See: remove_table_from_cache(), mysql_wait_completed_table()) + Closing a MERGE child before the parent would be fatal if the + other thread tries to abort the MERGE lock in between. + */ while (thd->open_tables) found_old_table|= close_thread_table(thd, &thd->open_tables); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 1ee490fbcc8..6ebd0e5f7dc 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -678,9 +678,7 @@ void THD::cleanup(void) lock=locked_tables; locked_tables=0; close_thread_tables(this); } - mysql_ha_flush(this, (TABLE_LIST*) 0, - MYSQL_HA_CLOSE_FINAL | MYSQL_HA_FLUSH_ALL, FALSE); - hash_free(&handler_tables_hash); + mysql_ha_cleanup(this); delete_dynamic(&user_var_events); hash_free(&user_vars); close_temporary_tables(this); @@ -818,7 +816,20 @@ void THD::awake(THD::killed_state state_to_set) if (!slave_thread) thread_scheduler.post_kill_notification(this); #ifdef SIGNAL_WITH_VIO_CLOSE - close_active_vio(); + if (this != current_thd) + { + /* + In addition to a signal, let's close the socket of the thread that + is being killed. This is to make sure it does not block if the + signal is lost. This needs to be done only on platforms where + signals are not a reliable interruption mechanism. + + If we're killing ourselves, we know that we're not blocked, so this + hack is not used. + */ + + close_active_vio(); + } #endif } if (mysys_var) diff --git a/sql/sql_class.h b/sql/sql_class.h index 63a662f07b2..ce035b34679 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1172,8 +1172,6 @@ public: THD_TRANS all; // Trans since BEGIN WORK THD_TRANS stmt; // Trans for current statement bool on; // see ha_enable_transaction() - XID xid; // transaction identifier - enum xa_states xa_state; // used by external XA only XID_STATE xid_state; Rows_log_event *m_pending_rows_event; @@ -1264,14 +1262,16 @@ public: We follow this logic: - when stmt starts, first_successful_insert_id_in_prev_stmt contains the first insert id successfully inserted by the previous stmt. - - as stmt makes progress, handler::insert_id_for_cur_row changes; every - time get_auto_increment() is called, auto_inc_intervals_for_binlog is - augmented with the reserved interval (if statement-based binlogging). + - as stmt makes progress, handler::insert_id_for_cur_row changes; + every time get_auto_increment() is called, + auto_inc_intervals_in_cur_stmt_for_binlog is augmented with the + reserved interval (if statement-based binlogging). - at first successful insertion of an autogenerated value, first_successful_insert_id_in_cur_stmt is set to handler::insert_id_for_cur_row. - - when stmt goes to binlog, auto_inc_intervals_for_binlog is - binlogged if non-empty. + - when stmt goes to binlog, + auto_inc_intervals_in_cur_stmt_for_binlog is binlogged if + non-empty. - when stmt ends, first_successful_insert_id_in_prev_stmt is set to first_successful_insert_id_in_cur_stmt. */ @@ -2491,6 +2491,11 @@ class multi_delete :public select_result_interceptor /* True if at least one table we delete from is not transactional */ bool normal_tables; bool delete_while_scanning; + /* + error handling (rollback and binlogging) can happen in send_eof() + so that afterward send_error() needs to find out that. + */ + bool error_handled; public: multi_delete(TABLE_LIST *dt, uint num_of_tables); @@ -2526,6 +2531,11 @@ class multi_update :public select_result_interceptor /* True if the update operation has made a change in a transactional table */ bool transactional_tables; bool ignore; + /* + error handling (rollback and binlogging) can happen in send_eof() + so that afterward send_error() needs to find out that. + */ + bool error_handled; public: multi_update(TABLE_LIST *ut, TABLE_LIST *leaves_list, diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 88902e65a42..7686dc695ad 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -883,6 +883,13 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); + /* + This statement will be replicated as a statement, even when using + row-based replication. The flag will be reset at the end of the + statement. + */ + thd->clear_current_stmt_binlog_row_based(); + length= build_table_filename(path, sizeof(path), db, "", "", 0); strmov(path+length, MY_DB_OPT_FILE); // Append db option file name del_dbopt(path); // Remove dboption hash entry diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index f183cb3142f..509e736f6e7 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -39,6 +39,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ha_rows deleted= 0; uint usable_index= MAX_KEY; SELECT_LEX *select_lex= &thd->lex->select_lex; + THD::killed_state killed_status= THD::NOT_KILLED; DBUG_ENTER("mysql_delete"); if (open_and_lock_tables(thd, table_list)) @@ -307,7 +308,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, else table->file->unlock_row(); // Row failed selection, release lock on it } - if (thd->killed || thd->is_error()) + killed_status= thd->killed; + if (killed_status != THD::NOT_KILLED || thd->is_error()) error= 1; // Aborted if (will_batch && (loc_error= table->file->end_bulk_delete())) { @@ -352,13 +354,12 @@ cleanup: thd->transaction.stmt.modified_non_trans_table= TRUE; /* See similar binlogging code in sql_update.cc, for comments */ - if ((error < 0) || (deleted && !transactional_table)) + if ((error < 0) || thd->transaction.stmt.modified_non_trans_table) { if (mysql_bin_log.is_open()) { if (error < 0) thd->clear_error(); - /* [binlog]: If 'handler::delete_all_rows()' was called and the storage engine does not inject the rows itself, we replicate @@ -367,7 +368,7 @@ cleanup: */ int log_result= thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_table, FALSE); + transactional_table, FALSE, killed_status); if (log_result && transactional_table) { @@ -548,7 +549,7 @@ bool mysql_multi_delete_prepare(THD *thd) multi_delete::multi_delete(TABLE_LIST *dt, uint num_of_tables_arg) : delete_tables(dt), deleted(0), found(0), num_of_tables(num_of_tables_arg), error(0), - do_delete(0), transactional_tables(0), normal_tables(0) + do_delete(0), transactional_tables(0), normal_tables(0), error_handled(0) { tempfiles= (Unique **) sql_calloc(sizeof(Unique *) * num_of_tables); } @@ -727,12 +728,14 @@ void multi_delete::send_error(uint errcode,const char *err) /* First send error what ever it is ... */ my_message(errcode, err, MYF(0)); - /* If nothing deleted return */ - if (!deleted) + /* the error was handled or nothing deleted and no side effects return */ + if (error_handled || + !thd->transaction.stmt.modified_non_trans_table && !deleted) DBUG_VOID_RETURN; /* Something already deleted so we have to invalidate cache */ - query_cache_invalidate3(thd, delete_tables, 1); + if (deleted) + query_cache_invalidate3(thd, delete_tables, 1); /* If rows from the first table only has been deleted and it is @@ -752,12 +755,30 @@ void multi_delete::send_error(uint errcode,const char *err) */ error= 1; send_eof(); + DBUG_ASSERT(error_handled); + DBUG_VOID_RETURN; } - DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table); + + if (thd->transaction.stmt.modified_non_trans_table) + { + /* + there is only side effects; to binlog with the error + */ + if (mysql_bin_log.is_open()) + { + thd->binlog_query(THD::ROW_QUERY_TYPE, + thd->query, thd->query_length, + transactional_tables, FALSE); + } + thd->transaction.all.modified_non_trans_table= true; + } + DBUG_ASSERT(!normal_tables || !deleted || + thd->transaction.stmt.modified_non_trans_table); DBUG_VOID_RETURN; } + /* Do delete from other tables. Returns values: @@ -850,6 +871,7 @@ int multi_delete::do_deletes() bool multi_delete::send_eof() { + THD::killed_state killed_status= THD::NOT_KILLED; thd->proc_info="deleting from reference tables"; /* Does deletes for the last n - 1 tables, returns 0 if ok */ @@ -857,7 +879,7 @@ bool multi_delete::send_eof() /* compute a total error to know if something failed */ local_error= local_error || error; - + killed_status= (local_error == 0)? THD::NOT_KILLED : thd->killed; /* reset used flags */ thd->proc_info="end"; @@ -869,7 +891,9 @@ bool multi_delete::send_eof() { query_cache_invalidate3(thd, delete_tables, 1); } - if ((local_error == 0) || (deleted && normal_tables)) + DBUG_ASSERT(!normal_tables || !deleted || + thd->transaction.stmt.modified_non_trans_table); + if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table) { if (mysql_bin_log.is_open()) { @@ -877,7 +901,7 @@ bool multi_delete::send_eof() thd->clear_error(); if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_tables, FALSE) && + transactional_tables, FALSE, killed_status) && !normal_tables) { local_error=1; // Log write failed: roll back the SQL statement @@ -886,7 +910,8 @@ bool multi_delete::send_eof() if (thd->transaction.stmt.modified_non_trans_table) thd->transaction.all.modified_non_trans_table= TRUE; } - DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table); + if (local_error != 0) + error_handled= TRUE; // to force early leave from ::send_error() /* Commit or rollback the current SQL statement */ if (transactional_tables) diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 19a99f9d12b..a4ba6f1140b 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -65,9 +65,6 @@ static enum enum_ha_read_modes rkey_to_rnext[]= { RNEXT_SAME, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV, RPREV }; -static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags); - - /* Get hash key and hash key length. @@ -119,13 +116,15 @@ static void mysql_ha_hash_free(TABLE_LIST *tables) @param thd Thread identifier. @param tables A list of tables with the first entry to close. + @param is_locked If LOCK_open is locked. @note Though this function takes a list of tables, only the first list entry will be closed. - @note Broadcasts refresh if it closed the table. + @note Broadcasts refresh if it closed a table with old version. */ -static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables) +static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables, + bool is_locked) { TABLE **table_ptr; @@ -143,13 +142,15 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables) if (*table_ptr) { (*table_ptr)->file->ha_index_or_rnd_end(); - VOID(pthread_mutex_lock(&LOCK_open)); + if (! is_locked) + VOID(pthread_mutex_lock(&LOCK_open)); if (close_thread_table(thd, table_ptr)) { /* Tell threads waiting for refresh that something has happened */ broadcast_refresh(); } - VOID(pthread_mutex_unlock(&LOCK_open)); + if (! is_locked) + VOID(pthread_mutex_unlock(&LOCK_open)); } else if (tables->table) { @@ -305,7 +306,7 @@ err: if (hash_tables) my_free((char*) hash_tables, MYF(0)); if (tables->table) - mysql_ha_close_table(thd, tables); + mysql_ha_close_table(thd, tables, FALSE); DBUG_PRINT("exit",("ERROR")); DBUG_RETURN(TRUE); } @@ -339,7 +340,7 @@ bool mysql_ha_close(THD *thd, TABLE_LIST *tables) (uchar*) tables->alias, strlen(tables->alias) + 1))) { - mysql_ha_close_table(thd, hash_tables); + mysql_ha_close_table(thd, hash_tables, FALSE); hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables); } else @@ -478,7 +479,7 @@ retry: if (need_reopen) { - mysql_ha_close_table(thd, tables); + mysql_ha_close_table(thd, tables, FALSE); hash_tables->table= NULL; /* The lock might have been aborted, we need to manually reset @@ -669,163 +670,130 @@ err0: } -/* - Flush (close) a list of HANDLER tables. - - SYNOPSIS - mysql_ha_flush() - thd Thread identifier. - tables The list of tables to close. If NULL, - close all HANDLER tables [marked as flushed]. - mode_flags MYSQL_HA_CLOSE_FINAL finally close the table. - MYSQL_HA_REOPEN_ON_USAGE mark for reopen. - MYSQL_HA_FLUSH_ALL flush all tables, not only - those marked for flush. - is_locked If LOCK_open is locked. - - DESCRIPTION - The list of HANDLER tables may be NULL, in which case all HANDLER - tables are closed (if MYSQL_HA_FLUSH_ALL) is set. - If 'tables' is NULL and MYSQL_HA_FLUSH_ALL is not set, - all HANDLER tables marked for flush are closed. - Broadcasts refresh for every table closed. +/** + Scan the handler tables hash for matching tables. - NOTE - Since mysql_ha_flush() is called when the base table has to be closed, - we compare real table names, not aliases. Hence, database names matter. + @param thd Thread identifier. + @param tables The list of tables to remove. - RETURN - 0 ok + @return Pointer to head of linked list (TABLE_LIST::next_local) of matching + TABLE_LIST elements from handler_tables_hash. Otherwise, NULL if no + table was matched. */ -int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags, - bool is_locked) +static TABLE_LIST *mysql_ha_find(THD *thd, TABLE_LIST *tables) { - TABLE_LIST *tmp_tables; - TABLE **table_ptr; - bool did_lock= FALSE; - DBUG_ENTER("mysql_ha_flush"); - DBUG_PRINT("enter", ("tables: 0x%lx mode_flags: 0x%02x", - (long) tables, mode_flags)); + TABLE_LIST *hash_tables, *head= NULL, *first= tables; + DBUG_ENTER("mysql_ha_find"); - if (tables) + /* search for all handlers with matching table names */ + for (uint i= 0; i < thd->handler_tables_hash.records; i++) { - /* Close all tables in the list. */ - for (tmp_tables= tables ; tmp_tables; tmp_tables= tmp_tables->next_local) + hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i); + for (tables= first; tables; tables= tables->next_local) { - DBUG_PRINT("info-in-tables-list",("'%s'.'%s' as '%s'", - tmp_tables->db, tmp_tables->table_name, - tmp_tables->alias)); - /* Close all currently open handler tables with the same base table. */ - table_ptr= &(thd->handler_tables); - while (*table_ptr) - { - if ((!*tmp_tables->db || - !my_strcasecmp(&my_charset_latin1, (*table_ptr)->s->db.str, - tmp_tables->db)) && - ! my_strcasecmp(&my_charset_latin1, - (*table_ptr)->s->table_name.str, - tmp_tables->table_name)) - { - DBUG_PRINT("info",("*table_ptr '%s'.'%s' as '%s'", - (*table_ptr)->s->db.str, - (*table_ptr)->s->table_name.str, - (*table_ptr)->alias)); - /* The first time it is required, lock for close_thread_table(). */ - if (! did_lock && ! is_locked) - { - VOID(pthread_mutex_lock(&LOCK_open)); - did_lock= TRUE; - } - mysql_ha_flush_table(thd, table_ptr, mode_flags); - continue; - } - table_ptr= &(*table_ptr)->next; - } - /* end of handler_tables list */ + if ((! *tables->db || + ! my_strcasecmp(&my_charset_latin1, hash_tables->db, tables->db)) && + ! my_strcasecmp(&my_charset_latin1, hash_tables->table_name, + tables->table_name)) + break; } - /* end of flush tables list */ - } - else - { - /* Close all currently open tables [which are marked for flush]. */ - table_ptr= &(thd->handler_tables); - while (*table_ptr) + if (tables) { - if ((mode_flags & MYSQL_HA_FLUSH_ALL) || - (*table_ptr)->needs_reopen_or_name_lock()) - { - /* The first time it is required, lock for close_thread_table(). */ - if (! did_lock && ! is_locked) - { - VOID(pthread_mutex_lock(&LOCK_open)); - did_lock= TRUE; - } - mysql_ha_flush_table(thd, table_ptr, mode_flags); - continue; - } - table_ptr= &(*table_ptr)->next; + hash_tables->next_local= head; + head= hash_tables; } } - /* Release the lock if it was taken by this function. */ - if (did_lock) - VOID(pthread_mutex_unlock(&LOCK_open)); + DBUG_RETURN(head); +} + + +/** + Remove matching tables from the HANDLER's hash table. + + @param thd Thread identifier. + @param tables The list of tables to remove. + @param is_locked If LOCK_open is locked. + + @note Broadcasts refresh if it closed a table with old version. +*/ + +void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables, bool is_locked) +{ + TABLE_LIST *hash_tables, *next; + DBUG_ENTER("mysql_ha_rm_tables"); + + DBUG_ASSERT(tables); + + hash_tables= mysql_ha_find(thd, tables); - DBUG_RETURN(0); + while (hash_tables) + { + next= hash_tables->next_local; + if (hash_tables->table) + mysql_ha_close_table(thd, hash_tables, is_locked); + hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables); + hash_tables= next; + } + + DBUG_VOID_RETURN; } -/* - Flush (close) a table. - SYNOPSIS - mysql_ha_flush_table() - thd Thread identifier. - table The table to close. - mode_flags MYSQL_HA_CLOSE_FINAL finally close the table. - MYSQL_HA_REOPEN_ON_USAGE mark for reopen. +/** + Flush (close and mark for re-open) all tables that should be should + be reopen. - DESCRIPTION - Broadcasts refresh if it closed the table. - The caller must lock LOCK_open. + @param thd Thread identifier. - RETURN - 0 ok + @note Broadcasts refresh if it closed a table with old version. */ -static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags) +void mysql_ha_flush(THD *thd) { - TABLE_LIST *hash_tables; - TABLE *table= *table_ptr; - DBUG_ENTER("mysql_ha_flush_table"); - DBUG_PRINT("enter",("'%s'.'%s' as '%s' flags: 0x%02x", - table->s->db.str, table->s->table_name.str, - table->alias, mode_flags)); + TABLE_LIST *hash_tables; + DBUG_ENTER("mysql_ha_flush"); - if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash, - (uchar*) table->alias, - strlen(table->alias) + 1))) + safe_mutex_assert_owner(&LOCK_open); + + for (uint i= 0; i < thd->handler_tables_hash.records; i++) { - if (! (mode_flags & MYSQL_HA_REOPEN_ON_USAGE)) - { - /* This is a final close. Remove from hash. */ - hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables); - } - else + hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i); + if (hash_tables->table && hash_tables->table->needs_reopen_or_name_lock()) { + mysql_ha_close_table(thd, hash_tables, TRUE); /* Mark table as closed, ready for re-open. */ hash_tables->table= NULL; } - } + } - safe_mutex_assert_owner(&LOCK_open); - (*table_ptr)->file->ha_index_or_rnd_end(); - safe_mutex_assert_owner(&LOCK_open); - if (close_thread_table(thd, table_ptr)) + DBUG_VOID_RETURN; +} + + +/** + Close all HANDLER's tables. + + @param thd Thread identifier. + + @note Broadcasts refresh if it closed a table with old version. +*/ + +void mysql_ha_cleanup(THD *thd) +{ + TABLE_LIST *hash_tables; + DBUG_ENTER("mysql_ha_cleanup"); + + for (uint i= 0; i < thd->handler_tables_hash.records; i++) { - /* Tell threads waiting for refresh that something has happened */ - broadcast_refresh(); - } + hash_tables= (TABLE_LIST*) hash_element(&thd->handler_tables_hash, i); + if (hash_tables->table) + mysql_ha_close_table(thd, hash_tables, FALSE); + } - DBUG_RETURN(0); + hash_free(&thd->handler_tables_hash); + + DBUG_VOID_RETURN; } + diff --git a/sql/sql_help.cc b/sql/sql_help.cc index c1962c8c650..0d633ce86ac 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -528,7 +528,7 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, List_iterator<String> it(*names); for (pos= pointers; pos!=end; (*pos++= it++)); - qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp); + my_qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp); for (pos= pointers; pos!=end; pos++) { diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 83f7d9c2e78..805a8aeb445 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -574,7 +574,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, bool log_on= ((thd->options & OPTION_BIN_LOG) || (!(thd->security_ctx->master_access & SUPER_ACL))); #endif - thr_lock_type lock_type = table_list->lock_type; + thr_lock_type lock_type; Item *unused_conds= 0; DBUG_ENTER("mysql_insert"); @@ -609,6 +609,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, if (open_and_lock_tables(thd, table_list)) DBUG_RETURN(TRUE); } + lock_type= table_list->lock_type; thd->proc_info="init"; thd->used_tables=0; @@ -626,7 +627,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, /* mysql_prepare_insert set table_list->table if it was not set */ table= table_list->table; - lock_type= table_list->lock_type; context= &thd->lex->select_lex.context; /* @@ -837,59 +837,58 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, } transactional_table= table->file->has_transactions(); - if ((changed= (info.copied || info.deleted || info.updated)) || - was_insert_delayed) + if ((changed= (info.copied || info.deleted || info.updated))) { /* Invalidate the table in the query cache if something changed. For the transactional algorithm to work the invalidation must be before binlog writing and ha_autocommit_or_rollback */ - if (changed) - query_cache_invalidate3(thd, table_list, 1); - if (error <= 0 || !transactional_table) + query_cache_invalidate3(thd, table_list, 1); + } + if (changed && error <= 0 || thd->transaction.stmt.modified_non_trans_table + || was_insert_delayed) + { + if (mysql_bin_log.is_open()) { - if (mysql_bin_log.is_open()) + if (error <= 0) { - if (error <= 0) - { - /* - [Guilhem wrote] Temporary errors may have filled - thd->net.last_error/errno. For example if there has - been a disk full error when writing the row, and it was - MyISAM, then thd->net.last_error/errno will be set to - "disk full"... and the my_pwrite() will wait until free - space appears, and so when it finishes then the - write_row() was entirely successful - */ - /* todo: consider removing */ - thd->clear_error(); - } - /* bug#22725: - - A query which per-row-loop can not be interrupted with - KILLED, like INSERT, and that does not invoke stored - routines can be binlogged with neglecting the KILLED error. - - If there was no error (error == zero) until after the end of - inserting loop the KILLED flag that appeared later can be - disregarded since previously possible invocation of stored - routines did not result in any error due to the KILLED. In - such case the flag is ignored for constructing binlog event. - */ - DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0); - if (thd->binlog_query(THD::ROW_QUERY_TYPE, - thd->query, thd->query_length, - transactional_table, FALSE, - (error>0) ? thd->killed : THD::NOT_KILLED) && - transactional_table) - { - error=1; - } - } - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; + /* + [Guilhem wrote] Temporary errors may have filled + thd->net.last_error/errno. For example if there has + been a disk full error when writing the row, and it was + MyISAM, then thd->net.last_error/errno will be set to + "disk full"... and the my_pwrite() will wait until free + space appears, and so when it finishes then the + write_row() was entirely successful + */ + /* todo: consider removing */ + thd->clear_error(); + } + /* bug#22725: + + A query which per-row-loop can not be interrupted with + KILLED, like INSERT, and that does not invoke stored + routines can be binlogged with neglecting the KILLED error. + + If there was no error (error == zero) until after the end of + inserting loop the KILLED flag that appeared later can be + disregarded since previously possible invocation of stored + routines did not result in any error due to the KILLED. In + such case the flag is ignored for constructing binlog event. + */ + DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0); + if (thd->binlog_query(THD::ROW_QUERY_TYPE, + thd->query, thd->query_length, + transactional_table, FALSE, + (error>0) ? thd->killed : THD::NOT_KILLED) && + transactional_table) + { + error=1; + } } + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; } DBUG_ASSERT(transactional_table || !changed || thd->transaction.stmt.modified_non_trans_table); @@ -2273,7 +2272,17 @@ pthread_handler_t handle_delayed_insert(void *arg) parsed using a lex, that depends on initialized thd->lex. */ lex_start(thd); - if (!(di->table=open_ltable(thd, &di->table_list, TL_WRITE_DELAYED, 0))) + thd->lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock() + /* + Statement-based replication of INSERT DELAYED has problems with RAND() + and user vars, so in mixed mode we go to row-based. + */ + thd->lex->set_stmt_unsafe(); + thd->set_current_stmt_binlog_row_based_if_mixed(); + + /* Open table */ + if (!(di->table= open_n_lock_single_table(thd, &di->table_list, + TL_WRITE_DELAYED))) { thd->fatal_error(); // Abort waiting inserts goto err; @@ -3090,6 +3099,7 @@ bool select_insert::send_eof() bool const trans_table= table->file->has_transactions(); ulonglong id; bool changed; + THD::killed_state killed_status= thd->killed; DBUG_ENTER("select_insert::send_eof"); DBUG_PRINT("enter", ("trans_table=%d, table_type='%s'", trans_table, table->file->table_type())); @@ -3123,7 +3133,7 @@ bool select_insert::send_eof() thd->clear_error(); thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - trans_table, FALSE); + trans_table, FALSE, killed_status); } /* We will call ha_autocommit_or_rollback() also for @@ -3175,6 +3185,7 @@ void select_insert::abort() { */ if (table) { + bool changed, transactional_table; /* If we are not in prelocked mode, we end the bulk insert started before. @@ -3196,20 +3207,20 @@ void select_insert::abort() { If table creation failed, the number of rows modified will also be zero, so no check for that is made. */ - if (info.copied || info.deleted || info.updated) + changed= (info.copied || info.deleted || info.updated); + transactional_table= table->file->has_transactions(); + if (thd->transaction.stmt.modified_non_trans_table) { - DBUG_ASSERT(table != NULL); - if (!table->file->has_transactions()) - { if (mysql_bin_log.is_open()) thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - table->file->has_transactions(), FALSE); - if (!thd->current_stmt_binlog_row_based && !table->s->tmp_table && - !can_rollback_data()) + transactional_table, FALSE); + if (!thd->current_stmt_binlog_row_based && !can_rollback_data()) thd->transaction.all.modified_non_trans_table= TRUE; - query_cache_invalidate3(thd, table, 1); - } + if (changed) + query_cache_invalidate3(thd, table, 1); } + DBUG_ASSERT(transactional_table || !changed || + thd->transaction.stmt.modified_non_trans_table); table->file->ha_release_auto_increment(); } @@ -3304,7 +3315,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, tmp_table.alias= 0; tmp_table.timestamp_field= 0; tmp_table.s= &share; - init_tmp_table_share(&share, "", 0, "", ""); + init_tmp_table_share(thd, &share, "", 0, "", ""); tmp_table.s->db_create_options=0; tmp_table.s->blob_ptr_size= portable_sizeof_char_ptr; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index da0ff94ec96..cdae7449cc7 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1834,11 +1834,11 @@ typedef struct st_lex : public Query_tables_list struct st_lex_local: public st_lex { - static void *operator new(size_t size) + static void *operator new(size_t size) throw() { return sql_alloc(size); } - static void *operator new(size_t size, MEM_ROOT *mem_root) + static void *operator new(size_t size, MEM_ROOT *mem_root) throw() { return (void*) alloc_root(mem_root, (uint) size); } diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 8bbe1e413b3..c96fbb80b0c 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -85,7 +85,8 @@ static int read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, #ifndef EMBEDDED_LIBRARY static bool write_execute_load_query_log_event(THD *thd, bool duplicates, bool ignore, - bool transactional_table); + bool transactional_table, + THD::killed_state killed_status); #endif /* EMBEDDED_LIBRARY */ /* @@ -134,6 +135,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, char *tdb= thd->db ? thd->db : db; // Result is never null ulong skip_lines= ex->skip_lines; bool transactional_table; + THD::killed_state killed_status= THD::NOT_KILLED; DBUG_ENTER("mysql_load"); #ifdef EMBEDDED_LIBRARY @@ -403,7 +405,16 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, free_blobs(table); /* if pack_blob was used */ table->copy_blobs=0; thd->count_cuted_fields= CHECK_FIELD_IGNORE; - + /* + simulated killing in the middle of per-row loop + must be effective for binlogging + */ + DBUG_EXECUTE_IF("simulate_kill_bug27571", + { + error=1; + thd->killed= THD::KILL_QUERY; + };); + killed_status= (error == 0)? THD::NOT_KILLED : thd->killed; /* We must invalidate the table in query cache before binlog writing and ha_autocommit_... @@ -445,9 +456,10 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, /* If the file was not empty, wrote_create_file is true */ if (lf_info.wrote_create_file) { - if ((info.copied || info.deleted) && !transactional_table) + if (thd->transaction.stmt.modified_non_trans_table) write_execute_load_query_log_event(thd, handle_duplicates, - ignore, transactional_table); + ignore, transactional_table, + killed_status); else { Delete_file_log_event d(thd, db, transactional_table); @@ -492,8 +504,8 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, read_info.end_io_cache(); if (lf_info.wrote_create_file) { - write_execute_load_query_log_event(thd, handle_duplicates, - ignore, transactional_table); + write_execute_load_query_log_event(thd, handle_duplicates, ignore, + transactional_table,killed_status); } } } @@ -523,7 +535,8 @@ err: /* Not a very useful function; just to avoid duplication of code */ static bool write_execute_load_query_log_event(THD *thd, bool duplicates, bool ignore, - bool transactional_table) + bool transactional_table, + THD::killed_state killed_err_arg) { Execute_load_query_log_event e(thd, thd->query, thd->query_length, @@ -531,7 +544,7 @@ static bool write_execute_load_query_log_event(THD *thd, (char*)thd->lex->fname_end - (char*)thd->query, (duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE : (ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR), - transactional_table, FALSE); + transactional_table, FALSE, killed_err_arg); e.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F; return mysql_bin_log.write(&e); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7a777ba2bbd..2435c16819f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -470,6 +470,46 @@ end: } +/** + @brief Check access privs for a MERGE table and fix children lock types. + + @param[in] thd thread handle + @param[in] db database name + @param[in,out] table_list list of child tables (merge_list) + lock_type and optionally db set per table + + @return status + @retval 0 OK + @retval != 0 Error + + @detail + This function is used for write access to MERGE tables only + (CREATE TABLE, ALTER TABLE ... UNION=(...)). Set TL_WRITE for + every child. Set 'db' for every child if not present. +*/ + +static bool check_merge_table_access(THD *thd, char *db, + TABLE_LIST *table_list) +{ + int error= 0; + + if (table_list) + { + /* Check that all tables use the current database */ + TABLE_LIST *tlist; + + for (tlist= table_list; tlist; tlist= tlist->next_local) + { + if (!tlist->db || !tlist->db[0]) + tlist->db= db; /* purecov: inspected */ + } + error= check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL, + table_list,0); + } + return error; +} + + /* This works because items are allocated with sql_alloc() */ void free_items(Item *item) @@ -748,12 +788,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, NET *net= &thd->net; bool error= 0; DBUG_ENTER("dispatch_command"); - - if (thd->killed == THD::KILL_QUERY || thd->killed == THD::KILL_BAD_DATA) - { - thd->killed= THD::NOT_KILLED; - thd->mysys_var->abort= 0; - } + DBUG_PRINT("info",("packet: '%*.s'; command: %d", packet_length, packet, command)); thd->command=command; /* @@ -2076,7 +2111,16 @@ mysql_execute_command(THD *thd) if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL)) goto error; pthread_mutex_lock(&LOCK_active_mi); - res = show_master_info(thd,active_mi); + if (active_mi != NULL) + { + res = show_master_info(thd, active_mi); + } + else + { + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, + "the master info structure does not exist"); + send_ok(thd); + } pthread_mutex_unlock(&LOCK_active_mi); break; } @@ -2250,6 +2294,19 @@ mysql_execute_command(THD *thd) select_lex->options|= SELECT_NO_UNLOCK; unit->set_limit(select_lex); + /* + Disable non-empty MERGE tables with CREATE...SELECT. Too + complicated. See Bug #26379. Empty MERGE tables are read-only + and don't allow CREATE...SELECT anyway. + */ + if (create_info.used_fields & HA_CREATE_USED_UNION) + { + my_error(ER_WRONG_OBJECT, MYF(0), create_table->db, + create_table->table_name, "BASE TABLE"); + res= 1; + goto end_with_restore_list; + } + if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE)) { lex->link_first_table_back(create_table, link_to_local); @@ -2931,6 +2988,13 @@ end_with_restore_list: SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK | OPTION_SETUP_TABLES_DONE, del_result, unit, select_lex); + res|= thd->net.report_error; + if (unlikely(res)) + { + /* If we had a another error reported earlier then this will be ignored */ + del_result->send_error(ER_UNKNOWN_ERROR, "Execution of the query failed"); + del_result->abort(); + } delete del_result; } else @@ -5072,26 +5136,6 @@ bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table) DBUG_RETURN(1); } - -bool check_merge_table_access(THD *thd, char *db, - TABLE_LIST *table_list) -{ - int error=0; - if (table_list) - { - /* Check that all tables use the current database */ - TABLE_LIST *tmp; - for (tmp= table_list; tmp; tmp= tmp->next_local) - { - if (!tmp->db || !tmp->db[0]) - tmp->db=db; - } - error=check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL, - table_list,0); - } - return error; -} - #endif /*NO_EMBEDDED_ACCESS_CHECKS*/ /**************************************************************************** @@ -6271,24 +6315,23 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields, } -/* - Reload/resets privileges and the different caches. - - SYNOPSIS - reload_acl_and_cache() - thd Thread handler (can be NULL!) - options What should be reset/reloaded (tables, privileges, - slave...) - tables Tables to flush (if any) - write_to_binlog Depending on 'options', it may be very bad to write the - query to the binlog (e.g. FLUSH SLAVE); this is a - pointer where reload_acl_and_cache() will put 0 if - it thinks we really should not write to the binlog. - Otherwise it will put 1. - - RETURN - 0 ok - !=0 error. thd->killed or thd->is_error() is set +/** + @brief Reload/resets privileges and the different caches. + + @param thd Thread handler (can be NULL!) + @param options What should be reset/reloaded (tables, privileges, slave...) + @param tables Tables to flush (if any) + @param write_to_binlog True if we can write to the binlog. + + @note Depending on 'options', it may be very bad to write the + query to the binlog (e.g. FLUSH SLAVE); this is a + pointer where reload_acl_and_cache() will put 0 if + it thinks we really should not write to the binlog. + Otherwise it will put 1. + + @return Error status code + @retval 0 Ok + @retval !=0 Error; thd->killed is set or thd->is_error() is true */ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, @@ -6392,7 +6435,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, for (; lock_p < end_p; lock_p++) { - if ((*lock_p)->type == TL_WRITE) + if ((*lock_p)->type >= TL_WRITE_ALLOW_WRITE) { my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0)); return 1; @@ -6962,8 +7005,15 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables, bool error= TRUE; // Error message is given DBUG_ENTER("create_table_precheck"); + /* + Require CREATE [TEMPORARY] privilege on new table; for + CREATE TABLE ... SELECT, also require INSERT. + */ + want_priv= ((lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) ? - CREATE_TMP_ACL : CREATE_ACL); + CREATE_TMP_ACL : CREATE_ACL) | + (select_lex->item_list.elements ? INSERT_ACL : 0); + if (check_access(thd, want_priv, create_table->db, &create_table->grant.privilege, 0, 0, test(create_table->schema_table)) || diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 1f365ac991b..67190c94a56 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1402,7 +1402,7 @@ static void set_up_partition_func_pointers(partition_info *part_info) NONE */ -static void set_linear_hash_mask(partition_info *part_info, uint no_parts) +void set_linear_hash_mask(partition_info *part_info, uint no_parts) { uint mask; @@ -2834,8 +2834,8 @@ int get_partition_id_range(partition_info *part_info, loc_part_id++; *part_id= (uint32)loc_part_id; if (loc_part_id == max_partition && - range_array[loc_part_id] != LONGLONG_MAX && - part_func_value >= range_array[loc_part_id]) + part_func_value >= range_array[loc_part_id] && + !part_info->defined_max_value) DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND); DBUG_PRINT("exit",("partition: %d", *part_id)); @@ -2941,7 +2941,13 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info, } if (left_endpoint) { - if (part_func_value >= range_array[loc_part_id]) + longlong bound= range_array[loc_part_id]; + /* + In case of PARTITION p VALUES LESS THAN MAXVALUE + the maximum value is in the current partition. + */ + if (part_func_value > bound || + (part_func_value == bound && !part_info->defined_max_value)) loc_part_id++; } else @@ -4952,7 +4958,7 @@ the generated partition syntax in a correct manner. We use the old partitioning also for the new table. We do this by assigning the partition_info from the table loaded in - open_ltable to the partition_info struct used by mysql_create_table + open_table to the partition_info struct used by mysql_create_table later in this method. Case IIb: diff --git a/sql/sql_partition.h b/sql/sql_partition.h index 56f24181b93..282e24f1853 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -65,6 +65,7 @@ int get_part_for_delete(const uchar *buf, const uchar *rec0, void prune_partition_set(const TABLE *table, part_id_range *part_spec); bool check_partition_info(partition_info *part_info,handlerton **eng_type, TABLE *table, handler *file, HA_CREATE_INFO *info); +void set_linear_hash_mask(partition_info *part_info, uint no_parts); bool fix_partition_func(THD *thd, TABLE *table, bool create_table_ind); char *generate_partition_syntax(partition_info *part_info, uint *buf_length, bool use_sql_alloc, diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index d306ded7f4f..2a86844c8c6 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -181,6 +181,7 @@ public: TYPELIB* plugin_var_typelib(void); uchar* value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); bool check(THD *thd, set_var *var); + bool check_default(enum_var_type type) { return is_readonly(); } void set_default(THD *thd, enum_var_type type); bool update(THD *thd, set_var *var); }; @@ -2215,9 +2216,11 @@ static st_bookmark *register_var(const char *plugin, const char *name, size= sizeof(int); break; case PLUGIN_VAR_LONG: + case PLUGIN_VAR_ENUM: size= sizeof(long); break; case PLUGIN_VAR_LONGLONG: + case PLUGIN_VAR_SET: size= sizeof(ulonglong); break; case PLUGIN_VAR_STR: @@ -2658,6 +2661,7 @@ void sys_var_pluginvar::set_default(THD *thd, enum_var_type type) if (is_readonly()) return; + pthread_mutex_lock(&LOCK_global_system_variables); tgt= real_value_ptr(thd, type); src= ((void **) (plugin_var + 1) + 1); @@ -2674,12 +2678,14 @@ void sys_var_pluginvar::set_default(THD *thd, enum_var_type type) if (!(plugin_var->flags & PLUGIN_VAR_THDLOCAL) || type == OPT_GLOBAL) { - pthread_mutex_lock(&LOCK_plugin); plugin_var->update(thd, plugin_var, tgt, src); - pthread_mutex_unlock(&LOCK_plugin); + pthread_mutex_unlock(&LOCK_global_system_variables); } else + { + pthread_mutex_unlock(&LOCK_global_system_variables); plugin_var->update(thd, plugin_var, tgt, src); + } } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index b1b1502f015..9d4d62e57b6 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2700,7 +2700,7 @@ Prepared_statement::Prepared_statement(THD *thd_arg, Protocol *protocol_arg) last_errno(0), flags((uint) IS_IN_USE) { - init_alloc_root(&main_mem_root, thd_arg->variables.query_alloc_block_size, + init_sql_alloc(&main_mem_root, thd_arg->variables.query_alloc_block_size, thd_arg->variables.query_prealloc_size); *last_error= '\0'; } diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 750bcd50479..9dd8e1b70d4 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -51,6 +51,8 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) DBUG_RETURN(1); } + mysql_ha_rm_tables(thd, table_list, FALSE); + if (wait_if_global_read_lock(thd,0,1)) DBUG_RETURN(1); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 0249af147b0..88040e2933c 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -369,7 +369,6 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, name=0; // Find first log linfo.index_file_offset = 0; - thd->current_linfo = &linfo; if (mysql_bin_log.find_log_pos(&linfo, name, 1)) { @@ -378,6 +377,10 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, goto err; } + pthread_mutex_lock(&LOCK_thread_count); + thd->current_linfo = &linfo; + pthread_mutex_unlock(&LOCK_thread_count); + if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0) { my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; @@ -1359,7 +1362,6 @@ bool mysql_show_binlog_events(THD* thd) name=0; // Find first log linfo.index_file_offset = 0; - thd->current_linfo = &linfo; if (mysql_bin_log.find_log_pos(&linfo, name, 1)) { @@ -1367,6 +1369,10 @@ bool mysql_show_binlog_events(THD* thd) goto err; } + pthread_mutex_lock(&LOCK_thread_count); + thd->current_linfo = &linfo; + pthread_mutex_unlock(&LOCK_thread_count); + if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0) goto err; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fab46b4e1eb..173a92736b9 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3728,7 +3728,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, { KEYUSE key_end,*prev,*save_pos,*use; - qsort(keyuse->buffer,keyuse->elements,sizeof(KEYUSE), + my_qsort(keyuse->buffer,keyuse->elements,sizeof(KEYUSE), (qsort_cmp) sort_keyuse); bzero((char*) &key_end,sizeof(key_end)); /* Add for easy testing */ @@ -4497,8 +4497,9 @@ choose_plan(JOIN *join, table_map join_tables) Apply heuristic: pre-sort all access plans with respect to the number of records accessed. */ - qsort(join->best_ref + join->const_tables, join->tables - join->const_tables, - sizeof(JOIN_TAB*), straight_join?join_tab_cmp_straight:join_tab_cmp); + my_qsort(join->best_ref + join->const_tables, + join->tables - join->const_tables, sizeof(JOIN_TAB*), + straight_join ? join_tab_cmp_straight : join_tab_cmp); if (straight_join) { @@ -4545,6 +4546,17 @@ choose_plan(JOIN *join, table_map join_tables) ptr1 pointer to first JOIN_TAB object ptr2 pointer to second JOIN_TAB object + NOTES + The order relation implemented by join_tab_cmp() is not transitive, + i.e. it is possible to choose such a, b and c that (a < b) && (b < c) + but (c < a). This implies that result of a sort using the relation + implemented by join_tab_cmp() depends on the order in which + elements are compared, i.e. the result is implementation-specific. + Example: + a: dependent = 0x0 table->map = 0x1 found_records = 3 ptr = 0x907e6b0 + b: dependent = 0x0 table->map = 0x2 found_records = 3 ptr = 0x907e838 + c: dependent = 0x6 table->map = 0x10 found_records = 2 ptr = 0x907ecd0 + RETURN 1 if first is bigger -1 if second is bigger @@ -6445,7 +6457,15 @@ make_join_readinfo(JOIN *join, ulonglong options) else if (!table->covering_keys.is_clear_all() && !(tab->select && tab->select->quick)) { // Only read index tree - tab->index=find_shortest_key(table, & table->covering_keys); + /* + See bug #26447: "Using the clustered index for a table scan + is always faster than using a secondary index". + */ + if (table->s->primary_key != MAX_KEY && + table->file->primary_key_is_clustered()) + tab->index= table->s->primary_key; + else + tab->index=find_shortest_key(table, & table->covering_keys); tab->read_first_record= join_read_first; tab->type=JT_NEXT; // Read with index_first / index_next } @@ -9206,9 +9226,43 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, new_field->set_derivation(item->collation.derivation); break; case DECIMAL_RESULT: - new_field= new Field_new_decimal(item->max_length, maybe_null, item->name, - item->decimals, item->unsigned_flag); + { + uint8 dec= item->decimals; + uint8 intg= ((Item_decimal *) item)->decimal_precision() - dec; + uint32 len= item->max_length; + + /* + Trying to put too many digits overall in a DECIMAL(prec,dec) + will always throw a warning. We must limit dec to + DECIMAL_MAX_SCALE however to prevent an assert() later. + */ + + if (dec > 0) + { + signed int overflow; + + dec= min(dec, DECIMAL_MAX_SCALE); + + /* + If the value still overflows the field with the corrected dec, + we'll throw out decimals rather than integers. This is still + bad and of course throws a truncation warning. + +1: for decimal point + */ + + overflow= my_decimal_precision_to_length(intg + dec, dec, + item->unsigned_flag) - len; + + if (overflow > 0) + dec= max(0, dec - overflow); // too long, discard fract + else + len -= item->decimals - dec; // corrected value fits + } + + new_field= new Field_new_decimal(len, maybe_null, item->name, + dec, item->unsigned_flag); break; + } case ROW_RESULT: default: // This case should never be choosen @@ -9629,7 +9683,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, table->keys_in_use_for_query.init(); table->s= share; - init_tmp_table_share(share, "", 0, tmpname, tmpname); + init_tmp_table_share(thd, share, "", 0, tmpname, tmpname); share->blob_field= blob_field; share->blob_ptr_size= mi_portable_sizeof_char_ptr; share->db_low_byte_first=1; // True for HEAP and MyISAM diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a347482859f..9a7d7c59af3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -29,6 +29,8 @@ #include "event_data_objects.h" #include <my_dir.h> +#define STR_OR_NIL(S) ((S) ? (S) : "<nil>") + #ifdef WITH_PARTITION_STORAGE_ENGINE #include "ha_partition.h" #endif @@ -3135,8 +3137,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; } DBUG_PRINT("INDEX VALUES",("db_name='%s', table_name='%s'", - lookup_field_vals.db_value.str, - lookup_field_vals.table_value.str)); + STR_OR_NIL(lookup_field_vals.db_value.str), + STR_OR_NIL(lookup_field_vals.table_value.str))); if (!lookup_field_vals.wild_db_value && !lookup_field_vals.wild_table_value) { diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f179d8bea1e..dfb44f0d444 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1552,6 +1552,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, built_query.append("DROP TABLE "); } + mysql_ha_rm_tables(thd, tables, FALSE); + pthread_mutex_lock(&LOCK_open); /* @@ -1593,7 +1595,9 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, handlerton *table_type; enum legacy_db_type frm_db_type; - mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, 1); + DBUG_PRINT("table", ("table_l: '%s'.'%s' table: 0x%lx s: 0x%lx", + table->db, table->table_name, (long) table->table, + table->table ? (long) table->table->s : (long) -1)); error= drop_temporary_table(thd, table); @@ -1603,13 +1607,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, tmp_table_deleted= 1; continue; case -1: - // table already in use - /* - XXX: This branch should never be taken outside of SF, trigger or - prelocked mode. - - DBUG_ASSERT(thd->in_sub_stmt); - */ + DBUG_ASSERT(thd->in_sub_stmt); error= 1; goto err_with_placeholders; default: @@ -1722,6 +1720,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, wrong_tables.append(','); wrong_tables.append(String(table->table_name,system_charset_info)); } + DBUG_PRINT("table", ("table: 0x%lx s: 0x%lx", (long) table->table, + table->table ? (long) table->table->s : (long) -1)); } /* It's safe to unlock LOCK_open: we have an exclusive lock @@ -1830,7 +1830,8 @@ bool quick_rm_table(handlerton *base,const char *db, /* Sort keys in the following order: - PRIMARY KEY - - UNIQUE keyws where all column are NOT NULL + - UNIQUE keys where all column are NOT NULL + - UNIQUE keys that don't contain partial segments - Other UNIQUE keys - Normal keys - Fulltext keys @@ -1841,26 +1842,31 @@ bool quick_rm_table(handlerton *base,const char *db, static int sort_keys(KEY *a, KEY *b) { - if (a->flags & HA_NOSAME) + ulong a_flags= a->flags, b_flags= b->flags; + + if (a_flags & HA_NOSAME) { - if (!(b->flags & HA_NOSAME)) + if (!(b_flags & HA_NOSAME)) return -1; - if ((a->flags ^ b->flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) + if ((a_flags ^ b_flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) { /* Sort NOT NULL keys before other keys */ - return (a->flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1; + return (a_flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1; } if (a->name == primary_key_name) return -1; if (b->name == primary_key_name) return 1; + /* Sort keys don't containing partial segments before others */ + if ((a_flags ^ b_flags) & HA_KEY_HAS_PART_KEY_SEG) + return (a_flags & HA_KEY_HAS_PART_KEY_SEG) ? 1 : -1; } - else if (b->flags & HA_NOSAME) + else if (b_flags & HA_NOSAME) return 1; // Prefer b - if ((a->flags ^ b->flags) & HA_FULLTEXT) + if ((a_flags ^ b_flags) & HA_FULLTEXT) { - return (a->flags & HA_FULLTEXT) ? 1 : -1; + return (a_flags & HA_FULLTEXT) ? 1 : -1; } /* Prefer original key order. usable_key_parts contains here @@ -2924,6 +2930,10 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, else key_info->flags|= HA_PACK_KEY; } + /* Check if the key segment is partial, set the key flag accordingly */ + if (length != sql_field->key_length) + key_info->flags|= HA_KEY_HAS_PART_KEY_SEG; + key_length+=length; key_part_info++; @@ -2979,8 +2989,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(TRUE); } /* Sort keys in optimized order */ - qsort((uchar*) *key_info_buffer, *key_count, sizeof(KEY), - (qsort_cmp) sort_keys); + my_qsort((uchar*) *key_info_buffer, *key_count, sizeof(KEY), + (qsort_cmp) sort_keys); create_info->null_bits= null_fields; DBUG_RETURN(FALSE); @@ -3737,14 +3747,16 @@ mysql_rename_table(handlerton *base, const char *old_db, Win32 clients must also have a WRITE LOCK on the table ! */ -static void wait_while_table_is_used(THD *thd,TABLE *table, - enum ha_extra_function function) +void wait_while_table_is_used(THD *thd, TABLE *table, + enum ha_extra_function function) { DBUG_ENTER("wait_while_table_is_used"); DBUG_PRINT("enter", ("table: '%s' share: 0x%lx db_stat: %u version: %lu", table->s->table_name.str, (ulong) table->s, table->db_stat, table->s->version)); + safe_mutex_assert_owner(&LOCK_open); + VOID(table->file->extra(function)); /* Mark all tables that are in use as 'old' */ mysql_lock_abort(thd, table, TRUE); /* end threads waiting on lock */ @@ -3868,6 +3880,8 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table, DBUG_RETURN(send_check_errmsg(thd, table, "restore", "Failed to open partially restored table")); } + /* A MERGE table must not come here. */ + DBUG_ASSERT(!table->table || !table->table->child_l); pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(0); } @@ -3910,6 +3924,10 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, table= &tmp_table; pthread_mutex_unlock(&LOCK_open); } + + /* A MERGE table must not come here. */ + DBUG_ASSERT(!table->child_l); + /* REPAIR TABLE ... USE_FRM for temporary tables makes little sense. */ @@ -4057,13 +4075,16 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); - mysql_ha_flush(thd, tables, MYSQL_HA_CLOSE_FINAL, FALSE); + mysql_ha_rm_tables(thd, tables, FALSE); + for (table= tables; table; table= table->next_local) { char table_name[NAME_LEN*2+2]; char* db = table->db; bool fatal_error=0; + DBUG_PRINT("admin", ("table: '%s'.'%s'", table->db, table->table_name)); + DBUG_PRINT("admin", ("extra_open_options: %u", extra_open_options)); strxmov(table_name, db, ".", table->table_name, NullS); thd->open_options|= extra_open_options; table->lock_type= lock_type; @@ -4094,16 +4115,24 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, table->next_local= save_next_local; thd->open_options&= ~extra_open_options; } + DBUG_PRINT("admin", ("table: 0x%lx", (long) table->table)); + if (prepare_func) { + DBUG_PRINT("admin", ("calling prepare_func")); switch ((*prepare_func)(thd, table, check_opt)) { case 1: // error, message written to net ha_autocommit_or_rollback(thd, 1); close_thread_tables(thd); + DBUG_PRINT("admin", ("simple error, admin next table")); continue; case -1: // error, message could be written to net + /* purecov: begin inspected */ + DBUG_PRINT("admin", ("severe error, stop")); goto err; + /* purecov: end */ default: // should be 0 otherwise + DBUG_PRINT("admin", ("prepare_func succeeded")); ; } } @@ -4118,6 +4147,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, */ if (!table->table) { + DBUG_PRINT("admin", ("open table failed")); if (!thd->warn_list.elements) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_CHECK_NO_SUCH_TABLE, ER(ER_CHECK_NO_SUCH_TABLE)); @@ -4132,14 +4162,17 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (table->view) { + DBUG_PRINT("admin", ("calling view_operator_func")); result_code= (*view_operator_func)(thd, table); goto send_result; } if ((table->table->db_stat & HA_READ_ONLY) && open_for_modify) { + /* purecov: begin inspected */ char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE]; uint length; + DBUG_PRINT("admin", ("sending error message")); protocol->prepare_for_resend(); protocol->store(table_name, system_charset_info); protocol->store(operator_name, system_charset_info); @@ -4154,11 +4187,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (protocol->write()) goto err; continue; + /* purecov: end */ } /* Close all instances of the table to allow repair to rename files */ if (lock_type == TL_WRITE && table->table->s->version) { + DBUG_PRINT("admin", ("removing table from cache")); pthread_mutex_lock(&LOCK_open); const char *old_message=thd->enter_cond(&COND_refresh, &LOCK_open, "Waiting to get writelock"); @@ -4178,6 +4213,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (table->table->s->crashed && operator_func == &handler::ha_check) { + /* purecov: begin inspected */ + DBUG_PRINT("admin", ("sending crashed warning")); protocol->prepare_for_resend(); protocol->store(table_name, system_charset_info); protocol->store(operator_name, system_charset_info); @@ -4186,6 +4223,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, system_charset_info); if (protocol->write()) goto err; + /* purecov: end */ } if (operator_func == &handler::ha_repair && @@ -4196,6 +4234,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, HA_ADMIN_NEEDS_ALTER)) { my_bool save_no_send_ok= thd->net.no_send_ok; + DBUG_PRINT("admin", ("recreating table")); ha_autocommit_or_rollback(thd, 1); close_thread_tables(thd); tmp_disable_binlog(thd); // binlogging is done by caller if wanted @@ -4208,7 +4247,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, } + DBUG_PRINT("admin", ("calling operator_func '%s'", operator_name)); result_code = (table->table->file->*operator_func)(thd, check_opt); + DBUG_PRINT("admin", ("operator_func returned: %d", result_code)); send_result: @@ -5855,8 +5896,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, build_table_filename(reg_path, sizeof(reg_path), db, table_name, reg_ext, 0); build_table_filename(path, sizeof(path), db, table_name, "", 0); - - mysql_ha_flush(thd, table_list, MYSQL_HA_CLOSE_FINAL, FALSE); + mysql_ha_rm_tables(thd, table_list, FALSE); /* DISCARD/IMPORT TABLESPACE is always alone in an ALTER TABLE */ if (alter_info->tablespace_op != NO_TABLESPACE_OP) @@ -5923,10 +5963,25 @@ view_err: start_waiting_global_read_lock(thd); DBUG_RETURN(error); } - if (!(table=open_ltable(thd, table_list, TL_WRITE_ALLOW_READ, 0))) + + if (!(table= open_n_lock_single_table(thd, table_list, TL_WRITE_ALLOW_READ))) DBUG_RETURN(TRUE); table->use_all_columns(); + /* + Prohibit changing of the UNION list of a non-temporary MERGE table + under LOCK tables. It would be quite difficult to reuse a shrinked + set of tables from the old table or to open a new TABLE object for + an extended list and verify that they belong to locked tables. + */ + if (thd->locked_tables && + (create_info->used_fields & HA_CREATE_USED_UNION) && + (table->s->tmp_table == NO_TMP_TABLE)) + { + my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0)); + DBUG_RETURN(TRUE); + } + /* Check that we are not trying to rename to an existing table */ if (new_name) { @@ -6013,7 +6068,8 @@ view_err: goto err; new_db_type= create_info->db_type; - if (new_db_type != old_db_type && + if ((new_db_type != old_db_type || + alter_info->flags & ALTER_PARTITION) && !table->file->can_switch_engines()) { my_error(ER_ROW_IS_REFERENCED, MYF(0)); @@ -6394,6 +6450,7 @@ view_err: goto err; /* Open the table if we need to copy the data. */ + DBUG_PRINT("info", ("need_copy_table: %u", need_copy_table)); if (need_copy_table != ALTER_TABLE_METADATA_ONLY) { if (table->s->tmp_table) @@ -6417,6 +6474,10 @@ view_err: } if (!new_table) goto err1; + /* + Note: In case of MERGE table, we do not attach children. We do not + copy data for MERGE tables. Only the children have data. + */ } /* Copy the data if necessary. */ @@ -6424,6 +6485,10 @@ view_err: thd->cuted_fields=0L; thd->proc_info="copy to tmp table"; copied=deleted=0; + /* + We do not copy data for MERGE tables. Only the children have data. + MERGE tables have HA_NO_COPY_ON_ALTER set. + */ if (new_table && !(new_table->file->ha_table_flags() & HA_NO_COPY_ON_ALTER)) { /* We don't want update TIMESTAMP fields during ALTER TABLE. */ @@ -6561,7 +6626,10 @@ view_err: if (new_table) { - /* Close the intermediate table that will be the new table */ + /* + Close the intermediate table that will be the new table. + Note that MERGE tables do not have their children attached here. + */ intern_close_table(new_table); my_free(new_table,MYF(0)); } @@ -6654,6 +6722,7 @@ view_err: /* Now we have to inform handler that new .FRM file is in place. To do this we need to obtain a handler object for it. + NO need to tamper with MERGE tables. The real open is done later. */ TABLE *t_table; if (new_name != table_name || new_db != db) @@ -6721,7 +6790,7 @@ view_err: /* For the alter table to be properly flushed to the logs, we have to open the new table. If not, we get a problem on server - shutdown. + shutdown. But we do not need to attach MERGE children. */ char path[FN_REFLEN]; TABLE *t_table; @@ -6910,23 +6979,35 @@ copy_data_between_tables(TABLE *from,TABLE *to, if (order) { - from->sort.io_cache=(IO_CACHE*) my_malloc(sizeof(IO_CACHE), - MYF(MY_FAE | MY_ZEROFILL)); - bzero((char*) &tables,sizeof(tables)); - tables.table= from; - tables.alias= tables.table_name= from->s->table_name.str; - tables.db= from->s->db.str; - error=1; + if (to->s->primary_key != MAX_KEY && to->file->primary_key_is_clustered()) + { + char warn_buff[MYSQL_ERRMSG_SIZE]; + my_snprintf(warn_buff, sizeof(warn_buff), + "ORDER BY ignored as there is a user-defined clustered index" + " in the table '%-.192s'", from->s->table_name.str); + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, + warn_buff); + } + else + { + from->sort.io_cache=(IO_CACHE*) my_malloc(sizeof(IO_CACHE), + MYF(MY_FAE | MY_ZEROFILL)); + bzero((char *) &tables, sizeof(tables)); + tables.table= from; + tables.alias= tables.table_name= from->s->table_name.str; + tables.db= from->s->db.str; + error= 1; - if (thd->lex->select_lex.setup_ref_array(thd, order_num) || - setup_order(thd, thd->lex->select_lex.ref_pointer_array, - &tables, fields, all_fields, order) || - !(sortorder=make_unireg_sortorder(order, &length, NULL)) || - (from->sort.found_records = filesort(thd, from, sortorder, length, - (SQL_SELECT *) 0, HA_POS_ERROR, 1, - &examined_rows)) == - HA_POS_ERROR) - goto err; + if (thd->lex->select_lex.setup_ref_array(thd, order_num) || + setup_order(thd, thd->lex->select_lex.ref_pointer_array, + &tables, fields, all_fields, order) || + !(sortorder= make_unireg_sortorder(order, &length, NULL)) || + (from->sort.found_records= filesort(thd, from, sortorder, length, + (SQL_SELECT *) 0, HA_POS_ERROR, + 1, &examined_rows)) == + HA_POS_ERROR) + goto err; + } }; /* Tell handler that we have values for all columns in the to table */ @@ -7051,6 +7132,12 @@ bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list) Alter_info alter_info; DBUG_ENTER("mysql_recreate_table"); + DBUG_ASSERT(!table_list->next_global); + /* + table_list->table has been closed and freed. Do not reference + uninitialized data. open_tables() could fail. + */ + table_list->table= NULL; bzero((char*) &create_info, sizeof(create_info)); create_info.db_type= 0; @@ -7082,6 +7169,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); + /* Open one table after the other to keep lock time as short as possible. */ for (table= tables; table; table= table->next_local) { char table_name[NAME_LEN*2+2]; @@ -7089,7 +7177,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, strxmov(table_name, table->db ,".", table->table_name, NullS); - t= table->table= open_ltable(thd, table, TL_READ, 0); + t= table->table= open_n_lock_single_table(thd, table, TL_READ); thd->clear_error(); // these errors shouldn't get client protocol->prepare_for_resend(); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index ce26b025430..b421f57b7ab 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -323,6 +323,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) TABLE *table; bool result= TRUE; String stmt_query; + bool need_start_waiting= FALSE; DBUG_ENTER("mysql_create_or_drop_trigger"); @@ -374,10 +375,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) /* We don't want perform our operations while global read lock is held so we have to wait until its end and then prevent it from occurring - again until we are done. (Acquiring LOCK_open is not enough because - global read lock is held without holding LOCK_open). + again until we are done, unless we are under lock tables. (Acquiring + LOCK_open is not enough because global read lock is held without holding + LOCK_open). */ - if (wait_if_global_read_lock(thd, 0, 1)) + if (!thd->locked_tables && + !(need_start_waiting= !wait_if_global_read_lock(thd, 0, 1))) DBUG_RETURN(TRUE); VOID(pthread_mutex_lock(&LOCK_open)); @@ -433,16 +436,30 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) goto end; } - if (lock_table_names(thd, tables)) - goto end; - /* We also don't allow creation of triggers on views. */ tables->required_type= FRMTYPE_TABLE; - if (reopen_name_locked_table(thd, tables, TRUE)) + /* Keep consistent with respect to other DDL statements */ + mysql_ha_rm_tables(thd, tables, TRUE); + + if (thd->locked_tables) { - unlock_table_name(thd, tables); - goto end; + /* Table must be write locked */ + if (name_lock_locked_table(thd, tables)) + goto end; + } + else + { + /* Grab the name lock and insert the placeholder*/ + if (lock_table_names(thd, tables)) + goto end; + + /* Convert the placeholder to a real table */ + if (reopen_name_locked_table(thd, tables, TRUE)) + { + unlock_table_name(thd, tables); + goto end; + } } table= tables->table; @@ -462,6 +479,26 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) table->triggers->create_trigger(thd, tables, &stmt_query): table->triggers->drop_trigger(thd, tables, &stmt_query)); + /* Under LOCK TABLES we must reopen the table to activate the trigger. */ + if (!result && thd->locked_tables) + { + /* Make table suitable for reopening */ + close_data_files_and_morph_locks(thd, tables->db, tables->table_name); + thd->in_lock_tables= 1; + if (reopen_tables(thd, 1, 1)) + { + /* To be safe remove this table from the set of LOCKED TABLES */ + unlink_open_table(thd, tables->table, FALSE); + + /* + Ignore reopen_tables errors for now. It's better not leave master/slave + in a inconsistent state. + */ + thd->clear_error(); + } + thd->in_lock_tables= 0; + } + end: if (!result) @@ -470,7 +507,9 @@ end: } VOID(pthread_mutex_unlock(&LOCK_open)); - start_waiting_global_read_lock(thd); + + if (need_start_waiting) + start_waiting_global_read_lock(thd); if (!result) send_ok(thd); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 46022c9f743..ecb7acda61b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -203,6 +203,7 @@ int mysql_update(THD *thd, bool need_reopen; ulonglong id; List<Item> all_fields; + THD::killed_state killed_status= THD::NOT_KILLED; DBUG_ENTER("mysql_update"); for ( ; ; ) @@ -714,45 +715,25 @@ int mysql_update(THD *thd, thd->row_count++; } dup_key_found= 0; - - if (!transactional_table && updated > 0) - thd->transaction.stmt.modified_non_trans_table= TRUE; - - /* - todo bug#27571: to avoid asynchronization of `error' and - `error_code' of binlog event constructor - - The concept, which is a bit different for insert(!), is to - replace `error' assignment with the following lines - - killed_status= thd->killed; // get the status of the volatile - - Notice: thd->killed is type of "state" whereas the lhs has - "status" the suffix which translates according to WordNet: a state - at a particular time - at the time of the end of per-row loop in - our case. Binlogging ops are conducted with the status. - - error= (killed_status == THD::NOT_KILLED)? error : 1; - - which applies to most mysql_$query functions. - Event's constructor will accept `killed_status' as an argument: - - Query_log_event qinfo(..., killed_status); - - thd->killed might be changed after killed_status had got cached and this - won't affect binlogging event but other effects remain. - - Open issue: In a case the error happened not because of KILLED - - and then KILLED was caught later still within the loop - we shall - do something to avoid binlogging of incorrect ER_SERVER_SHUTDOWN - error_code. + Caching the killed status to pass as the arg to query event constuctor; + The cached value can not change whereas the killed status can + (externally) since this point and change of the latter won't affect + binlogging. + It's assumed that if an error was set in combination with an effective + killed status then the error is due to killing. */ - - if (thd->killed && !error) - error= 1; // Aborted - else if (will_batch && - (loc_error= table->file->exec_bulk_update(&dup_key_found))) + killed_status= thd->killed; // get the status of the volatile + // simulated killing after the loop must be ineffective for binlogging + DBUG_EXECUTE_IF("simulate_kill_bug27571", + { + thd->killed= THD::KILL_QUERY; + };); + error= (killed_status == THD::NOT_KILLED)? error : 1; + + if (error && + will_batch && + (loc_error= table->file->exec_bulk_update(&dup_key_found))) /* An error has occurred when a batched update was performed and returned an error indication. It cannot be an allowed duplicate key error since @@ -774,6 +755,10 @@ int mysql_update(THD *thd, if (will_batch) table->file->end_bulk_update(); table->file->try_semi_consistent_read(0); + + if (!transactional_table && updated > 0) + thd->transaction.stmt.modified_non_trans_table= TRUE; + end_read_record(&info); delete select; thd->proc_info= "end"; @@ -797,7 +782,7 @@ int mysql_update(THD *thd, Sometimes we want to binlog even if we updated no rows, in case user used it to be sure master and slave are in same state. */ - if ((error < 0) || (updated && !transactional_table)) + if ((error < 0) || thd->transaction.stmt.modified_non_trans_table) { if (mysql_bin_log.is_open()) { @@ -805,7 +790,7 @@ int mysql_update(THD *thd, thd->clear_error(); if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_table, FALSE) && + transactional_table, FALSE, killed_status) && transactional_table) { error=1; // Rollback update @@ -1215,8 +1200,8 @@ multi_update::multi_update(TABLE_LIST *table_list, :all_tables(table_list), leaves(leaves_list), update_tables(0), tmp_tables(0), updated(0), found(0), fields(field_list), values(value_list), table_count(0), copy_field(0), - handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(0), - transactional_tables(1), ignore(ignore_arg) + handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(1), + transactional_tables(1), ignore(ignore_arg), error_handled(0) {} @@ -1418,7 +1403,6 @@ multi_update::initialize_tables(JOIN *join) if ((thd->options & OPTION_SAFE_UPDATES) && error_if_full_join(join)) DBUG_RETURN(1); main_table=join->join_tab->table; - trans_safe= transactional_tables= main_table->file->has_transactions(); table_to_update= 0; /* Any update has at least one pair (field, value) */ @@ -1713,12 +1697,14 @@ void multi_update::send_error(uint errcode,const char *err) /* First send error what ever it is ... */ my_error(errcode, MYF(0), err); - /* If nothing updated return */ - if (updated == 0) /* the counter might be reset in send_eof */ - return; /* and then the query has been binlogged */ + /* the error was handled or nothing deleted and no side effects return */ + if (error_handled || + !thd->transaction.stmt.modified_non_trans_table && !updated) + return; /* Something already updated so we have to invalidate cache */ - query_cache_invalidate3(thd, update_tables, 1); + if (updated) + query_cache_invalidate3(thd, update_tables, 1); /* If all tables that has been updated are trans safe then just do rollback. If not attempt to do remaining updates. @@ -1750,12 +1736,16 @@ void multi_update::send_error(uint errcode,const char *err) */ if (mysql_bin_log.is_open()) { + /* + THD::killed status might not have been set ON at time of an error + got caught and if happens later the killed error is written + into repl event. + */ thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, transactional_tables, FALSE); } - if (!trans_safe) - thd->transaction.all.modified_non_trans_table= TRUE; + thd->transaction.all.modified_non_trans_table= TRUE; } DBUG_ASSERT(trans_safe || !updated || thd->transaction.stmt.modified_non_trans_table); @@ -1947,11 +1937,20 @@ bool multi_update::send_eof() { char buff[STRING_BUFFER_USUAL_SIZE]; ulonglong id; + THD::killed_state killed_status= THD::NOT_KILLED; DBUG_ENTER("multi_update::send_eof"); thd->proc_info="updating reference tables"; - /* Does updates for the last n - 1 tables, returns 0 if ok */ + /* + Does updates for the last n - 1 tables, returns 0 if ok; + error takes into account killed status gained in do_updates() + */ int local_error = (table_count) ? do_updates(0) : 0; + /* + if local_error is not set ON until after do_updates() then + later carried out killing should not affect binlogging. + */ + killed_status= (local_error == 0)? THD::NOT_KILLED : thd->killed; thd->proc_info= "end"; /* We must invalidate the query cache before binlog writing and @@ -1978,11 +1977,9 @@ bool multi_update::send_eof() { if (local_error == 0) thd->clear_error(); - else - updated= 0; /* if there's an error binlog it here not in ::send_error */ if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_tables, FALSE) && + transactional_tables, FALSE, killed_status) && trans_safe) { local_error= 1; // Rollback update @@ -1991,6 +1988,8 @@ bool multi_update::send_eof() if (thd->transaction.stmt.modified_non_trans_table) thd->transaction.all.modified_non_trans_table= TRUE; } + if (local_error != 0) + error_handled= TRUE; // to force early leave from ::send_error() if (transactional_tables) { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 89e21cc27a5..b4d8bb2dfb8 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -508,10 +508,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %pure_parser /* We have threads */ /* - Currently there are 280 shift/reduce conflicts. + Currently there are 177 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 280 +%expect 177 /* Comments for TOKENS. @@ -1157,7 +1157,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); variable variable_aux bool_pri predicate bit_expr table_wild simple_expr udf_expr - expr_or_default set_expr_or_default interval_expr + expr_or_default set_expr_or_default param_marker geometry_function signed_literal now_or_signed_literal opt_escape sp_opt_default @@ -5439,7 +5439,7 @@ alter_commands: lex->no_write_to_binlog= $3; lex->check_opt.init(); } - opt_no_write_to_binlog opt_mi_check_type + opt_no_write_to_binlog | ANALYZE_SYM PARTITION_SYM opt_no_write_to_binlog all_or_alt_part_name_list { @@ -5448,7 +5448,6 @@ alter_commands: lex->no_write_to_binlog= $3; lex->check_opt.init(); } - opt_mi_check_type | CHECK_SYM PARTITION_SYM all_or_alt_part_name_list { LEX *lex= Lex; @@ -5931,7 +5930,7 @@ analyze: lex->no_write_to_binlog= $2; lex->check_opt.init(); } - table_list opt_mi_check_type + table_list {} ; @@ -5987,7 +5986,7 @@ optimize: lex->no_write_to_binlog= $2; lex->check_opt.init(); } - table_list opt_mi_check_type + table_list {} ; @@ -6570,10 +6569,10 @@ bit_expr: { $$= new Item_func_plus($1,$3); } | bit_expr '-' bit_expr %prec '-' { $$= new Item_func_minus($1,$3); } - | bit_expr '+' interval_expr interval %prec '+' - { $$= new Item_date_add_interval($1,$3,$4,0); } - | bit_expr '-' interval_expr interval %prec '-' - { $$= new Item_date_add_interval($1,$3,$4,1); } + | bit_expr '+' INTERVAL_SYM expr interval %prec '+' + { $$= new Item_date_add_interval($1,$4,$5,0); } + | bit_expr '-' INTERVAL_SYM expr interval %prec '-' + { $$= new Item_date_add_interval($1,$4,$5,1); } | bit_expr '*' bit_expr %prec '*' { $$= new Item_func_mul($1,$3); } | bit_expr '/' bit_expr %prec '/' @@ -6623,11 +6622,6 @@ all_or_any: | ANY_SYM { $$ = 0; } ; -interval_expr: - INTERVAL_SYM expr %prec INTERVAL_SYM - { $$=$2; } - ; - simple_expr: simple_ident | function_call_keyword @@ -6723,18 +6717,9 @@ simple_expr: $$= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(), $3); } - | interval_expr interval '+' expr + | INTERVAL_SYM expr interval '+' expr %prec INTERVAL_SYM /* we cannot put interval before - */ - { $$= new (YYTHD->mem_root) Item_date_add_interval($4,$1,$2,0); } - | interval_expr - { - if ($1->type() != Item::ROW_ITEM) - { - my_parse_error(ER(ER_SYNTAX_ERROR)); - MYSQL_YYABORT; - } - $$= new (YYTHD->mem_root) Item_func_interval((Item_row *)$1); - } + { $$= new (YYTHD->mem_root) Item_date_add_interval($5,$2,$3,0); } ; /* @@ -6751,6 +6736,7 @@ function_call_keyword: | CURRENT_USER optional_braces { $$= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context()); + Lex->set_stmt_unsafe(); Lex->safe_to_cache_query= 0; } | DATE_SYM '(' expr ')' @@ -6761,6 +6747,23 @@ function_call_keyword: { $$= new (YYTHD->mem_root) Item_func_hour($3); } | INSERT '(' expr ',' expr ',' expr ',' expr ')' { $$= new (YYTHD->mem_root) Item_func_insert($3,$5,$7,$9); } + | INTERVAL_SYM '(' expr ',' expr ')' %prec INTERVAL_SYM + { + THD *thd= YYTHD; + List<Item> *list= new (thd->mem_root) List<Item>; + list->push_front($5); + list->push_front($3); + Item_row *item= new (thd->mem_root) Item_row(*list); + $$= new (thd->mem_root) Item_func_interval(item); + } + | INTERVAL_SYM '(' expr ',' expr ',' expr_list ')' %prec INTERVAL_SYM + { + THD *thd= YYTHD; + $7->push_front($5); + $7->push_front($3); + Item_row *item= new (thd->mem_root) Item_row(*$7); + $$= new (thd->mem_root) Item_func_interval(item); + } | LEFT '(' expr ',' expr ')' { $$= new (YYTHD->mem_root) Item_func_left($3,$5); } | MINUTE_SYM '(' expr ')' @@ -6796,6 +6799,7 @@ function_call_keyword: | USER '(' ')' { $$= new (YYTHD->mem_root) Item_func_user(); + Lex->set_stmt_unsafe(); Lex->safe_to_cache_query=0; } | YEAR_SYM '(' expr ')' @@ -6837,10 +6841,10 @@ function_call_nonkeyword: $$= new (YYTHD->mem_root) Item_func_curtime_local($3); Lex->safe_to_cache_query=0; } - | DATE_ADD_INTERVAL '(' expr ',' interval_expr interval ')' - { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$5,$6,0); } - | DATE_SUB_INTERVAL '(' expr ',' interval_expr interval ')' - { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$5,$6,1); } + | DATE_ADD_INTERVAL '(' expr ',' INTERVAL_SYM expr interval ')' %prec INTERVAL_SYM + { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$6,$7,0); } + | DATE_SUB_INTERVAL '(' expr ',' INTERVAL_SYM expr interval ')' %prec INTERVAL_SYM + { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$6,$7,1); } | EXTRACT_SYM '(' interval FROM expr ')' { $$=new (YYTHD->mem_root) Item_extract( $3, $5); } | GET_FORMAT '(' date_time_type ',' expr ')' diff --git a/sql/structs.h b/sql/structs.h index 09a3c4d7285..662d0a680b8 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -71,7 +71,7 @@ typedef struct st_key_part_info { /* Info about a key part */ typedef struct st_key { uint key_length; /* Tot length of key */ - uint flags; /* dupp key and pack flags */ + ulong flags; /* dupp key and pack flags */ uint key_parts; /* How many key_parts */ uint extra_length; uint usable_key_parts; /* Should normally be = key_parts */ diff --git a/sql/table.cc b/sql/table.cc index c30407920f4..0f4c7cb7ba1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -329,6 +329,7 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key, SYNOPSIS init_tmp_table_share() + thd thread handle share Share to fill key Table_cache_key, as generated from create_table_def_key. must start with db name. @@ -346,7 +347,7 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key, use key_length= 0 as neither table_cache_key or key_length will be used). */ -void init_tmp_table_share(TABLE_SHARE *share, const char *key, +void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key, uint key_length, const char *table_name, const char *path) { @@ -373,9 +374,14 @@ void init_tmp_table_share(TABLE_SHARE *share, const char *key, anyway to be able to catch errors. */ share->table_map_version= ~(ulonglong)0; - share->table_map_id= ~0UL; share->cached_row_logging_check= -1; + /* + table_map_id is also used for MERGE tables to suppress repeated + compatibility checks. + */ + share->table_map_id= (ulong) thd->query_id; + DBUG_VOID_RETURN; } @@ -4483,6 +4489,25 @@ void st_table::mark_columns_needed_for_insert() mark_auto_increment_column(); } + +/** + @brief Check if this is part of a MERGE table with attached children. + + @return status + @retval TRUE children are attached + @retval FALSE no MERGE part or children not attached + + @detail + A MERGE table consists of a parent TABLE and zero or more child + TABLEs. Each of these TABLEs is called a part of a MERGE table. +*/ + +bool st_table::is_children_attached(void) +{ + return((child_l && children_attached) || + (parent && parent->children_attached)); +} + /* Cleanup this table for re-execution. diff --git a/sql/table.h b/sql/table.h index 440f3a3d5cf..1e80afdf421 100644 --- a/sql/table.h +++ b/sql/table.h @@ -431,6 +431,12 @@ typedef struct st_table_share { return (table_category == TABLE_CATEGORY_PERFORMANCE); } + + inline ulong get_table_def_version() + { + return table_map_id; + } + } TABLE_SHARE; @@ -455,6 +461,11 @@ struct st_table { #endif struct st_table *next, *prev; + /* For the below MERGE related members see top comment in ha_myisammrg.cc */ + struct st_table *parent; /* Set in MERGE child. Ptr to parent */ + TABLE_LIST *child_l; /* Set in MERGE parent. List of children */ + TABLE_LIST **child_last_l; /* Set in MERGE parent. End of list */ + THD *in_use; /* Which thread uses this */ Field **field; /* Pointer to fields */ @@ -622,6 +633,8 @@ struct st_table { my_bool insert_or_update; /* Can be used by the handler */ my_bool alias_name_used; /* true if table_name is alias */ my_bool get_fields_in_item_tree; /* Signal to fix_field */ + /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */ + my_bool children_attached; REGINFO reginfo; /* field connections */ MEM_ROOT mem_root; @@ -673,6 +686,7 @@ struct st_table { */ inline bool needs_reopen_or_name_lock() { return s->version != refresh_version; } + bool is_children_attached(void); }; enum enum_schema_table_state @@ -996,6 +1010,8 @@ struct TABLE_LIST (non-zero only for merged underlying tables of a view). */ TABLE_LIST *referencing_view; + /* Ptr to parent MERGE table list item. See top comment in ha_myisammrg.cc */ + TABLE_LIST *parent_l; /* Security context (non-zero only for tables which belong to view with SQL SECURITY DEFINER) @@ -1177,6 +1193,20 @@ struct TABLE_LIST */ bool process_index_hints(TABLE *table); + /* Access MERGE child def version. See top comment in ha_myisammrg.cc */ + inline ulong get_child_def_version() + { + return child_def_version; + } + inline void set_child_def_version(ulong version) + { + child_def_version= version; + } + inline void init_child_def_version() + { + child_def_version= ~0UL; + } + private: bool prep_check_option(THD *thd, uint8 check_opt_type); bool prep_where(THD *thd, Item **conds, bool no_where_clause); @@ -1184,6 +1214,9 @@ private: Cleanup for re-execution in a prepared statement or a stored procedure. */ + + /* Remembered MERGE child def version. See top comment in ha_myisammrg.cc */ + ulong child_def_version; }; class Item; diff --git a/sql/unireg.cc b/sql/unireg.cc index f2238d69973..dbdefd8d5b1 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -505,7 +505,7 @@ static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo, int2store(pos+6, key->block_size); pos+=8; key_parts+=key->key_parts; - DBUG_PRINT("loop", ("flags: %d key_parts: %d at 0x%lx", + DBUG_PRINT("loop", ("flags: %lu key_parts: %d at 0x%lx", key->flags, key->key_parts, (long) key->key_part)); for (key_part=key->key_part,key_part_end=key_part+key->key_parts ; diff --git a/storage/archive/azio.c b/storage/archive/azio.c index 2cf0fe114d3..cada6c57918 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -262,7 +262,7 @@ void check_header(azio_stream *s) if (len) s->inbuf[0] = s->stream.next_in[0]; errno = 0; len = (uInt)my_read(s->file, (uchar *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0)); - if (len == 0) s->z_err = Z_ERRNO; + if (len == (uInt)-1) s->z_err = Z_ERRNO; s->stream.avail_in += len; s->stream.next_in = s->inbuf; if (s->stream.avail_in < 2) { diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 6a87b8ecc72..c9fab79a4c5 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -472,14 +472,6 @@ int ha_tina::encode_quote(uchar *buf) const char *ptr; const char *end_ptr; const bool was_null= (*field)->is_null(); - - /* - CSV does not support nulls. ::create() prevents creation of a table - with nullable columns so if we encounter them here, there is a bug. - This may only occur if the frm was created by an older version of - mysqld which permitted table creation with nullable columns. - */ - DBUG_ASSERT(!(*field)->maybe_null()); /* assistance for backwards compatibility in production builds. @@ -1203,8 +1195,8 @@ int ha_tina::rnd_end() The sort is needed when there were updates/deletes with random orders. It sorts so that we move the firts blocks to the beginning. */ - qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set), - (qsort_cmp)sort_set); + my_qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set), + (qsort_cmp)sort_set); off_t write_begin= 0, write_end; @@ -1494,7 +1486,10 @@ int ha_tina::create(const char *name, TABLE *table_arg, for (Field **field= table_arg->s->field; *field; field++) { if ((*field)->real_maybe_null()) - DBUG_RETURN(-1); + { + my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "nullable columns"); + DBUG_RETURN(HA_ERR_UNSUPPORTED); + } } diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c index 7b49a7641af..f3913ed49b7 100644 --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c @@ -881,7 +881,7 @@ buf_LRU_block_free_non_file_page( UT_LIST_ADD_FIRST(free, buf_pool->free, block); block->in_free_list = TRUE; - UNIV_MEM_FREE(block->frame, UNIV_PAGE_SIZE); + UNIV_MEM_ASSERT_AND_FREE(block->frame, UNIV_PAGE_SIZE); if (srv_use_awe && block->frame) { /* Add to the list of mapped pages */ diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 595dfb06ee5..8aba5ac1c85 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -84,16 +84,6 @@ innobase_convert_from_id( ulint len); /* in: length of 'to', in bytes; should be at least 3 * strlen(to) + 1 */ /********************************************************************** -Removes the filename encoding of a table or database name. - -NOTE: the prototype of this function is copied from ha_innodb.cc! If you change -this function, you MUST change also the prototype here! */ -extern -void -innobase_convert_from_filename( -/*===========================*/ - char* s); /* in: identifier; out: decoded identifier */ -/********************************************************************** Compares NUL-terminated UTF-8 strings case insensitively. NOTE: the prototype of this function is copied from ha_innodb.cc! If you change @@ -441,6 +431,8 @@ dict_table_autoinc_initialize( dict_table_t* table, /* in: table */ ib_longlong value) /* in: next value to assign to a row */ { + ut_ad(mutex_own(&table->autoinc_mutex)); + table->autoinc_inited = TRUE; table->autoinc = value; } @@ -457,6 +449,8 @@ dict_table_autoinc_read( { ib_longlong value; + ut_ad(mutex_own(&table->autoinc_mutex)); + if (!table->autoinc_inited) { value = 0; diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index 1ff1fd54cec..f594e64f517 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -551,11 +551,13 @@ dict_load_fields( Loads definitions for table indexes. Adds them to the data dictionary cache. */ static -ibool +ulint dict_load_indexes( /*==============*/ - /* out: TRUE if ok, FALSE if corruption - of dictionary table */ + /* out: DB_SUCCESS if ok, DB_CORRUPTION + if corruption of dictionary table or + DB_UNSUPPORTED if table has unknown index + type */ dict_table_t* table, /* in: table */ mem_heap_t* heap) /* in: memory heap for temporary storage */ { @@ -578,6 +580,7 @@ dict_load_indexes( ibool is_sys_table; dulint id; mtr_t mtr; + ulint error = DB_SUCCESS; ut_ad(mutex_own(&(dict_sys->mutex))); @@ -624,10 +627,8 @@ dict_load_indexes( dict_load_report_deleted_index(table->name, ULINT_UNDEFINED); - btr_pcur_close(&pcur); - mtr_commit(&mtr); - - return(FALSE); + error = DB_CORRUPTION; + goto func_exit; } field = rec_get_nth_field_old(rec, 1, &len); @@ -653,7 +654,18 @@ dict_load_indexes( field = rec_get_nth_field_old(rec, 8, &len); page_no = mach_read_from_4(field); - if (page_no == FIL_NULL) { + /* We check for unsupported types first, so that the + subsequent checks are relevant for the supported types. */ + if (type & ~(DICT_CLUSTERED | DICT_UNIQUE)) { + + fprintf(stderr, + "InnoDB: Error: unknown type %lu" + " of index %s of table %s\n", + (ulong) type, name_buf, table->name); + + error = DB_UNSUPPORTED; + goto func_exit; + } else if (page_no == FIL_NULL) { fprintf(stderr, "InnoDB: Error: trying to load index %s" @@ -661,14 +673,10 @@ dict_load_indexes( "InnoDB: but the index tree has been freed!\n", name_buf, table->name); - btr_pcur_close(&pcur); - mtr_commit(&mtr); - - return(FALSE); - } - - if ((type & DICT_CLUSTERED) == 0 - && NULL == dict_table_get_first_index(table)) { + error = DB_CORRUPTION; + goto func_exit; + } else if ((type & DICT_CLUSTERED) == 0 + && NULL == dict_table_get_first_index(table)) { fprintf(stderr, "InnoDB: Error: trying to load index %s" @@ -677,18 +685,14 @@ dict_load_indexes( " is not clustered!\n", name_buf, table->name); - btr_pcur_close(&pcur); - mtr_commit(&mtr); - - return(FALSE); - } - - if (is_sys_table - && ((type & DICT_CLUSTERED) - || ((table == dict_sys->sys_tables) - && (name_len == (sizeof "ID_IND") - 1) - && (0 == ut_memcmp(name_buf, "ID_IND", - name_len))))) { + error = DB_CORRUPTION; + goto func_exit; + } else if (is_sys_table + && ((type & DICT_CLUSTERED) + || ((table == dict_sys->sys_tables) + && (name_len == (sizeof "ID_IND") - 1) + && (0 == ut_memcmp(name_buf, + "ID_IND", name_len))))) { /* The index was created in memory already at booting of the database server */ @@ -704,10 +708,11 @@ dict_load_indexes( btr_pcur_move_to_next_user_rec(&pcur, &mtr); } +func_exit: btr_pcur_close(&pcur); mtr_commit(&mtr); - return(TRUE); + return(error); } /************************************************************************ @@ -857,11 +862,20 @@ err_exit: mem_heap_empty(heap); - dict_load_indexes(table, heap); - - err = dict_load_foreigns(table->name, TRUE); + err = dict_load_indexes(table, heap); + + /* If the force recovery flag is set, we open the table irrespective + of the error condition, since the user may want to dump data from the + clustered index. However we load the foreign key information only if + all indexes were loaded. */ + if (err != DB_SUCCESS && !srv_force_recovery) { + dict_mem_table_free(table); + table = NULL; + } else if (err == DB_SUCCESS) { + err = dict_load_foreigns(table->name, TRUE); + } #if 0 - if (err != DB_SUCCESS) { + if (err != DB_SUCCESS && table != NULL) { mutex_enter(&dict_foreign_err_mutex); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 783553f5d87..205cfc91e52 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -129,6 +129,7 @@ static my_bool innobase_locks_unsafe_for_binlog = FALSE; static my_bool innobase_rollback_on_timeout = FALSE; static my_bool innobase_create_status_file = FALSE; static my_bool innobase_stats_on_metadata = TRUE; +static my_bool innobase_use_adaptive_hash_indexes = TRUE; static char* internal_innobase_data_file_path = NULL; @@ -678,6 +679,9 @@ convert_error_code_to_mysql( return(HA_ERR_RECORD_FILE_FULL); #endif + } else if (error == DB_UNSUPPORTED) { + + return(HA_ERR_UNSUPPORTED); } else { return(-1); // Unknown error } @@ -801,23 +805,6 @@ innobase_convert_from_id( } /********************************************************************** -Removes the filename encoding of a table or database name. - -NOTE that the exact prototype of this function has to be in -/innobase/dict/dict0dict.c! */ -extern "C" -void -innobase_convert_from_filename( -/*===========================*/ - char* s) /* in: identifier; out: decoded identifier */ -{ - uint errors; - - strconvert(&my_charset_filename, s, - system_charset_info, s, strlen(s), &errors); -} - -/********************************************************************** Compares NUL-terminated UTF-8 strings case insensitively. NOTE that the exact prototype of this function has to be in @@ -1143,7 +1130,6 @@ innobase_query_caching_of_table_permitted( } if (trx->has_search_latch) { - ut_print_timestamp(stderr); sql_print_error("The calling thread is holding the adaptive " "search, latch though calling " "innobase_query_caching_of_table_permitted."); @@ -1246,8 +1232,7 @@ innobase_invalidate_query_cache( } /********************************************************************* -Display an SQL identifier. -This definition must match the one in innobase/ut/ut0ut.c! */ +Display an SQL identifier. */ extern "C" void innobase_print_identifier( @@ -1635,6 +1620,9 @@ innobase_init( srv_stats_on_metadata = (ibool) innobase_stats_on_metadata; + srv_use_adaptive_hash_indexes = + (ibool) innobase_use_adaptive_hash_indexes; + srv_print_verbose_log = mysqld_embedded ? 0 : 1; /* Store the default charset-collation number of this MySQL @@ -2319,14 +2307,18 @@ ha_innobase::open( ib_table = dict_table_get(norm_name, TRUE); if (NULL == ib_table) { - ut_print_timestamp(stderr); - sql_print_error("Cannot find table %s from the internal data " - "dictionary\nof InnoDB though the .frm file " - "for the table exists. Maybe you\nhave " - "deleted and recreated InnoDB data files but " - "have forgotten\nto delete the corresponding " - ".frm files of InnoDB tables, or you\n" - "have moved .frm files to another database?\n" + sql_print_error("Cannot find or open table %s from\n" + "the internal data dictionary of InnoDB " + "though the .frm file for the\n" + "table exists. Maybe you have deleted and " + "recreated InnoDB data\n" + "files but have forgotten to delete the " + "corresponding .frm files\n" + "of InnoDB tables, or you have moved .frm " + "files to another database?\n" + "or, the table contains indexes that this " + "version of the engine\n" + "doesn't support.\n" "See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" "how you can resolve the problem.\n", norm_name); @@ -2338,7 +2330,6 @@ ha_innobase::open( } if (ib_table->ibd_file_missing && !thd_tablespace_op(thd)) { - ut_print_timestamp(stderr); sql_print_error("MySQL is trying to open a table handle but " "the .ibd file for\ntable %s does not exist.\n" "Have you deleted the .ibd file from the " @@ -3412,7 +3403,7 @@ no_commit: /* ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB error: ALTER TABLE is holding lock" + " InnoDB: ALTER TABLE is holding lock" " on %lu tables!\n", prebuilt->trx->mysql_n_tables_locked); */ @@ -3476,6 +3467,7 @@ no_commit: /* Handle duplicate key errors */ if (auto_inc_used) { + ulint err; ulonglong auto_inc; /* Note the number of rows processed for this statement, used @@ -3529,7 +3521,11 @@ set_max_autoinc: ut_a(prebuilt->table->autoinc_increment > 0); auto_inc += prebuilt->table->autoinc_increment; - innobase_set_max_autoinc(auto_inc); + err = innobase_set_max_autoinc(auto_inc); + + if (err != DB_SUCCESS) { + error = (int) err; + } } break; } @@ -3765,7 +3761,7 @@ ha_innobase::update_row( if (auto_inc != 0) { auto_inc += prebuilt->table->autoinc_increment; - innobase_set_max_autoinc(auto_inc); + error = innobase_set_max_autoinc(auto_inc); } } @@ -3952,33 +3948,51 @@ convert_search_mode_to_innobase( enum ha_rkey_function find_flag) { switch (find_flag) { - case HA_READ_KEY_EXACT: return(PAGE_CUR_GE); - /* the above does not require the index to be UNIQUE */ - case HA_READ_KEY_OR_NEXT: return(PAGE_CUR_GE); - case HA_READ_KEY_OR_PREV: return(PAGE_CUR_LE); - case HA_READ_AFTER_KEY: return(PAGE_CUR_G); - case HA_READ_BEFORE_KEY: return(PAGE_CUR_L); - case HA_READ_PREFIX: return(PAGE_CUR_GE); - case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE); - case HA_READ_PREFIX_LAST_OR_PREV:return(PAGE_CUR_LE); - /* In MySQL-4.0 HA_READ_PREFIX and HA_READ_PREFIX_LAST always - pass a complete-field prefix of a key value as the search - tuple. I.e., it is not allowed that the last field would - just contain n first bytes of the full field value. - MySQL uses a 'padding' trick to convert LIKE 'abc%' - type queries so that it can use as a search tuple - a complete-field-prefix of a key value. Thus, the InnoDB - search mode PAGE_CUR_LE_OR_EXTENDS is never used. - TODO: when/if MySQL starts to use also partial-field - prefixes, we have to deal with stripping of spaces - and comparison of non-latin1 char type fields in - innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to - work correctly. */ - - default: assert(0); - } - - return(0); + case HA_READ_KEY_EXACT: + /* this does not require the index to be UNIQUE */ + return(PAGE_CUR_GE); + case HA_READ_KEY_OR_NEXT: + return(PAGE_CUR_GE); + case HA_READ_KEY_OR_PREV: + return(PAGE_CUR_LE); + case HA_READ_AFTER_KEY: + return(PAGE_CUR_G); + case HA_READ_BEFORE_KEY: + return(PAGE_CUR_L); + case HA_READ_PREFIX: + return(PAGE_CUR_GE); + case HA_READ_PREFIX_LAST: + return(PAGE_CUR_LE); + case HA_READ_PREFIX_LAST_OR_PREV: + return(PAGE_CUR_LE); + /* In MySQL-4.0 HA_READ_PREFIX and HA_READ_PREFIX_LAST always + pass a complete-field prefix of a key value as the search + tuple. I.e., it is not allowed that the last field would + just contain n first bytes of the full field value. + MySQL uses a 'padding' trick to convert LIKE 'abc%' + type queries so that it can use as a search tuple + a complete-field-prefix of a key value. Thus, the InnoDB + search mode PAGE_CUR_LE_OR_EXTENDS is never used. + TODO: when/if MySQL starts to use also partial-field + prefixes, we have to deal with stripping of spaces + and comparison of non-latin1 char type fields in + innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to + work correctly. */ + case HA_READ_MBR_CONTAIN: + case HA_READ_MBR_INTERSECT: + case HA_READ_MBR_WITHIN: + case HA_READ_MBR_DISJOINT: + case HA_READ_MBR_EQUAL: + my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0)); + return(PAGE_CUR_UNSUPP); + /* do not use "default:" in order to produce a gcc warning: + enumeration value '...' not handled in switch + (if -Wswitch or -Wall is used) */ + } + + my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality"); + + return(PAGE_CUR_UNSUPP); } /* @@ -4106,11 +4120,18 @@ ha_innobase::index_read( last_match_mode = (uint) match_mode; - innodb_srv_conc_enter_innodb(prebuilt->trx); + if (mode != PAGE_CUR_UNSUPP) { - ret = row_search_for_mysql((byte*) buf, mode, prebuilt, match_mode, 0); + innodb_srv_conc_enter_innodb(prebuilt->trx); - innodb_srv_conc_exit_innodb(prebuilt->trx); + ret = row_search_for_mysql((byte*) buf, mode, prebuilt, + match_mode, 0); + + innodb_srv_conc_exit_innodb(prebuilt->trx); + } else { + + ret = DB_UNSUPPORTED; + } if (ret == DB_SUCCESS) { error = 0; @@ -5460,8 +5481,16 @@ ha_innobase::records_in_range( mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag : HA_READ_KEY_EXACT); - n_rows = btr_estimate_n_rows_in_range(index, range_start, - mode1, range_end, mode2); + if (mode1 != PAGE_CUR_UNSUPP && mode2 != PAGE_CUR_UNSUPP) { + + n_rows = btr_estimate_n_rows_in_range(index, range_start, + mode1, range_end, + mode2); + } else { + + n_rows = 0; + } + dtuple_free_for_mysql(heap1); dtuple_free_for_mysql(heap2); @@ -5710,7 +5739,6 @@ ha_innobase::info( for (i = 0; i < table->s->keys; i++) { if (index == NULL) { - ut_print_timestamp(stderr); sql_print_error("Table %s contains fewer " "indexes inside InnoDB than " "are defined in the MySQL " @@ -5726,7 +5754,6 @@ ha_innobase::info( for (j = 0; j < table->key_info[i].key_parts; j++) { if (j + 1 > index->n_uniq) { - ut_print_timestamp(stderr); sql_print_error( "Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking " "statistics for %lu columns. Have you mixed up .frm files from different " @@ -5791,7 +5818,6 @@ ha_innobase::info( ret = innobase_read_and_init_auto_inc(&auto_inc); if (ret != 0) { - ut_print_timestamp(stderr); sql_print_error("Cannot get table %s auto-inc" "counter value in ::info\n", ib_table->name); @@ -6304,6 +6330,9 @@ ha_innobase::start_stmt( innobase_release_stat_resources(trx); + /* Reset the AUTOINC statement level counter for multi-row INSERTs. */ + trx->n_autoinc_rows = 0; + prebuilt->sql_stat_start = TRUE; prebuilt->hint_need_to_fetch_extra_cols = 0; reset_template(prebuilt); @@ -6446,9 +6475,6 @@ ha_innobase::external_lock( innobase_register_stmt(ht, thd); } - trx->n_mysql_tables_in_use++; - prebuilt->mysql_has_locked = TRUE; - if (trx->isolation_level == TRX_ISO_SERIALIZABLE && prebuilt->select_lock_type == LOCK_NONE && thd_test_options(thd, @@ -6497,6 +6523,9 @@ ha_innobase::external_lock( trx->mysql_n_tables_locked++; } + trx->n_mysql_tables_in_use++; + prebuilt->mysql_has_locked = TRUE; + DBUG_RETURN(0); } @@ -6562,14 +6591,17 @@ ha_innobase::transactional_table_lock( if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) { ut_print_timestamp(stderr); - fprintf(stderr, " InnoDB error:\n" -"MySQL is trying to use a table handle but the .ibd file for\n" -"table %s does not exist.\n" -"Have you deleted the .ibd file from the database directory under\n" -"the MySQL datadir?" -"See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" -"how you can resolve the problem.\n", - prebuilt->table->name); + fprintf(stderr, + " InnoDB: MySQL is trying to use a table handle" + " but the .ibd file for\n" + "InnoDB: table %s does not exist.\n" + "InnoDB: Have you deleted the .ibd file" + " from the database directory under\n" + "InnoDB: the MySQL datadir?" + "InnoDB: See" + " http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n" + "InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); DBUG_RETURN(HA_ERR_CRASHED); } @@ -7120,8 +7152,8 @@ the value of the auto-inc counter. */ int ha_innobase::innobase_read_and_init_auto_inc( /*=========================================*/ - /* out: 0 or error code: - deadlock or lock wait timeout */ + /* out: 0 or generic MySQL + error code */ longlong* value) /* out: the autoinc value */ { longlong auto_inc; @@ -7178,9 +7210,10 @@ ha_innobase::innobase_read_and_init_auto_inc( ++auto_inc; dict_table_autoinc_initialize(innodb_table, auto_inc); } else { - fprintf(stderr, " InnoDB error: Couldn't read the " - "max AUTOINC value from index (%s).\n", - index->name); + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error: (%lu) Couldn't read " + "the max AUTOINC value from the index (%s).\n", + error, index->name); mysql_error = 1; } @@ -7217,6 +7250,11 @@ ha_innobase::innobase_get_auto_increment( { ulong error; + *value = 0; + + /* Note: If the table is not initialized when we attempt the + read below. We initialize the table's auto-inc counter and + always do a reread of the AUTOINC value. */ do { error = innobase_autoinc_lock(); @@ -7256,7 +7294,15 @@ ha_innobase::innobase_get_auto_increment( } else { *value = (ulonglong) autoinc; } + /* A deadlock error during normal processing is OK + and can be ignored. */ + } else if (error != DB_DEADLOCK) { + + sql_print_error("InnoDB: Error: %lu in " + "::innobase_get_auto_increment()", + error); } + } while (*value == 0 && error == DB_SUCCESS); return(error); @@ -7272,7 +7318,7 @@ we have a table-level lock). offset, increment, nb_desired_values are ignored. void ha_innobase::get_auto_increment( -/*=================================*/ +/*============================*/ ulonglong offset, /* in: */ ulonglong increment, /* in: table autoinc increment */ ulonglong nb_desired_values, /* in: number of values reqd */ @@ -7289,13 +7335,6 @@ ha_innobase::get_auto_increment( error = innobase_get_auto_increment(&autoinc); if (error != DB_SUCCESS) { - /* This should never happen in the code > ver 5.0.6, - since we call this function only after the counter - has been initialized. */ - - ut_print_timestamp(stderr); - sql_print_error("Error %lu in ::get_auto_increment()", error); - *first_value = (~(ulonglong) 0); return; } @@ -7310,6 +7349,11 @@ ha_innobase::get_auto_increment( trx = prebuilt->trx; + /* Note: We can't rely on *first_value since some MySQL engines, + in particular the partition engine, don't initialize it to 0 when + invoking this method. So we are not sure if it's guaranteed to + be 0 or not. */ + /* Called for the first time ? */ if (trx->n_autoinc_rows == 0) { @@ -7318,16 +7362,16 @@ ha_innobase::get_auto_increment( /* It's possible for nb_desired_values to be 0: e.g., INSERT INTO T1(C) SELECT C FROM T2; */ if (nb_desired_values == 0) { - + trx->n_autoinc_rows = 1; } - + set_if_bigger(*first_value, autoinc); /* Not in the middle of a mult-row INSERT. */ } else if (prebuilt->last_value == 0) { set_if_bigger(*first_value, autoinc); } - + *nb_reserved_values = trx->n_autoinc_rows; /* With old style AUTOINC locking we only update the table's @@ -7359,7 +7403,9 @@ ha_innobase::get_auto_increment( /* See comment in handler.h */ int -ha_innobase::reset_auto_increment(ulonglong value) +ha_innobase::reset_auto_increment( +/*==============================*/ + ulonglong value) /* in: new value for table autoinc */ { DBUG_ENTER("ha_innobase::reset_auto_increment"); @@ -7923,6 +7969,11 @@ static MYSQL_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata, "Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)", NULL, NULL, TRUE); +static MYSQL_SYSVAR_BOOL(use_adaptive_hash_indexes, innobase_use_adaptive_hash_indexes, + PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, + "Enable the InnoDB adaptive hash indexes (enabled by default)", + NULL, NULL, TRUE); + static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.", @@ -8051,6 +8102,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(open_files), MYSQL_SYSVAR(rollback_on_timeout), MYSQL_SYSVAR(stats_on_metadata), + MYSQL_SYSVAR(use_adaptive_hash_indexes), MYSQL_SYSVAR(status_file), MYSQL_SYSVAR(support_xa), MYSQL_SYSVAR(sync_spin_loops), diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index fe5ebd57990..773884b6584 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -250,17 +250,3 @@ int thd_binlog_format(const MYSQL_THD thd); */ void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all); } - -/* - don't delete it - it may be re-enabled later - as an optimization for the most common case InnoDB+binlog -*/ -#if 0 -int innobase_report_binlog_offset_and_commit( - THD* thd, - void* trx_handle, - char* log_file_name, - my_off_t end_offset); -int innobase_commit_complete(void* trx_handle); -void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset); -#endif diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 44972356304..126fd9fdd33 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -2900,7 +2900,7 @@ dump: ut_print_timestamp(stderr); fprintf(stderr, - "InnoDB: Error: Insert buffer insert" + " InnoDB: Error: Insert buffer insert" " fails; page free %lu," " dtuple size %lu\n", (ulong) page_get_max_insert_size( @@ -2925,7 +2925,7 @@ dump: buf_frame_get_page_no(page), IBUF_BITMAP_FREE, mtr); - fprintf(stderr, "Bitmap bits %lu\n", + fprintf(stderr, "InnoDB: Bitmap bits %lu\n", (ulong) old_bits); fputs("InnoDB: Submit a detailed bug report" diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h index 0aa1b87e470..ed7ce151718 100644 --- a/storage/innobase/include/db0err.h +++ b/storage/innobase/include/db0err.h @@ -61,12 +61,14 @@ Created 5/24/1996 Heikki Tuuri activated by the operation would lead to a duplicate key in some table */ - #define DB_TOO_MANY_CONCURRENT_TRXS 47 /* when InnoDB runs out of the preconfigured undo slots, this can only happen when there are too many concurrent transactions */ - +#define DB_UNSUPPORTED 48 /* when InnoDB sees any artefact or + a feature that it can't recoginize or + work with e.g., FT indexes created by + a later version of the engine. */ /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 7fb50988941..ef0722321af 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -1,6 +1,8 @@ #ifndef HA_INNODB_PROTOTYPES_H #define HA_INNODB_PROTOTYPES_H +#ifndef UNIV_HOTBACKUP + #include "univ.i" /* ulint, uint */ #include "m_ctype.h" /* CHARSET_INFO */ @@ -22,6 +24,19 @@ innobase_convert_string( CHARSET_INFO* from_cs, uint* errors); +/********************************************************************* +Display an SQL identifier. */ + +void +innobase_print_identifier( +/*======================*/ + FILE* f, /* in: output stream */ + trx_t* trx, /* in: transaction */ + ibool table_id,/* in: TRUE=print a table name, + FALSE=print other identifier */ + const char* name, /* in: name to print */ + ulint namelen);/* in: length of name */ + /********************************************************************** Returns true if the thread is the replication thread on the slave server. Used in srv_conc_enter_innodb() to determine if the thread @@ -49,3 +64,4 @@ thd_has_edited_nontrans_tables( void* thd); /* in: thread handle (THD*) */ #endif +#endif diff --git a/storage/innobase/include/mach0data.h b/storage/innobase/include/mach0data.h index 8377114a723..37d862cc678 100644 --- a/storage/innobase/include/mach0data.h +++ b/storage/innobase/include/mach0data.h @@ -327,6 +327,17 @@ mach_write_to_2_little_endian( byte* dest, /* in: where to write */ ulint n); /* in: unsigned long int to write */ +/************************************************************* +Convert integral type from storage byte order (big endian) to +host byte order. */ +UNIV_INLINE +void +mach_read_int_type( +/*===============*/ + byte* dest, /* out: where to write */ + const byte* src, /* in: where to read from */ + ulint len, /* in: length of src */ + ibool unsigned_type); /* in: signed or unsigned flag */ #ifndef UNIV_NONINL #include "mach0data.ic" #endif diff --git a/storage/innobase/include/mach0data.ic b/storage/innobase/include/mach0data.ic index 03ece7529a8..64fb87f56ed 100644 --- a/storage/innobase/include/mach0data.ic +++ b/storage/innobase/include/mach0data.ic @@ -7,6 +7,8 @@ to the machine format. Created 11/28/1995 Heikki Tuuri ***********************************************************************/ +#include "ut0mem.h" + /*********************************************************** The following function is used to store data in one byte. */ UNIV_INLINE @@ -689,3 +691,38 @@ mach_write_to_2_little_endian( *dest = (byte)(n & 0xFFUL); } + +/************************************************************* +Convert integral type from storage byte order (big endian) to +host byte order. */ +UNIV_INLINE +void +mach_read_int_type( +/*===============*/ + byte* dest, /* out: where to write */ + const byte* src, /* in: where to read from */ + ulint len, /* in: length of src */ + ibool unsigned_type) /* in: signed or unsigned flag */ +{ +#ifdef WORDS_BIGENDIAN + memcpy(dest, src, len); + + if (!unsigned_type) { + dest[0] ^= 128; + } +#else + byte* ptr; + + /* Convert integer data from Innobase to a little-endian format, + sign bit restored to normal. */ + + for (ptr = dest + len; ptr != dest; ++src) { + --ptr; + *ptr = *src; + } + + if (!unsigned_type) { + dest[len - 1] ^= 128; + } +#endif +} diff --git a/storage/innobase/include/mem0dbg.h b/storage/innobase/include/mem0dbg.h index 36cd7a89565..2393e4edb54 100644 --- a/storage/innobase/include/mem0dbg.h +++ b/storage/innobase/include/mem0dbg.h @@ -60,6 +60,14 @@ mem_heap_validate_or_print( ulint* n_blocks); /* out: number of blocks in the heap, if a NULL pointer is passed as this argument, it is ignored */ +/****************************************************************** +Validates the contents of a memory heap. */ + +ibool +mem_heap_validate( +/*==============*/ + /* out: TRUE if ok */ + mem_heap_t* heap); /* in: memory heap */ #endif /* UNIV_MEM_DEBUG || UNIV_DEBUG */ #ifdef UNIV_DEBUG /****************************************************************** @@ -71,14 +79,6 @@ mem_heap_check( /* out: TRUE if ok */ mem_heap_t* heap); /* in: memory heap */ #endif /* UNIV_DEBUG */ -/****************************************************************** -Validates the contents of a memory heap. */ - -ibool -mem_heap_validate( -/*==============*/ - /* out: TRUE if ok */ - mem_heap_t* heap); /* in: memory heap */ #ifdef UNIV_MEM_DEBUG /********************************************************************* TRUE if no memory is currently allocated. */ diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic index adae9ad8a33..6227a27f277 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.ic @@ -271,19 +271,16 @@ mem_heap_free_heap_top( ut_ad(mem_block_get_start(block) <= mem_block_get_free(block)); /* In the debug version erase block from top up */ - { - ulint len = (byte*)block + block->len - old_top; - mem_erase_buf(old_top, len); - UNIV_MEM_FREE(old_top, len); - } + mem_erase_buf(old_top, (byte*)block + block->len - old_top); /* Update allocated memory count */ mutex_enter(&mem_hash_mutex); mem_current_allocated_memory -= (total_size - size); mutex_exit(&mem_hash_mutex); #else /* UNIV_MEM_DEBUG */ - UNIV_MEM_FREE(old_top, (byte*)block + block->len - old_top); + UNIV_MEM_ASSERT_W(old_top, (byte*)block + block->len - old_top); #endif /* UNIV_MEM_DEBUG */ + UNIV_MEM_ALLOC(old_top, (byte*)block + block->len - old_top); /* If free == start, we may free the block if it is not the first one */ @@ -363,6 +360,7 @@ mem_heap_free_top( /* Subtract the free field of block */ mem_block_set_free(block, mem_block_get_free(block) - MEM_SPACE_NEEDED(n)); + UNIV_MEM_ASSERT_W((byte*) block + mem_block_get_free(block), n); #ifdef UNIV_MEM_DEBUG ut_ad(mem_block_get_start(block) <= mem_block_get_free(block)); @@ -378,7 +376,11 @@ mem_heap_free_top( == mem_block_get_start(block))) { mem_heap_block_free(heap, block); } else { - UNIV_MEM_FREE((byte*) block + mem_block_get_free(block), n); + /* Avoid a bogus UNIV_MEM_ASSERT_W() warning in a + subsequent invocation of mem_heap_free_top(). + Originally, this was UNIV_MEM_FREE(), to catch writes + to freed memory. */ + UNIV_MEM_ALLOC((byte*) block + mem_block_get_free(block), n); } } diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h index 36370201d9b..04f731414a3 100644 --- a/storage/innobase/include/page0cur.h +++ b/storage/innobase/include/page0cur.h @@ -22,6 +22,7 @@ Created 10/4/1994 Heikki Tuuri /* Page cursor search modes; the values must be in this order! */ +#define PAGE_CUR_UNSUPP 0 #define PAGE_CUR_G 1 #define PAGE_CUR_GE 2 #define PAGE_CUR_L 3 diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index 95aa65fabba..5a4a0a0b5df 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -801,6 +801,7 @@ rec_offs_set_n_alloc( { ut_ad(offsets); ut_ad(n_alloc > 0); + UNIV_MEM_ASSERT_AND_ALLOC(offsets, n_alloc * sizeof *offsets); offsets[0] = n_alloc; } diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index aabb7f5f047..fd7ec8918ee 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -319,9 +319,11 @@ row_mysql_unfreeze_data_dictionary( /*===============================*/ trx_t* trx); /* in: transaction */ /************************************************************************* -Does a table creation operation for MySQL. If the name of the created -table ends to characters INNODB_MONITOR, then this also starts -printing of monitor output by the master thread. */ +Drops a table for MySQL. If the name of the table ends in +one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", +"innodb_table_monitor", then this will also start the printing of monitor +output by the master thread. If the table name ends in "innodb_mem_validate", +InnoDB will try to invoke mem_validate(). */ int row_create_table_for_mysql( @@ -399,8 +401,9 @@ row_truncate_table_for_mysql( dict_table_t* table, /* in: table handle */ trx_t* trx); /* in: transaction handle */ /************************************************************************* -Drops a table for MySQL. If the name of the dropped table ends to -characters INNODB_MONITOR, then this also stops printing of monitor +Drops a table for MySQL. If the name of the dropped table ends in +one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", +"innodb_table_monitor", then this will also stop the printing of monitor output by the master thread. */ int diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h index abf04253141..7d2f63803d0 100644 --- a/storage/innobase/include/sync0rw.h +++ b/storage/innobase/include/sync0rw.h @@ -101,6 +101,7 @@ void rw_lock_free( /*=========*/ rw_lock_t* lock); /* in: rw-lock */ +#ifdef UNIV_DEBUG /********************************************************************** Checks that the rw-lock has been initialized and that there are no simultaneous shared and exclusive locks. */ @@ -109,6 +110,7 @@ ibool rw_lock_validate( /*=============*/ rw_lock_t* lock); +#endif /* UNIV_DEBUG */ /****************************************************************** NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index ba8e6e56219..8163ae16e4e 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -308,11 +308,39 @@ typedef void* os_thread_ret_t; # define UNIV_MEM_INVALID(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size) # define UNIV_MEM_FREE(addr, size) VALGRIND_MAKE_MEM_NOACCESS(addr, size) # define UNIV_MEM_ALLOC(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size) +# define UNIV_MEM_ASSERT_RW(addr, size) do { \ + const void* _p = (const void*) (ulint) \ + VALGRIND_CHECK_MEM_IS_DEFINED(addr, size); \ + if (UNIV_LIKELY_NULL(_p)) \ + fprintf(stderr, "%s:%d: %p[%u] undefined at %ld\n", \ + __FILE__, __LINE__, \ + (const void*) (addr), (unsigned) (size), (long) \ + (((const char*) _p) - ((const char*) (addr)))); \ + } while (0) +# define UNIV_MEM_ASSERT_W(addr, size) do { \ + const void* _p = (const void*) (ulint) \ + VALGRIND_CHECK_MEM_IS_ADDRESSABLE(addr, size); \ + if (UNIV_LIKELY_NULL(_p)) \ + fprintf(stderr, "%s:%d: %p[%u] unwritable at %ld\n", \ + __FILE__, __LINE__, \ + (const void*) (addr), (unsigned) (size), (long) \ + (((const char*) _p) - ((const char*) (addr)))); \ + } while (0) #else # define UNIV_MEM_VALID(addr, size) do {} while(0) # define UNIV_MEM_INVALID(addr, size) do {} while(0) # define UNIV_MEM_FREE(addr, size) do {} while(0) # define UNIV_MEM_ALLOC(addr, size) do {} while(0) +# define UNIV_MEM_ASSERT_RW(addr, size) do {} while(0) +# define UNIV_MEM_ASSERT_W(addr, size) do {} while(0) #endif +#define UNIV_MEM_ASSERT_AND_FREE(addr, size) do { \ + UNIV_MEM_ASSERT_W(addr, size); \ + UNIV_MEM_FREE(addr, size); \ +} while (0) +#define UNIV_MEM_ASSERT_AND_ALLOC(addr, size) do { \ + UNIV_MEM_ASSERT_W(addr, size); \ + UNIV_MEM_ALLOC(addr, size); \ +} while (0) #endif diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 825c10d5f11..a60ce73c35a 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -263,6 +263,24 @@ ut_copy_file( FILE* dest, /* in: output file */ FILE* src); /* in: input file to be appended to output */ +/************************************************************************** +snprintf(). */ + +#ifdef __WIN__ +int +ut_snprintf( + /* out: number of characters that would + have been printed if the size were + unlimited, not including the terminating + '\0'. */ + char* str, /* out: string */ + size_t size, /* in: str size */ + const char* fmt, /* in: format */ + ...); /* in: format values */ +#else +#define ut_snprintf snprintf +#endif /* __WIN__ */ + #ifndef UNIV_NONINL #include "ut0ut.ic" #endif diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c index eb77dd01f6d..72452907c3f 100644 --- a/storage/innobase/mem/mem0dbg.c +++ b/storage/innobase/mem/mem0dbg.c @@ -223,6 +223,8 @@ mem_init_buf( { byte* ptr; + UNIV_MEM_ASSERT_W(buf, n); + for (ptr = buf; ptr < buf + n; ptr++) { if (ut_rnd_gen_ibool()) { @@ -231,6 +233,8 @@ mem_init_buf( *ptr = 0xBE; } } + + UNIV_MEM_INVALID(buf, n); } /******************************************************************* @@ -245,6 +249,8 @@ mem_erase_buf( { byte* ptr; + UNIV_MEM_ASSERT_W(buf, n); + for (ptr = buf; ptr < buf + n; ptr++) { if (ut_rnd_gen_ibool()) { *ptr = 0xDE; @@ -252,6 +258,8 @@ mem_erase_buf( *ptr = 0xAD; } } + + UNIV_MEM_FREE(buf, n); } /******************************************************************* @@ -546,9 +554,7 @@ completed: } *error = FALSE; } -#endif /* UNIV_MEM_DEBUG || UNIV_DEBUG */ -#ifdef UNIV_DEBUG /****************************************************************** Prints the contents of a memory heap. */ static @@ -575,20 +581,6 @@ mem_heap_print( } /****************************************************************** -Checks that an object is a memory heap (or a block of it). */ - -ibool -mem_heap_check( -/*===========*/ - /* out: TRUE if ok */ - mem_heap_t* heap) /* in: memory heap */ -{ - ut_a(heap->magic_n == MEM_BLOCK_MAGIC_N); - - return(TRUE); -} - -/****************************************************************** Validates the contents of a memory heap. */ ibool @@ -614,6 +606,22 @@ mem_heap_validate( return(TRUE); } +#endif /* UNIV_MEM_DEBUG || UNIV_DEBUG */ + +#ifdef UNIV_DEBUG +/****************************************************************** +Checks that an object is a memory heap (or a block of it). */ + +ibool +mem_heap_check( +/*===========*/ + /* out: TRUE if ok */ + mem_heap_t* heap) /* in: memory heap */ +{ + ut_a(heap->magic_n == MEM_BLOCK_MAGIC_N); + + return(TRUE); +} #endif /* UNIV_DEBUG */ #ifdef UNIV_MEM_DEBUG diff --git a/storage/innobase/mem/mem0mem.c b/storage/innobase/mem/mem0mem.c index d89a3a55d88..f4fd178a39c 100644 --- a/storage/innobase/mem/mem0mem.c +++ b/storage/innobase/mem/mem0mem.c @@ -512,9 +512,9 @@ mem_heap_block_free( of hex 0xDE and 0xAD. */ mem_erase_buf((byte*)block, len); - -#endif - UNIV_MEM_FREE(block, len); +#else /* UNIV_MEM_DEBUG */ + UNIV_MEM_ASSERT_AND_FREE(block, len); +#endif /* UNIV_MEM_DEBUG */ if (init_block) { /* Do not have to free: do nothing */ diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index b8d201e3da2..b3cf20b78b8 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -1728,10 +1728,11 @@ row_mysql_unlock_data_dictionary( } /************************************************************************* -Does a table creation operation for MySQL. If the name of the table -to be created is equal with one of the predefined magic table names, -then this also starts printing the corresponding monitor output by -the master thread. */ +Drops a table for MySQL. If the name of the table ends in +one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", +"innodb_table_monitor", then this will also start the printing of monitor +output by the master thread. If the table name ends in "innodb_mem_validate", +InnoDB will try to invoke mem_validate(). */ int row_create_table_for_mysql( @@ -1756,13 +1757,11 @@ row_create_table_for_mysql( ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH); if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" - "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", - stderr); + fputs("InnoDB: A new raw disk partition was initialized:\n" + "InnoDB: we do not allow database modifications" + " by the user.\n" + "InnoDB: Shut down mysqld and edit my.cnf so that newraw" + " is replaced with raw.\n", stderr); dict_mem_table_free(table); trx_commit_for_mysql(trx); @@ -2703,13 +2702,11 @@ row_truncate_table_for_mysql( ut_ad(table); if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" - "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", - stderr); + fputs("InnoDB: A new raw disk partition was initialized:\n" + "InnoDB: we do not allow database modifications" + " by the user.\n" + "InnoDB: Shut down mysqld and edit my.cnf so that newraw" + " is replaced with raw.\n", stderr); return(DB_ERROR); } @@ -2898,7 +2895,9 @@ next_rec: /* MySQL calls ha_innobase::reset_auto_increment() which does the same thing. */ + dict_table_autoinc_lock(table); dict_table_autoinc_initialize(table, 0); + dict_table_autoinc_unlock(table); dict_update_statistics(table); trx_commit_for_mysql(trx); @@ -2916,9 +2915,10 @@ funct_exit: #endif /* !UNIV_HOTBACKUP */ /************************************************************************* -Drops a table for MySQL. If the name of the table to be dropped is equal -with one of the predefined magic table names, then this also stops printing -the corresponding monitor output by the master thread. */ +Drops a table for MySQL. If the name of the dropped table ends in +one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", +"innodb_table_monitor", then this will also stop the printing of monitor +output by the master thread. */ int row_drop_table_for_mysql( @@ -2934,21 +2934,17 @@ row_drop_table_for_mysql( ulint err; const char* table_name; ulint namelen; - char* dir_path_of_temp_table = NULL; - ibool success; ibool locked_dictionary = FALSE; pars_info_t* info = NULL; ut_a(name != NULL); if (srv_created_new_raw) { - fputs("InnoDB: A new raw disk partition was initialized or\n" - "InnoDB: innodb_force_recovery is on: we do not allow\n" - "InnoDB: database modifications by the user. Shut down\n" - "InnoDB: mysqld and edit my.cnf so that newraw" - " is replaced\n" - "InnoDB: with raw, and innodb_force_... is removed.\n", - stderr); + fputs("InnoDB: A new raw disk partition was initialized:\n" + "InnoDB: we do not allow database modifications" + " by the user.\n" + "InnoDB: Shut down mysqld and edit my.cnf so that newraw" + " is replaced with raw.\n", stderr); return(DB_ERROR); } @@ -3232,14 +3228,20 @@ check_next_foreign: } else { ibool is_path; const char* name_or_path; + mem_heap_t* heap; + heap = mem_heap_create(200); + + /* Clone the name, in case it has been allocated + from table->heap, which will be freed by + dict_table_remove_from_cache(table) below. */ + name = mem_heap_strdup(heap, name); space_id = table->space; if (table->dir_path_of_temp_table != NULL) { - dir_path_of_temp_table = mem_strdup( - table->dir_path_of_temp_table); is_path = TRUE; - name_or_path = dir_path_of_temp_table; + name_or_path = mem_heap_strdup( + heap, table->dir_path_of_temp_table); } else { is_path = FALSE; name_or_path = name; @@ -3272,13 +3274,7 @@ check_next_foreign: "InnoDB: of table "); ut_print_name(stderr, trx, TRUE, name); fprintf(stderr, ".\n"); - - goto funct_exit; - } - - success = fil_delete_tablespace(space_id); - - if (!success) { + } else if (!fil_delete_tablespace(space_id)) { fprintf(stderr, "InnoDB: We removed now the InnoDB" " internal data dictionary entry\n" @@ -3296,6 +3292,8 @@ check_next_foreign: err = DB_ERROR; } } + + mem_heap_free(heap); } funct_exit: @@ -3305,10 +3303,6 @@ funct_exit: row_mysql_unlock_data_dictionary(trx); } - if (dir_path_of_temp_table) { - mem_free(dir_path_of_temp_table); - } - trx->op_info = ""; #ifndef UNIV_HOTBACKUP diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index fdf6aa46351..29bded114e0 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -531,12 +531,13 @@ row_sel_build_prev_vers( /*====================*/ /* out: DB_SUCCESS or error code */ read_view_t* read_view, /* in: read view */ - plan_t* plan, /* in: plan node for table */ + dict_index_t* index, /* in: plan node for table */ rec_t* rec, /* in: record in a clustered index */ ulint** offsets, /* in/out: offsets returned by rec_get_offsets(rec, plan->index) */ mem_heap_t** offset_heap, /* in/out: memory heap from which the offsets are allocated */ + mem_heap_t** old_vers_heap, /* out: old version heap to use */ rec_t** old_vers, /* out: old version, or NULL if the record does not exist in the view: i.e., it was freshly inserted @@ -545,15 +546,15 @@ row_sel_build_prev_vers( { ulint err; - if (plan->old_vers_heap) { - mem_heap_empty(plan->old_vers_heap); + if (*old_vers_heap) { + mem_heap_empty(*old_vers_heap); } else { - plan->old_vers_heap = mem_heap_create(512); + *old_vers_heap = mem_heap_create(512); } err = row_vers_build_for_consistent_read( - rec, mtr, plan->index, offsets, read_view, offset_heap, - plan->old_vers_heap, old_vers); + rec, mtr, index, offsets, read_view, offset_heap, + *old_vers_heap, old_vers); return(err); } @@ -765,9 +766,11 @@ row_sel_get_clust_rec( if (!lock_clust_rec_cons_read_sees(clust_rec, index, offsets, node->read_view)) { - err = row_sel_build_prev_vers(node->read_view, plan, - clust_rec, &offsets, - &heap, &old_vers, mtr); + err = row_sel_build_prev_vers( + node->read_view, index, clust_rec, + &offsets, &heap, &plan->old_vers_heap, + &old_vers, mtr); + if (err != DB_SUCCESS) { goto err_exit; @@ -1490,10 +1493,11 @@ skip_lock: if (!lock_clust_rec_cons_read_sees(rec, index, offsets, node->read_view)) { - err = row_sel_build_prev_vers(node->read_view, - plan, rec, - &offsets, &heap, - &old_vers, &mtr); + err = row_sel_build_prev_vers( + node->read_view, index, rec, + &offsets, &heap, &plan->old_vers_heap, + &old_vers, &mtr); + if (err != DB_SUCCESS) { goto lock_wait_or_error; @@ -3999,6 +4003,7 @@ no_gap_lock: mutex_enter(&kernel_mutex); if (trx->was_chosen_as_deadlock_victim) { mutex_exit(&kernel_mutex); + err = DB_DEADLOCK; goto lock_wait_or_error; } @@ -4521,7 +4526,8 @@ row_search_check_if_query_cache_permitted( } /*********************************************************************** -Read the AUTOINC column from the current row. */ +Read the AUTOINC column from the current row. If the value is less than +0 and the type is not unsigned then we reset the value to 0. */ static ib_longlong row_search_autoinc_read_column( @@ -4536,6 +4542,7 @@ row_search_autoinc_read_column( const byte* data; ib_longlong value; mem_heap_t* heap = NULL; + /* Our requirement is that dest should be word aligned. */ byte dest[sizeof(value)]; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; @@ -4554,26 +4561,43 @@ row_search_autoinc_read_column( ut_a(len != UNIV_SQL_NULL); ut_a(len <= sizeof value); - /* Copy integer data and restore sign bit */ - if (unsigned_type || (data[0] & 128)) - memset(dest, 0x00, sizeof(dest)); - else - memset(dest, 0xff, sizeof(dest)); + mach_read_int_type(dest, data, len, unsigned_type); + + /* The assumption here is that the AUTOINC value can't be negative + and that dest is word aligned. */ + switch (len) { + case 8: + value = *(ib_longlong*) dest; + break; + + case 4: + value = *(ib_uint32_t*) dest; + break; - memcpy(dest + (sizeof(value) - len), data, len); + case 3: + value = *(ib_uint32_t*) dest; + value &= 0xFFFFFF; + break; - if (!unsigned_type) - dest[sizeof(value) - len] ^= 128; + case 2: + value = *(uint16 *) dest; + break; - /* The assumption here is that the AUTOINC value can't be negative.*/ - value = (((ib_longlong) mach_read_from_4(dest)) << 32) | - ((ib_longlong) mach_read_from_4(dest + 4)); + case 1: + value = *dest; + break; + + default: + ut_error; + } if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } - ut_a(value >= 0); + if (!unsigned_type && value < 0) { + value = 0; + } return(value); } diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 4db780c8b3f..8dbc69816e9 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -174,9 +174,7 @@ rw_lock_free( /*=========*/ rw_lock_t* lock) /* in: rw-lock */ { -#ifdef UNIV_DEBUG - ut_a(rw_lock_validate(lock)); -#endif /* UNIV_DEBUG */ + ut_ad(rw_lock_validate(lock)); ut_a(rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED); ut_a(rw_lock_get_waiters(lock) == 0); ut_a(rw_lock_get_reader_count(lock) == 0); @@ -199,6 +197,7 @@ rw_lock_free( mutex_exit(&rw_lock_list_mutex); } +#ifdef UNIV_DEBUG /********************************************************************** Checks that the rw-lock has been initialized and that there are no simultaneous shared and exclusive locks. */ @@ -226,6 +225,7 @@ rw_lock_validate( return(TRUE); } +#endif /* UNIV_DEBUG */ /********************************************************************** Lock an rw-lock in shared mode for the current thread. If the rw-lock is diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c index bf3f4d1ff20..39872f72204 100644 --- a/storage/innobase/sync/sync0sync.c +++ b/storage/innobase/sync/sync0sync.c @@ -830,7 +830,7 @@ sync_thread_levels_g( mutex = slot->latch; fprintf(stderr, - "InnoDB error: sync levels should be" + "InnoDB: sync levels should be" " > %lu but a level is %lu\n", (ulong) limit, (ulong) slot->level); diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c index 389063ad821..1ca278cd633 100644 --- a/storage/innobase/ut/ut0ut.c +++ b/storage/innobase/ut/ut0ut.c @@ -18,6 +18,7 @@ Created 5/11/1994 Heikki Tuuri #include "ut0sort.h" #include "trx0trx.h" +#include "ha_prototypes.h" ibool ut_always_false = FALSE; @@ -70,22 +71,6 @@ ut_gettimeofday( #define ut_gettimeofday gettimeofday #endif -#ifndef UNIV_HOTBACKUP -/********************************************************************* -Display an SQL identifier. -This definition must match the one in sql/ha_innodb.cc! */ -extern -void -innobase_print_identifier( -/*======================*/ - FILE* f, /* in: output stream */ - trx_t* trx, /* in: transaction */ - ibool table_id,/* in: TRUE=print a table name, - FALSE=print other identifier */ - const char* name, /* in: name to print */ - ulint namelen);/* in: length of name */ -#endif /* !UNIV_HOTBACKUP */ - /************************************************************ Gets the high 32 bits in a ulint. That is makes a shift >> 32, but since there seem to be compiler bugs in both gcc and Visual C++, @@ -360,6 +345,8 @@ ut_print_buf( const byte* data; ulint i; + UNIV_MEM_ASSERT_RW(buf, len); + fprintf(file, " len %lu; hex ", len); for (data = (const byte*)buf, i = 0; i < len; i++) { @@ -474,17 +461,20 @@ ut_print_namel( #ifdef UNIV_HOTBACKUP fwrite(name, 1, namelen, f); #else - char* slash = memchr(name, '/', namelen); + if (table_id) { + char* slash = memchr(name, '/', namelen); + if (!slash) { - if (UNIV_LIKELY_NULL(slash)) { - /* Print the database name and table name separately. */ - ut_ad(table_id); + goto no_db_name; + } + /* Print the database name and table name separately. */ innobase_print_identifier(f, trx, TRUE, name, slash - name); putc('.', f); innobase_print_identifier(f, trx, TRUE, slash + 1, namelen - (slash - name) - 1); } else { +no_db_name: innobase_print_identifier(f, trx, table_id, name, namelen); } #endif @@ -515,3 +505,44 @@ ut_copy_file( } } while (len > 0); } + +/************************************************************************** +snprintf(). */ + +#ifdef __WIN__ +#include <stdarg.h> +int +ut_snprintf( + /* out: number of characters that would + have been printed if the size were + unlimited, not including the terminating + '\0'. */ + char* str, /* out: string */ + size_t size, /* in: str size */ + const char* fmt, /* in: format */ + ...) /* in: format values */ +{ + int res; + va_list ap1; + va_list ap2; + + va_start(ap1, fmt); + va_start(ap2, fmt); + + res = _vscprintf(fmt, ap1); + ut_a(res != -1); + + if (size > 0) { + _vsnprintf(str, size, fmt, ap2); + + if ((size_t) res >= size) { + str[size - 1] = '\0'; + } + } + + va_end(ap1); + va_end(ap2); + + return(res); +} +#endif /* __WIN__ */ diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 15f4e1e1d34..5e7a955793f 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -576,8 +576,8 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query, ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root, sizeof(FTB_WORD *)*ftb->queue.elements); memcpy(ftb->list, ftb->queue.root+1, sizeof(FTB_WORD *)*ftb->queue.elements); - qsort2(ftb->list, ftb->queue.elements, sizeof(FTB_WORD *), - (qsort2_cmp)FTB_WORD_cmp_list, ftb->charset); + my_qsort2(ftb->list, ftb->queue.elements, sizeof(FTB_WORD *), + (qsort2_cmp)FTB_WORD_cmp_list, ftb->charset); if (ftb->queue.elements<2) ftb->with_scan &= ~FTB_FLAG_TRUNC; ftb->state=READY; return ftb; diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index 282fa6751d8..8df8c2da4eb 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -294,7 +294,8 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query, &dptr, left_root_right); if (flags & FT_SORTED) - qsort2(dlist->doc, dlist->ndocs, sizeof(FT_DOC), (qsort2_cmp)&FT_DOC_cmp, 0); + my_qsort2(dlist->doc, dlist->ndocs, sizeof(FT_DOC), (qsort2_cmp)&FT_DOC_cmp, + 0); err: delete_tree(&aio.dtree); diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index be966e90de4..9d7f2d4b90d 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -119,6 +119,10 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type, definition for further use in mi_create or for a check for underlying table conformance in merge engine. + The caller needs to free *recinfo_out after use. Since *recinfo_out + and *keydef_out are allocated with a my_multi_malloc, *keydef_out + is freed automatically when *recinfo_out is freed. + RETURN VALUE 0 OK !0 error code @@ -149,7 +153,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out, pos= table_arg->key_info; for (i= 0; i < share->keys; i++, pos++) { - keydef[i].flag= (pos->flags & (HA_NOSAME | HA_FULLTEXT | HA_SPATIAL)); + keydef[i].flag= ((uint16) pos->flags & (HA_NOSAME | HA_FULLTEXT | HA_SPATIAL)); keydef[i].key_alg= pos->algorithm == HA_KEY_ALG_UNDEF ? (pos->flags & HA_SPATIAL ? HA_KEY_ALG_RTREE : HA_KEY_ALG_BTREE) : pos->algorithm; diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index e8594fc9039..ca44ae9ad87 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -140,4 +140,8 @@ class ha_myisam: public handler *engine_callback, ulonglong *engine_data); #endif + MI_INFO *file_ptr(void) + { + return file; + } }; diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 7925cad6125..3cc82b832c9 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -941,7 +941,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) ha_rows records,del_blocks; my_off_t used,empty,pos,splits,start_recpos, del_length,link_used,start_block; - uchar *record,*to; + uchar *record= 0, *to; char llbuff[22],llbuff2[22],llbuff3[22]; ha_checksum intern_record_checksum; ha_checksum key_checksum[MI_MAX_POSSIBLE_KEY]; @@ -958,7 +958,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) puts("- check record links"); } - if (!(record= (uchar*) my_malloc(info->s->base.pack_reclength,MYF(0)))) + if (!mi_alloc_rec_buff(info, -1, &record)) { mi_check_print_error(param,"Not enough memory for record"); DBUG_RETURN(-1); @@ -1365,12 +1365,12 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) printf("Lost space: %12s Linkdata: %10s\n", llstr(empty,llbuff),llstr(link_used,llbuff2)); } - my_free((uchar*) record,MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); DBUG_RETURN (error); err: mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff)); err2: - my_free((uchar*) record,MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); param->testflag|=T_RETRY_WITHOUT_QUICK; DBUG_RETURN(1); } /* chk_data_link */ @@ -1488,7 +1488,7 @@ static int mi_drop_all_indexes(MI_CHECK *param, MI_INFO *info, my_bool force) /* Remove all key blocks of this index file from key cache. */ if ((error= flush_key_blocks(share->key_cache, share->kfile, FLUSH_IGNORE_CHANGED))) - goto end; + goto end; /* purecov: inspected */ /* Clear index root block pointers. */ for (i= 0; i < share->base.keys; i++) @@ -1561,8 +1561,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, MYF(MY_WME | MY_WAIT_IF_FULL))) goto err; info->opt_flag|=WRITE_CACHE_USED; - if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength, - MYF(0))) || + if (!mi_alloc_rec_buff(info, -1, &sort_param.record) || !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff)) { mi_check_print_error(param, "Not enough memory for extra record"); @@ -1754,7 +1753,8 @@ err: } my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record), + MYF(MY_ALLOW_ZERO_PTR)); my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); VOID(end_io_cache(¶m->read_cache)); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); @@ -2261,8 +2261,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, info->opt_flag|=WRITE_CACHE_USED; info->rec_cache.file=info->dfile; /* for sort_delete_record */ - if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength, - MYF(0))) || + if (!mi_alloc_rec_buff(info, -1, &sort_param.record) || !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff)) { mi_check_print_error(param, "Not enough memory for extra record"); @@ -2571,7 +2570,8 @@ err: my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record), + MYF(MY_ALLOW_ZERO_PTR)); my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR)); my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR)); my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); @@ -2649,6 +2649,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, SORT_INFO sort_info; ulonglong key_map; pthread_attr_t thr_attr; + ulong max_pack_reclength; DBUG_ENTER("mi_repair_parallel"); LINT_INIT(key_map); @@ -2795,10 +2796,13 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, del=info->state->del; param->glob_crc=0; - + /* for compressed tables */ + max_pack_reclength= share->base.pack_reclength; + if (share->options & HA_OPTION_COMPRESS_RECORD) + set_if_bigger(max_pack_reclength, share->max_pack_length); if (!(sort_param=(MI_SORT_PARAM *) my_malloc((uint) share->base.keys * - (sizeof(MI_SORT_PARAM) + share->base.pack_reclength), + (sizeof(MI_SORT_PARAM) + max_pack_reclength), MYF(MY_ZEROFILL)))) { mi_check_print_error(param,"Not enough memory for key!"); @@ -2854,7 +2858,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, sort_param[i].max_pos=sort_param[i].pos=share->pack.header_length; sort_param[i].record= (((uchar *)(sort_param+share->base.keys))+ - (share->base.pack_reclength * i)); + (max_pack_reclength * i)); if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff)) { mi_check_print_error(param,"Not enough memory!"); @@ -4469,7 +4473,7 @@ err: void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, my_bool repair_only) { - uchar *record; + uchar *record= 0; DBUG_ENTER("update_auto_increment_key"); if (!info->s->base.auto_key || @@ -4488,8 +4492,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, We have to use an allocated buffer instead of info->rec_buff as _mi_put_key_in_record() may use info->rec_buff */ - if (!(record= (uchar*) my_malloc((uint) info->s->base.pack_reclength, - MYF(0)))) + if (!mi_alloc_rec_buff(info, -1, &record)) { mi_check_print_error(param,"Not enough memory for extra record"); DBUG_VOID_RETURN; @@ -4501,7 +4504,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, if (my_errno != HA_ERR_END_OF_FILE) { mi_extra(info,HA_EXTRA_NO_KEYREAD,0); - my_free((char*) record, MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); mi_check_print_error(param,"%d when reading last record",my_errno); DBUG_VOID_RETURN; } @@ -4516,7 +4519,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, set_if_bigger(info->s->state.auto_increment, param->auto_increment_value); } mi_extra(info,HA_EXTRA_NO_KEYREAD,0); - my_free((char*) record, MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); update_state_info(param, info, UPDATE_AUTO_INC); DBUG_VOID_RETURN; } diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 0f5d820488c..a4f6e1291db 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -697,8 +697,11 @@ uchar *mi_alloc_rec_buff(MI_INFO *info, ulong length, uchar **buf) /* to simplify initial init of info->rec_buf in mi_open and mi_extra */ if (length == (ulong) -1) { - length= max(info->s->base.pack_reclength, - info->s->base.max_key_length); + if (info->s->options & HA_OPTION_COMPRESS_RECORD) + length= max(info->s->base.pack_reclength, info->s->max_pack_length); + else + length= info->s->base.pack_reclength; + length= max(length, info->s->base.max_key_length); /* Avoid unnecessary realloc */ if (newptr && length == old_length) return newptr; diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index 305b7e5532c..59c98c978ce 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -166,7 +166,6 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) share->pack.header_length= uint4korr(header+4); share->min_pack_length=(uint) uint4korr(header+8); share->max_pack_length=(uint) uint4korr(header+12); - set_if_bigger(share->base.pack_reclength,share->max_pack_length); elements=uint4korr(header+16); intervall_length=uint4korr(header+20); trees=uint2korr(header+24); @@ -565,7 +564,7 @@ static void fill_quick_table(uint16 *table, uint bits, uint max_bits, */ value|= (max_bits - bits) << 8 | IS_CHAR; - for (end= table + (uint) (((uint) 1 << bits)); table < end; table++) + for (end= table + ((my_ptrdiff_t) 1 << bits); table < end; table++) { *table= (uint16) value; } diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 567e1057e5d..2300d1e7c23 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1536,8 +1536,8 @@ static int mi_sort_records(MI_CHECK *param, mi_check_print_error(param,"Not enough memory for key block"); goto err; } - if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength, - MYF(0)))) + + if (!mi_alloc_rec_buff(info, -1, &sort_param.record)) { mi_check_print_error(param,"Not enough memory for record"); goto err; @@ -1632,7 +1632,8 @@ err: { my_afree((uchar*) temp_buff); } - my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record), + MYF(MY_ALLOW_ZERO_PTR)); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); VOID(end_io_cache(&info->rec_cache)); my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 37428ddd279..7233ebbff80 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -3148,7 +3148,7 @@ static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count) cur_sort_p= sort_counts; while (cur_count_p < end_count_p) *(cur_sort_p++)= cur_count_p++; - (void) qsort(sort_counts, 256, sizeof(my_off_t*), (qsort_cmp) fakecmp); + (void) my_qsort(sort_counts, 256, sizeof(my_off_t*), (qsort_cmp) fakecmp); /* Assign faked counts. diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index 941b6a7616c..d505d2633ce 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -650,8 +650,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, uint sort_length=info->key_length; DBUG_ENTER("write_keys"); - qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, + info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -693,8 +693,8 @@ static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info, int err; DBUG_ENTER("write_keys_varlen"); - qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, + info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -736,8 +736,8 @@ static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys, { DBUG_ENTER("write_index"); - qsort2((uchar*) sort_keys,(size_t) count,sizeof(uchar*), - (qsort2_cmp) info->key_cmp,info); + my_qsort2((uchar*) sort_keys,(size_t) count,sizeof(uchar*), + (qsort2_cmp) info->key_cmp,info); while (count--) { if ((*info->key_write)(info,*sort_keys++)) diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 54ad029c4f4..3fccb91e9b5 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -14,6 +14,82 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + MyISAM MERGE tables + + A MyISAM MERGE table is kind of a union of zero or more MyISAM tables. + + Besides the normal form file (.frm) a MERGE table has a meta file + (.MRG) with a list of tables. These are paths to the MyISAM table + files. The last two components of the path contain the database name + and the table name respectively. + + When a MERGE table is open, there exists an TABLE object for the MERGE + table itself and a TABLE object for each of the MyISAM tables. For + abbreviated writing, I call the MERGE table object "parent" and the + MyISAM table objects "children". + + A MERGE table is almost always opened through open_and_lock_tables() + and hence through open_tables(). When the parent appears in the list + of tables to open, the initial open of the handler does nothing but + read the meta file and collect a list of TABLE_LIST objects for the + children. This list is attached to the parent TABLE object as + TABLE::child_l. The end of the children list is saved in + TABLE::child_last_l. + + Back in open_tables(), add_merge_table_list() is called. It updates + each list member with the lock type and a back pointer to the parent + TABLE_LIST object TABLE_LIST::parent_l. The list is then inserted in + the list of tables to open, right behind the parent. Consequently, + open_tables() opens the children, one after the other. The TABLE + references of the TABLE_LIST objects are implicitly set to the open + tables. The children are opened as independent MyISAM tables, right as + if they are used by the SQL statement. + + TABLE_LIST::parent_l is required to find the parent 1. when the last + child has been opened and children are to be attached, and 2. when an + error happens during child open and the child list must be removed + from the queuery list. In these cases the current child does not have + TABLE::parent set or does not have a TABLE at all respectively. + + When the last child is open, attach_merge_children() is called. It + removes the list of children from the open list. Then the children are + "attached" to the parent. All required references between parent and + children are set up. + + The MERGE storage engine sets up an array with references to the + low-level MyISAM table objects (MI_INFO). It remembers the state of + the table in MYRG_INFO::children_attached. + + Every child TABLE::parent references the parent TABLE object. That way + TABLE objects belonging to a MERGE table can be identified. + TABLE::parent is required because the parent and child TABLE objects + can live longer than the parent TABLE_LIST object. So the path + child->pos_in_table_list->parent_l->table can be broken. + + If necessary, the compatibility of parent and children is checked. + This check is necessary when any of the objects are reopend. This is + detected by comparing the current table def version against the + remembered child def version. On parent open, the list members are + initialized to an "impossible"/"undefined" version value. So the check + is always executed on the first attach. + + The version check is done in myisammrg_attach_children_callback(), + which is called for every child. ha_myisammrg::attach_children() + initializes 'need_compat_check' to FALSE and + myisammrg_attach_children_callback() sets it ot TRUE if a table + def version mismatches the remembered child def version. + + Finally the parent TABLE::children_attached is set. + + --- + + On parent open the storage engine structures are allocated and initialized. + They stay with the open table until its final close. + + +*/ + #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation #endif @@ -22,14 +98,11 @@ #include "mysql_priv.h" #include <mysql/plugin.h> #include <m_ctype.h> +#include "../myisam/ha_myisam.h" #include "ha_myisammrg.h" #include "myrg_def.h" -/***************************************************************************** -** MyISAM MERGE tables -*****************************************************************************/ - static handler *myisammrg_create_handler(handlerton *hton, TABLE_SHARE *table, MEM_ROOT *mem_root) @@ -38,10 +111,23 @@ static handler *myisammrg_create_handler(handlerton *hton, } +/** + @brief Constructor +*/ + ha_myisammrg::ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), file(0) {} + +/** + @brief Destructor +*/ + +ha_myisammrg::~ha_myisammrg(void) +{} + + static const char *ha_myisammrg_exts[] = { ".MRG", NullS @@ -89,25 +175,311 @@ const char *ha_myisammrg::index_type(uint key_number) } -int ha_myisammrg::open(const char *name, int mode, uint test_if_locked) +/** + @brief Callback function for open of a MERGE parent table. + + @detail This function adds a TABLE_LIST object for a MERGE child table + to a list of tables of the parent TABLE object. It is called for + each child table. + + The list of child TABLE_LIST objects is kept in the TABLE object of + the parent for the whole life time of the MERGE table. It is + inserted in the statement list behind the MERGE parent TABLE_LIST + object when the MERGE table is opened. It is removed from the + statement list after the last child is opened. + + All memeory used for the child TABLE_LIST objects and the strings + referred by it are taken from the parent TABLE::mem_root. Thus they + are all freed implicitly at the final close of the table. + + TABLE::child_l -> TABLE_LIST::next_global -> TABLE_LIST::next_global + # # ^ # ^ + # # | # | + # # +--------- TABLE_LIST::prev_global + # # | + # |<--- TABLE_LIST::prev_global | + # | + TABLE::child_last_l -----------------------------------------+ + + @param[in] callback_param data pointer as given to myrg_parent_open() + @param[in] filename file name of MyISAM table + without extension. + + @return status + @retval 0 OK + @retval != 0 Error +*/ + +static int myisammrg_parent_open_callback(void *callback_param, + const char *filename) { - MI_KEYDEF *keyinfo; - MI_COLUMNDEF *recinfo; - MYRG_TABLE *u_table; - uint recs; - uint keys= table->s->keys; - int error; - char name_buff[FN_REFLEN]; + ha_myisammrg *ha_myrg; + TABLE *parent; + TABLE_LIST *child_l; + const char *db; + const char *table_name; + uint dirlen; + char dir_path[FN_REFLEN]; + DBUG_ENTER("myisammrg_parent_open_callback"); + + /* Extract child table name and database name from filename. */ + dirlen= dirname_length(filename); + if (dirlen >= FN_REFLEN) + { + /* purecov: begin inspected */ + DBUG_PRINT("error", ("name too long: '%.64s'", filename)); + my_errno= ENAMETOOLONG; + DBUG_RETURN(1); + /* purecov: end */ + } + table_name= filename + dirlen; + dirlen--; /* Strip off trailing '/'. */ + memcpy(dir_path, filename, dirlen); + dir_path[dirlen]= '\0'; + db= base_name(dir_path); + dirlen-= db - dir_path; /* This is now the length of 'db'. */ + DBUG_PRINT("myrg", ("open: '%s'.'%s'", db, table_name)); + + ha_myrg= (ha_myisammrg*) callback_param; + parent= ha_myrg->table_ptr(); + + /* Get a TABLE_LIST object. */ + if (!(child_l= (TABLE_LIST*) alloc_root(&parent->mem_root, + sizeof(TABLE_LIST)))) + { + /* purecov: begin inspected */ + DBUG_PRINT("error", ("my_malloc error: %d", my_errno)); + DBUG_RETURN(1); + /* purecov: end */ + } + bzero((char*) child_l, sizeof(TABLE_LIST)); + + /* Set database (schema) name. */ + child_l->db_length= dirlen; + child_l->db= strmake_root(&parent->mem_root, db, dirlen); + /* Set table name. */ + child_l->table_name_length= strlen(table_name); + child_l->table_name= strmake_root(&parent->mem_root, table_name, + child_l->table_name_length); + /* Convert to lowercase if required. */ + if (lower_case_table_names && child_l->table_name_length) + child_l->table_name_length= my_casedn_str(files_charset_info, + child_l->table_name); + /* Set alias. */ + child_l->alias= child_l->table_name; + + /* Initialize table map to 'undefined'. */ + child_l->init_child_def_version(); + + /* Link TABLE_LIST object into the parent list. */ + if (!parent->child_last_l) + { + /* Initialize parent->child_last_l when handling first child. */ + parent->child_last_l= &parent->child_l; + } + *parent->child_last_l= child_l; + child_l->prev_global= parent->child_last_l; + parent->child_last_l= &child_l->next_global; + + DBUG_RETURN(0); +} + + +/** + @brief Callback function for attaching a MERGE child table. + + @detail This function retrieves the MyISAM table handle from the + next child table. It is called for each child table. + + @param[in] callback_param data pointer as given to + myrg_attach_children() + + @return pointer to open MyISAM table structure + @retval !=NULL OK, returning pointer + @retval NULL, my_errno == 0 Ok, no more child tables + @retval NULL, my_errno != 0 error +*/ + +static MI_INFO *myisammrg_attach_children_callback(void *callback_param) +{ + ha_myisammrg *ha_myrg; + TABLE *parent; + TABLE *child; + TABLE_LIST *child_l; + MI_INFO *myisam; + DBUG_ENTER("myisammrg_attach_children_callback"); + + my_errno= 0; + ha_myrg= (ha_myisammrg*) callback_param; + parent= ha_myrg->table_ptr(); + + /* Get child list item. */ + child_l= ha_myrg->next_child_attach; + if (!child_l) + { + DBUG_PRINT("myrg", ("No more children to attach")); + DBUG_RETURN(NULL); + } + child= child_l->table; + DBUG_PRINT("myrg", ("child table: '%s'.'%s' 0x%lx", child->s->db.str, + child->s->table_name.str, (long) child)); + /* + Prepare for next child. Used as child_l in next call to this function. + We cannot rely on a NULL-terminated chain. + */ + if (&child_l->next_global == parent->child_last_l) + { + DBUG_PRINT("myrg", ("attaching last child")); + ha_myrg->next_child_attach= NULL; + } + else + ha_myrg->next_child_attach= child_l->next_global; + + /* Set parent reference. */ + child->parent= parent; + + /* + Do a quick compatibility check. The table def version is set when + the table share is created. The child def version is copied + from the table def version after a sucessful compatibility check. + We need to repeat the compatibility check only if a child is opened + from a different share than last time it was used with this MERGE + table. + */ + DBUG_PRINT("myrg", ("table_def_version last: %lu current: %lu", + (ulong) child_l->get_child_def_version(), + (ulong) child->s->get_table_def_version())); + if (child_l->get_child_def_version() != child->s->get_table_def_version()) + ha_myrg->need_compat_check= TRUE; + + /* + If parent is temporary, children must be temporary too and vice + versa. This check must be done for every child on every open because + the table def version can overlap between temporary and + non-temporary tables. We need to detect the case where a + non-temporary table has been replaced with a temporary table of the + same version. Or vice versa. A very unlikely case, but it could + happen. + */ + if (child->s->tmp_table != parent->s->tmp_table) + { + DBUG_PRINT("error", ("temporary table mismatch parent: %d child: %d", + parent->s->tmp_table, child->s->tmp_table)); + my_errno= HA_ERR_WRONG_MRG_TABLE_DEF; + goto err; + } + + /* Extract the MyISAM table structure pointer from the handler object. */ + if ((child->file->ht->db_type != DB_TYPE_MYISAM) || + !(myisam= ((ha_myisam*) child->file)->file_ptr())) + { + DBUG_PRINT("error", ("no MyISAM handle for child table: '%s'.'%s' 0x%lx", + child->s->db.str, child->s->table_name.str, + (long) child)); + my_errno= HA_ERR_WRONG_MRG_TABLE_DEF; + } + DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx my_errno: %d", + (long) myisam, my_errno)); + + err: + DBUG_RETURN(my_errno ? NULL : myisam); +} + + +/** + @brief Open a MERGE parent table, not its children. + + @detail This function initializes the MERGE storage engine structures + and adds a child list of TABLE_LIST to the parent TABLE. + + @param[in] name MERGE table path name + @param[in] mode read/write mode, unused + @param[in] test_if_locked open flags + + @return status + @retval 0 OK + @retval -1 Error, my_errno gives reason +*/ + +int ha_myisammrg::open(const char *name, int mode __attribute__((unused)), + uint test_if_locked) +{ + DBUG_ENTER("ha_myisammrg::open"); + DBUG_PRINT("myrg", ("name: '%s' table: 0x%lx", name, (long) table)); + DBUG_PRINT("myrg", ("test_if_locked: %u", test_if_locked)); + + /* Save for later use. */ + this->test_if_locked= test_if_locked; + + /* retrieve children table list. */ + my_errno= 0; + if (!(file= myrg_parent_open(name, myisammrg_parent_open_callback, this))) + { + DBUG_PRINT("error", ("my_errno %d", my_errno)); + DBUG_RETURN(my_errno ? my_errno : -1); + } + DBUG_PRINT("myrg", ("MYRG_INFO: 0x%lx", (long) file)); + DBUG_RETURN(0); +} + + +/** + @brief Attach children to a MERGE table. + + @detail Let the storage engine attach its children through a callback + function. Check table definitions for consistency. + + @note Special thd->open_options may be in effect. We can make use of + them in attach. I.e. we use HA_OPEN_FOR_REPAIR to report the names + of mismatching child tables. We cannot transport these options in + ha_myisammrg::test_if_locked because they may change after the + parent is opened. The parent is kept open in the table cache over + multiple statements and can be used by other threads. Open options + can change over time. + + @return status + @retval 0 OK + @retval != 0 Error, my_errno gives reason +*/ - DBUG_PRINT("info", ("ha_myisammrg::open")); - if (!(file=myrg_open(fn_format(name_buff,name,"","", - MY_UNPACK_FILENAME|MY_APPEND_EXT), - mode, test_if_locked))) +int ha_myisammrg::attach_children(void) +{ + MYRG_TABLE *u_table; + MI_COLUMNDEF *recinfo; + MI_KEYDEF *keyinfo; + uint recs; + uint keys= table->s->keys; + int error; + DBUG_ENTER("ha_myisammrg::attach_children"); + DBUG_PRINT("myrg", ("table: '%s'.'%s' 0x%lx", table->s->db.str, + table->s->table_name.str, (long) table)); + DBUG_PRINT("myrg", ("test_if_locked: %u", this->test_if_locked)); + DBUG_ASSERT(!this->file->children_attached); + + /* + Initialize variables that are used, modified, and/or set by + myisammrg_attach_children_callback(). + 'next_child_attach' traverses the chain of TABLE_LIST objects + that has been compiled during myrg_parent_open(). Every call + to myisammrg_attach_children_callback() moves the pointer to + the next object. + 'need_compat_check' is set by myisammrg_attach_children_callback() + if a child fails the table def version check. + 'my_errno' is set by myisammrg_attach_children_callback() in + case of an error. + */ + next_child_attach= table->child_l; + need_compat_check= FALSE; + my_errno= 0; + + if (myrg_attach_children(this->file, this->test_if_locked | + current_thd->open_options, + myisammrg_attach_children_callback, this)) { - DBUG_PRINT("info", ("ha_myisammrg::open exit %d", my_errno)); - return (my_errno ? my_errno : -1); + DBUG_PRINT("error", ("my_errno %d", my_errno)); + DBUG_RETURN(my_errno ? my_errno : -1); } - DBUG_PRINT("info", ("ha_myisammrg::open myrg_extrafunc...")); + DBUG_PRINT("myrg", ("calling myrg_extrafunc")); myrg_extrafunc(file, query_cache_invalidate_by_MyISAM_filename_ref); if (!(test_if_locked == HA_OPEN_WAIT_IF_LOCKED || test_if_locked == HA_OPEN_ABORT_IF_LOCKED)) @@ -116,69 +488,147 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked) if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED)) myrg_extra(file,HA_EXTRA_WAIT_LOCK,0); - if (table->s->reclength != stats.mean_rec_length && stats.mean_rec_length) - { - DBUG_PRINT("error",("reclength: %lu mean_rec_length: %lu", - table->s->reclength, stats.mean_rec_length)); - if (test_if_locked & HA_OPEN_FOR_REPAIR) - myrg_print_wrong_table(file->open_tables->table->filename); - error= HA_ERR_WRONG_MRG_TABLE_DEF; - goto err; - } - if ((error= table2myisam(table, &keyinfo, &recinfo, &recs))) - { - /* purecov: begin inspected */ - DBUG_PRINT("error", ("Failed to convert TABLE object to MyISAM " - "key and column definition")); - goto err; - /* purecov: end */ - } - for (u_table= file->open_tables; u_table < file->end_table; u_table++) + /* + The compatibility check is required only if one or more children do + not match their table def version from the last check. This will + always happen at the first attach because the reference child def + version is initialized to 'undefined' at open. + */ + DBUG_PRINT("myrg", ("need_compat_check: %d", need_compat_check)); + if (need_compat_check) { - if (check_definition(keyinfo, recinfo, keys, recs, - u_table->table->s->keyinfo, u_table->table->s->rec, - u_table->table->s->base.keys, - u_table->table->s->base.fields, false)) + TABLE_LIST *child_l; + + if (table->s->reclength != stats.mean_rec_length && stats.mean_rec_length) { - error= HA_ERR_WRONG_MRG_TABLE_DEF; + DBUG_PRINT("error",("reclength: %lu mean_rec_length: %lu", + table->s->reclength, stats.mean_rec_length)); if (test_if_locked & HA_OPEN_FOR_REPAIR) - myrg_print_wrong_table(u_table->table->filename); - else + myrg_print_wrong_table(file->open_tables->table->filename); + error= HA_ERR_WRONG_MRG_TABLE_DEF; + goto err; + } + /* + Both recinfo and keyinfo are allocated by my_multi_malloc(), thus + only recinfo must be freed. + */ + if ((error= table2myisam(table, &keyinfo, &recinfo, &recs))) + { + /* purecov: begin inspected */ + DBUG_PRINT("error", ("failed to convert TABLE object to MyISAM " + "key and column definition")); + goto err; + /* purecov: end */ + } + for (u_table= file->open_tables; u_table < file->end_table; u_table++) + { + if (check_definition(keyinfo, recinfo, keys, recs, + u_table->table->s->keyinfo, u_table->table->s->rec, + u_table->table->s->base.keys, + u_table->table->s->base.fields, false)) { - my_free((uchar*) recinfo, MYF(0)); - goto err; + DBUG_PRINT("error", ("table definition mismatch: '%s'", + u_table->table->filename)); + error= HA_ERR_WRONG_MRG_TABLE_DEF; + if (!(this->test_if_locked & HA_OPEN_FOR_REPAIR)) + { + my_free((uchar*) recinfo, MYF(0)); + goto err; + } + myrg_print_wrong_table(u_table->table->filename); } } + my_free((uchar*) recinfo, MYF(0)); + if (error == HA_ERR_WRONG_MRG_TABLE_DEF) + goto err; + + /* All checks passed so far. Now update child def version. */ + for (child_l= table->child_l; ; child_l= child_l->next_global) + { + child_l->set_child_def_version( + child_l->table->s->get_table_def_version()); + + if (&child_l->next_global == table->child_last_l) + break; + } } - my_free((uchar*) recinfo, MYF(0)); - if (error == HA_ERR_WRONG_MRG_TABLE_DEF) - goto err; #if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4 /* Merge table has more than 2G rows */ if (table->s->crashed) { + DBUG_PRINT("error", ("MERGE table marked crashed")); error= HA_ERR_WRONG_MRG_TABLE_DEF; goto err; } #endif - return (0); + DBUG_RETURN(0); + err: - myrg_close(file); - file=0; - return (my_errno= error); + myrg_detach_children(file); + DBUG_RETURN(my_errno= error); } + +/** + @brief Detach all children from a MERGE table. + + @note Detach must not touch the children in any way. + They may have been closed at ths point already. + All references to the children should be removed. + + @return status + @retval 0 OK + @retval != 0 Error, my_errno gives reason +*/ + +int ha_myisammrg::detach_children(void) +{ + DBUG_ENTER("ha_myisammrg::detach_children"); + DBUG_ASSERT(this->file && this->file->children_attached); + + if (myrg_detach_children(this->file)) + { + /* purecov: begin inspected */ + DBUG_PRINT("error", ("my_errno %d", my_errno)); + DBUG_RETURN(my_errno ? my_errno : -1); + /* purecov: end */ + } + DBUG_RETURN(0); +} + + +/** + @brief Close a MERGE parent table, not its children. + + @note The children are expected to be closed separately by the caller. + + @return status + @retval 0 OK + @retval != 0 Error, my_errno gives reason +*/ + int ha_myisammrg::close(void) { - return myrg_close(file); + int rc; + DBUG_ENTER("ha_myisammrg::close"); + /* + Children must not be attached here. Unless the MERGE table has no + children. In this case children_attached is always true. + */ + DBUG_ASSERT(!this->file->children_attached || !this->file->tables); + rc= myrg_close(file); + file= 0; + DBUG_RETURN(rc); } int ha_myisammrg::write_row(uchar * buf) { + DBUG_ENTER("ha_myisammrg::write_row"); + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_write_count); if (file->merge_insert_method == MERGE_INSERT_DISABLED || !file->tables) - return (HA_ERR_TABLE_READONLY); + DBUG_RETURN(HA_ERR_TABLE_READONLY); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); @@ -186,13 +636,14 @@ int ha_myisammrg::write_row(uchar * buf) { int error; if ((error= update_auto_increment())) - return error; + DBUG_RETURN(error); /* purecov: inspected */ } - return myrg_write(file,buf); + DBUG_RETURN(myrg_write(file,buf)); } int ha_myisammrg::update_row(const uchar * old_data, uchar * new_data) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_update_count); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); @@ -201,6 +652,7 @@ int ha_myisammrg::update_row(const uchar * old_data, uchar * new_data) int ha_myisammrg::delete_row(const uchar * buf) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_delete_count); return myrg_delete(file,buf); } @@ -209,6 +661,7 @@ int ha_myisammrg::index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map, enum ha_rkey_function find_flag) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_key_count); int error=myrg_rkey(file,buf,active_index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; @@ -219,6 +672,7 @@ int ha_myisammrg::index_read_idx_map(uchar * buf, uint index, const uchar * key, key_part_map keypart_map, enum ha_rkey_function find_flag) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_key_count); int error=myrg_rkey(file,buf,index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; @@ -228,6 +682,7 @@ int ha_myisammrg::index_read_idx_map(uchar * buf, uint index, const uchar * key, int ha_myisammrg::index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_key_count); int error=myrg_rkey(file,buf,active_index, key, keypart_map, HA_READ_PREFIX_LAST); @@ -237,6 +692,7 @@ int ha_myisammrg::index_read_last_map(uchar *buf, const uchar *key, int ha_myisammrg::index_next(uchar * buf) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_next_count); int error=myrg_rnext(file,buf,active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -245,6 +701,7 @@ int ha_myisammrg::index_next(uchar * buf) int ha_myisammrg::index_prev(uchar * buf) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_prev_count); int error=myrg_rprev(file,buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -253,6 +710,7 @@ int ha_myisammrg::index_prev(uchar * buf) int ha_myisammrg::index_first(uchar * buf) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_first_count); int error=myrg_rfirst(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -261,6 +719,7 @@ int ha_myisammrg::index_first(uchar * buf) int ha_myisammrg::index_last(uchar * buf) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_last_count); int error=myrg_rlast(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -272,6 +731,7 @@ int ha_myisammrg::index_next_same(uchar * buf, uint length __attribute__((unused))) { int error; + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_next_count); do { @@ -284,12 +744,14 @@ int ha_myisammrg::index_next_same(uchar * buf, int ha_myisammrg::rnd_init(bool scan) { + DBUG_ASSERT(this->file->children_attached); return myrg_reset(file); } int ha_myisammrg::rnd_next(uchar *buf) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_rnd_next_count); int error=myrg_rrnd(file, buf, HA_OFFSET_ERROR); table->status=error ? STATUS_NOT_FOUND: 0; @@ -299,6 +761,7 @@ int ha_myisammrg::rnd_next(uchar *buf) int ha_myisammrg::rnd_pos(uchar * buf, uchar *pos) { + DBUG_ASSERT(this->file->children_attached); ha_statistic_increment(&SSV::ha_read_rnd_count); int error=myrg_rrnd(file, buf, my_get_ptr(pos,ref_length)); table->status=error ? STATUS_NOT_FOUND: 0; @@ -307,6 +770,7 @@ int ha_myisammrg::rnd_pos(uchar * buf, uchar *pos) void ha_myisammrg::position(const uchar *record) { + DBUG_ASSERT(this->file->children_attached); ulonglong row_position= myrg_position(file); my_store_ptr(ref, ref_length, (my_off_t) row_position); } @@ -315,6 +779,7 @@ void ha_myisammrg::position(const uchar *record) ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key, key_range *max_key) { + DBUG_ASSERT(this->file->children_attached); return (ha_rows) myrg_records_in_range(file, (int) inx, min_key, max_key); } @@ -322,6 +787,7 @@ ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key, int ha_myisammrg::info(uint flag) { MYMERGE_INFO mrg_info; + DBUG_ASSERT(this->file->children_attached); (void) myrg_status(file,&mrg_info,flag); /* The following fails if one has not compiled MySQL with -DBIG_TABLES @@ -391,6 +857,23 @@ int ha_myisammrg::info(uint flag) int ha_myisammrg::extra(enum ha_extra_function operation) { + if (operation == HA_EXTRA_ATTACH_CHILDREN) + { + int rc= attach_children(); + if (!rc) + (void) extra(HA_EXTRA_NO_READCHECK); // Not needed in SQL + return(rc); + } + else if (operation == HA_EXTRA_DETACH_CHILDREN) + { + /* + Note that detach must not touch the children in any way. + They may have been closed at ths point already. + */ + int rc= detach_children(); + return(rc); + } + /* As this is just a mapping, we don't have to force the underlying tables to be closed */ if (operation == HA_EXTRA_FORCE_REOPEN || @@ -408,6 +891,7 @@ int ha_myisammrg::reset(void) int ha_myisammrg::extra_opt(enum ha_extra_function operation, ulong cache_size) { + DBUG_ASSERT(this->file->children_attached); if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_WRITE_CACHE) return 0; return myrg_extra(file, operation, (void*) &cache_size); @@ -415,11 +899,20 @@ int ha_myisammrg::extra_opt(enum ha_extra_function operation, ulong cache_size) int ha_myisammrg::external_lock(THD *thd, int lock_type) { + DBUG_ASSERT(this->file->children_attached); return myrg_lock_database(file,lock_type); } uint ha_myisammrg::lock_count(void) const { + /* + Return the real lock count even if the children are not attached. + This method is used for allocating memory. If we would return 0 + to another thread (e.g. doing FLUSH TABLE), and attach the children + before the other thread calls store_lock(), then we would return + more locks in store_lock() than we claimed by lock_count(). The + other tread would overrun its memory. + */ return file->tables; } @@ -430,6 +923,24 @@ THR_LOCK_DATA **ha_myisammrg::store_lock(THD *thd, { MYRG_TABLE *open_table; + /* + This method can be called while another thread is attaching the + children. If the processor reorders instructions or write to memory, + 'children_attached' could be set before 'open_tables' has all the + pointers to the children. Use of a mutex here and in + myrg_attach_children() forces consistent data. + */ + pthread_mutex_lock(&this->file->mutex); + + /* + When MERGE table is open, but not yet attached, other threads + could flush it, which means call mysql_lock_abort_for_thread() + on this threads TABLE. 'children_attached' is FALSE in this + situaton. Since the table is not locked, return no lock data. + */ + if (!this->file->children_attached) + goto end; /* purecov: tested */ + for (open_table=file->open_tables ; open_table != file->end_table ; open_table++) @@ -438,6 +949,9 @@ THR_LOCK_DATA **ha_myisammrg::store_lock(THD *thd, if (lock_type != TL_IGNORE && open_table->table->lock.type == TL_UNLOCK) open_table->table->lock.type=lock_type; } + + end: + pthread_mutex_unlock(&this->file->mutex); return to; } @@ -523,47 +1037,50 @@ int ha_myisammrg::create(const char *name, register TABLE *form, uint dirlgt= dirname_length(name); DBUG_ENTER("ha_myisammrg::create"); + /* Allocate a table_names array in thread mem_root. */ if (!(table_names= (const char**) thd->alloc((create_info->merge_list.elements+1) * sizeof(char*)))) DBUG_RETURN(HA_ERR_OUT_OF_MEM); + + /* Create child path names. */ for (pos= table_names; tables; tables= tables->next_local) { const char *table_name; - TABLE *tbl= 0; - if (create_info->options & HA_LEX_CREATE_TMP_TABLE) - tbl= find_temporary_table(thd, tables); - if (!tbl) - { - /* - Construct the path to the MyISAM table. Try to meet two conditions: - 1.) Allow to include MyISAM tables from different databases, and - 2.) allow for moving DATADIR around in the file system. - The first means that we need paths in the .MRG file. The second - means that we should not have absolute paths in the .MRG file. - The best, we can do, is to use 'mysql_data_home', which is '.' - in mysqld and may be an absolute path in an embedded server. - This means that it might not be possible to move the DATADIR of - an embedded server without changing the paths in the .MRG file. - */ - uint length= build_table_filename(buff, sizeof(buff), - tables->db, tables->table_name, "", 0); - /* - If a MyISAM table is in the same directory as the MERGE table, - we use the table name without a path. This means that the - DATADIR can easily be moved even for an embedded server as long - as the MyISAM tables are from the same database as the MERGE table. - */ - if ((dirname_length(buff) == dirlgt) && ! memcmp(buff, name, dirlgt)) - table_name= tables->table_name; - else - if (! (table_name= thd->strmake(buff, length))) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - } + + /* + Construct the path to the MyISAM table. Try to meet two conditions: + 1.) Allow to include MyISAM tables from different databases, and + 2.) allow for moving DATADIR around in the file system. + The first means that we need paths in the .MRG file. The second + means that we should not have absolute paths in the .MRG file. + The best, we can do, is to use 'mysql_data_home', which is '.' + in mysqld and may be an absolute path in an embedded server. + This means that it might not be possible to move the DATADIR of + an embedded server without changing the paths in the .MRG file. + + Do the same even for temporary tables. MERGE children are now + opened through the table cache. They are opened by db.table_name, + not by their path name. + */ + uint length= build_table_filename(buff, sizeof(buff), + tables->db, tables->table_name, "", 0); + /* + If a MyISAM table is in the same directory as the MERGE table, + we use the table name without a path. This means that the + DATADIR can easily be moved even for an embedded server as long + as the MyISAM tables are from the same database as the MERGE table. + */ + if ((dirname_length(buff) == dirlgt) && ! memcmp(buff, name, dirlgt)) + table_name= tables->table_name; else - table_name= tbl->s->path.str; + if (! (table_name= thd->strmake(buff, length))) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); /* purecov: inspected */ + *pos++= table_name; } *pos=0; + + /* Create a MERGE meta file from the table_names array. */ DBUG_RETURN(myrg_create(fn_format(buff,name,"","", MY_RESOLVE_SYMLINKS| MY_UNPACK_FILENAME|MY_APPEND_EXT), @@ -646,7 +1163,7 @@ static int myisammrg_init(void *p) myisammrg_hton->db_type= DB_TYPE_MRG_MYISAM; myisammrg_hton->create= myisammrg_create_handler; myisammrg_hton->panic= myisammrg_panic; - myisammrg_hton->flags= HTON_CAN_RECREATE|HTON_NO_PARTITION; + myisammrg_hton->flags= HTON_NO_PARTITION; return 0; } diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index 91aabe277f7..977c45d1435 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -27,8 +27,12 @@ class ha_myisammrg: public handler MYRG_INFO *file; public: + TABLE_LIST *next_child_attach; /* next child to attach */ + uint test_if_locked; /* flags from ::open() */ + bool need_compat_check; /* if need compatibility check */ + ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg); - ~ha_myisammrg() {} + ~ha_myisammrg(); const char *table_type() const { return "MRG_MyISAM"; } const char **bas_ext() const; const char *index_type(uint key_number); @@ -53,6 +57,8 @@ class ha_myisammrg: public handler { return ulonglong2double(stats.data_file_length) / IO_SIZE + file->tables; } int open(const char *name, int mode, uint test_if_locked); + int attach_children(void); + int detach_children(void); int close(void); int write_row(uchar * buf); int update_row(const uchar * old_data, uchar * new_data); @@ -85,6 +91,7 @@ class ha_myisammrg: public handler void update_create_info(HA_CREATE_INFO *create_info); void append_create_info(String *packet); MYRG_INFO *myrg_info() { return file; } + TABLE *table_ptr() { return table; } bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); int check(THD* thd, HA_CHECK_OPT* check_opt); }; diff --git a/storage/myisammrg/myrg_close.c b/storage/myisammrg/myrg_close.c index baae24634b3..97216ed47fe 100644 --- a/storage/myisammrg/myrg_close.c +++ b/storage/myisammrg/myrg_close.c @@ -23,13 +23,42 @@ int myrg_close(MYRG_INFO *info) MYRG_TABLE *file; DBUG_ENTER("myrg_close"); - for (file=info->open_tables ; file != info->end_table ; file++) - if ((new_error=mi_close(file->table))) - error=new_error; + /* + Assume that info->children_attached means that this is called from + direct use of MERGE, not from a MySQL server. In this case the + children must be closed and info->rec_per_key_part is part of the + 'info' multi_alloc. + If info->children_attached is false, this is called from a MySQL + server. Children are closed independently but info->rec_per_key_part + must be freed. + Just in case of a server panic (myrg_panic()) info->children_attached + might be true. We would close the children though they should be + closed independently and info->rec_per_key_part is not freed. + This should be acceptable for a panic. + In case of a MySQL server and no children, children_attached is + always true. In this case no rec_per_key_part has been allocated. + So it is correct to use the branch where an empty list of tables is + (not) closed. + */ + if (info->children_attached) + { + for (file= info->open_tables; file != info->end_table; file++) + { + /* purecov: begin inspected */ + if ((new_error= mi_close(file->table))) + error= new_error; + else + file->table= NULL; + /* purecov: end */ + } + } + else + my_free((uchar*) info->rec_per_key_part, MYF(MY_ALLOW_ZERO_PTR)); delete_queue(&info->by_key); pthread_mutex_lock(&THR_LOCK_open); myrg_open_list=list_delete(myrg_open_list,&info->open_list); pthread_mutex_unlock(&THR_LOCK_open); + VOID(pthread_mutex_destroy(&info->mutex)); my_free((uchar*) info,MYF(0)); if (error) { diff --git a/storage/myisammrg/myrg_extra.c b/storage/myisammrg/myrg_extra.c index a1e6e3f8d4d..3d14f6a56e6 100644 --- a/storage/myisammrg/myrg_extra.c +++ b/storage/myisammrg/myrg_extra.c @@ -29,6 +29,8 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function, DBUG_ENTER("myrg_extra"); DBUG_PRINT("info",("function: %lu", (ulong) function)); + if (!info->children_attached) + DBUG_RETURN(1); if (function == HA_EXTRA_CACHE) { info->cache_in_use=1; @@ -73,6 +75,8 @@ int myrg_reset(MYRG_INFO *info) MYRG_TABLE *file; DBUG_ENTER("myrg_reset"); + if (!info->children_attached) + DBUG_RETURN(1); info->cache_in_use=0; info->current_table=0; info->last_used_table= info->open_tables; diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index 500d3a29327..b5002116164 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -26,8 +26,14 @@ open a MyISAM MERGE table if handle_locking is 0 then exit with error if some table is locked if handle_locking is 1 then wait if table is locked -*/ + NOTE: This function is not used in the MySQL server. It is for + MERGE use independent from MySQL. Currently there is some code + duplication between myrg_open() and myrg_parent_open() + + myrg_attach_children(). Please duplicate changes in these + functions or make common sub-functions. +*/ +/* purecov: begin deadcode */ /* not used in MySQL server */ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { @@ -107,13 +113,11 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) key_parts*sizeof(long), MYF(MY_WME|MY_ZEROFILL)))) goto err; - if (files) - { - m_info->open_tables=(MYRG_TABLE *) (m_info+1); - m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files); - m_info->tables= files; - files= 0; - } + DBUG_ASSERT(files); + m_info->open_tables=(MYRG_TABLE *) (m_info+1); + m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files); + m_info->tables= files; + files= 0; m_info->reclength=isam->s->base.reclength; min_keys= isam->s->base.keys; errpos=3; @@ -163,9 +167,11 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) /* this works ok if the table list is empty */ m_info->end_table=m_info->open_tables+files; m_info->last_used_table=m_info->open_tables; + m_info->children_attached= TRUE; VOID(my_close(fd,MYF(0))); end_io_cache(&file); + VOID(pthread_mutex_init(&m_info->mutex, MY_MUTEX_INIT_FAST)); m_info->open_list.data=(void*) m_info; pthread_mutex_lock(&THR_LOCK_open); myrg_open_list=list_add(myrg_open_list,&m_info->open_list); @@ -189,3 +195,330 @@ err: my_errno=save_errno; DBUG_RETURN (NULL); } +/* purecov: end */ + + +/** + @brief Open parent table of a MyISAM MERGE table. + + @detail Open MERGE meta file to get the table name paths for the child + tables. Count the children. Allocate and initialize MYRG_INFO + structure. Call a callback function for each child table. + + @param[in] parent_name merge table name path as "database/table" + @param[in] callback function to call for each child table + @param[in] callback_param data pointer to give to the callback + + @return MYRG_INFO pointer + @retval != NULL OK + @retval NULL Error + + @note: Currently there is some code duplication between myrg_open() + and myrg_parent_open() + myrg_attach_children(). Please duplicate + changes in these functions or make common sub-functions. +*/ + +MYRG_INFO *myrg_parent_open(const char *parent_name, + int (*callback)(void*, const char*), + void *callback_param) +{ + MYRG_INFO *m_info; + int rc; + int errpos; + int save_errno; + int insert_method; + uint length; + uint dir_length; + uint child_count; + size_t name_buff_length; + File fd; + IO_CACHE file_cache; + char parent_name_buff[FN_REFLEN * 2]; + char child_name_buff[FN_REFLEN]; + DBUG_ENTER("myrg_parent_open"); + + rc= 1; + errpos= 0; + bzero((char*) &file_cache, sizeof(file_cache)); + + /* Open MERGE meta file. */ + if ((fd= my_open(fn_format(parent_name_buff, parent_name, "", MYRG_NAME_EXT, + MY_UNPACK_FILENAME|MY_APPEND_EXT), + O_RDONLY | O_SHARE, MYF(0))) < 0) + goto err; /* purecov: inspected */ + errpos= 1; + + if (init_io_cache(&file_cache, fd, 4 * IO_SIZE, READ_CACHE, 0, 0, + MYF(MY_WME | MY_NABP))) + goto err; /* purecov: inspected */ + errpos= 2; + + /* Count children. Determine insert method. */ + child_count= 0; + insert_method= 0; + while ((length= my_b_gets(&file_cache, child_name_buff, FN_REFLEN - 1))) + { + /* Remove line terminator. */ + if (child_name_buff[length - 1] == '\n') + child_name_buff[--length]= '\0'; + + /* Skip empty lines. */ + if (!child_name_buff[0]) + continue; /* purecov: inspected */ + + /* Skip comments, but evaluate insert method. */ + if (child_name_buff[0] == '#') + { + if (!strncmp(child_name_buff + 1, "INSERT_METHOD=", 14)) + { + /* Compare buffer with global methods list: merge_insert_method. */ + insert_method= find_type(child_name_buff + 15, + &merge_insert_method, 2); + } + continue; + } + + /* Count the child. */ + child_count++; + } + + /* Allocate MERGE parent table structure. */ + if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO) + + child_count * sizeof(MYRG_TABLE), + MYF(MY_WME | MY_ZEROFILL)))) + goto err; /* purecov: inspected */ + errpos= 3; + m_info->open_tables= (MYRG_TABLE*) (m_info + 1); + m_info->tables= child_count; + m_info->merge_insert_method= insert_method > 0 ? insert_method : 0; + /* This works even if the table list is empty. */ + m_info->end_table= m_info->open_tables + child_count; + if (!child_count) + { + /* Do not attach/detach an empty child list. */ + m_info->children_attached= TRUE; + } + + /* Call callback for each child. */ + dir_length= dirname_part(parent_name_buff, parent_name, &name_buff_length); + my_b_seek(&file_cache, 0); + while ((length= my_b_gets(&file_cache, child_name_buff, FN_REFLEN - 1))) + { + /* Remove line terminator. */ + if (child_name_buff[length - 1] == '\n') + child_name_buff[--length]= '\0'; + + /* Skip empty lines and comments. */ + if (!child_name_buff[0] || (child_name_buff[0] == '#')) + continue; + + if (!has_path(child_name_buff)) + { + VOID(strmake(parent_name_buff + dir_length, child_name_buff, + sizeof(parent_name_buff) - 1 - dir_length)); + VOID(cleanup_dirname(child_name_buff, parent_name_buff)); + } + else + fn_format(child_name_buff, child_name_buff, "", "", 0); + DBUG_PRINT("info", ("child: '%s'", child_name_buff)); + + /* Callback registers child with handler table. */ + if ((rc= (*callback)(callback_param, child_name_buff))) + goto err; /* purecov: inspected */ + } + + end_io_cache(&file_cache); + VOID(my_close(fd, MYF(0))); + VOID(pthread_mutex_init(&m_info->mutex, MY_MUTEX_INIT_FAST)); + + m_info->open_list.data= (void*) m_info; + pthread_mutex_lock(&THR_LOCK_open); + myrg_open_list= list_add(myrg_open_list, &m_info->open_list); + pthread_mutex_unlock(&THR_LOCK_open); + + DBUG_RETURN(m_info); + + /* purecov: begin inspected */ + err: + save_errno= my_errno; + switch (errpos) { + case 3: + my_free((char*) m_info, MYF(0)); + /* Fall through */ + case 2: + end_io_cache(&file_cache); + /* Fall through */ + case 1: + VOID(my_close(fd, MYF(0))); + } + my_errno= save_errno; + DBUG_RETURN (NULL); + /* purecov: end */ +} + + +/** + @brief Attach children to a MyISAM MERGE parent table. + + @detail Call a callback function for each child table. + The callback returns the MyISAM table handle of the child table. + Check table definition match. + + @param[in] m_info MERGE parent table structure + @param[in] handle_locking if contains HA_OPEN_FOR_REPAIR, warn about + incompatible child tables, but continue + @param[in] callback function to call for each child table + @param[in] callback_param data pointer to give to the callback + + @return status + @retval 0 OK + @retval != 0 Error + + @note: Currently there is some code duplication between myrg_open() + and myrg_parent_open() + myrg_attach_children(). Please duplicate + changes in these functions or make common sub-functions. +*/ + +int myrg_attach_children(MYRG_INFO *m_info, int handle_locking, + MI_INFO *(*callback)(void*), + void *callback_param) +{ + ulonglong file_offset; + MI_INFO *myisam; + int rc; + int errpos; + int save_errno; + uint idx; + uint child_nr; + uint key_parts; + uint min_keys; + DBUG_ENTER("myrg_attach_children"); + DBUG_PRINT("myrg", ("handle_locking: %d", handle_locking)); + + /* + This function can be called while another thread is trying to abort + locks of this MERGE table. If the processor reorders instructions or + write to memory, 'children_attached' could be set before + 'open_tables' has all the pointers to the children. Use of a mutex + here and in ha_myisammrg::store_lock() forces consistent data. + */ + pthread_mutex_lock(&m_info->mutex); + rc= 1; + errpos= 0; + file_offset= 0; + LINT_INIT(key_parts); + min_keys= 0; + child_nr= 0; + while ((myisam= (*callback)(callback_param))) + { + DBUG_PRINT("myrg", ("child_nr: %u table: '%s'", + child_nr, myisam->filename)); + DBUG_ASSERT(child_nr < m_info->tables); + + /* Special handling when the first child is attached. */ + if (!child_nr) + { + m_info->reclength= myisam->s->base.reclength; + min_keys= myisam->s->base.keys; + key_parts= myisam->s->base.key_parts; + if (!m_info->rec_per_key_part) + { + if(!(m_info->rec_per_key_part= (ulong*) + my_malloc(key_parts * sizeof(long), MYF(MY_WME|MY_ZEROFILL)))) + goto err; /* purecov: inspected */ + errpos= 1; + } + } + + /* Add MyISAM table info. */ + m_info->open_tables[child_nr].table= myisam; + m_info->open_tables[child_nr].file_offset= (my_off_t) file_offset; + file_offset+= myisam->state->data_file_length; + + /* Check table definition match. */ + if (m_info->reclength != myisam->s->base.reclength) + { + DBUG_PRINT("error", ("definition mismatch table: '%s' repair: %d", + myisam->filename, + (handle_locking & HA_OPEN_FOR_REPAIR))); + my_errno= HA_ERR_WRONG_MRG_TABLE_DEF; + if (handle_locking & HA_OPEN_FOR_REPAIR) + { + myrg_print_wrong_table(myisam->filename); + continue; + } + goto err; + } + + m_info->options|= myisam->s->options; + m_info->records+= myisam->state->records; + m_info->del+= myisam->state->del; + m_info->data_file_length+= myisam->state->data_file_length; + if (min_keys > myisam->s->base.keys) + min_keys= myisam->s->base.keys; /* purecov: inspected */ + for (idx= 0; idx < key_parts; idx++) + m_info->rec_per_key_part[idx]+= (myisam->s->state.rec_per_key_part[idx] / + m_info->tables); + child_nr++; + } + + if (my_errno == HA_ERR_WRONG_MRG_TABLE_DEF) + goto err; + if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L) + { + my_errno= HA_ERR_RECORD_FILE_FULL; + goto err; + } + /* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */ + m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA); + m_info->keys= min_keys; + m_info->last_used_table= m_info->open_tables; + m_info->children_attached= TRUE; + pthread_mutex_unlock(&m_info->mutex); + DBUG_RETURN(0); + +err: + save_errno= my_errno; + switch (errpos) { + case 1: + my_free((char*) m_info->rec_per_key_part, MYF(0)); + m_info->rec_per_key_part= NULL; + } + pthread_mutex_unlock(&m_info->mutex); + my_errno= save_errno; + DBUG_RETURN(1); +} + + +/** + @brief Detach children from a MyISAM MERGE parent table. + + @param[in] m_info MERGE parent table structure + + @note Detach must not touch the children in any way. + They may have been closed at ths point already. + All references to the children should be removed. + + @return status + @retval 0 OK +*/ + +int myrg_detach_children(MYRG_INFO *m_info) +{ + DBUG_ENTER("myrg_detach_children"); + /* For symmetry with myrg_attach_children() we use the mutex here. */ + pthread_mutex_lock(&m_info->mutex); + if (m_info->tables) + { + /* Do not attach/detach an empty child list. */ + m_info->children_attached= FALSE; + bzero((char*) m_info->open_tables, m_info->tables * sizeof(MYRG_TABLE)); + } + m_info->records= 0; + m_info->del= 0; + m_info->data_file_length= 0; + m_info->options= 0; + pthread_mutex_unlock(&m_info->mutex); + DBUG_RETURN(0); +} + diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index 9272b5ab532..eeae61025b1 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -968,7 +968,6 @@ printNodeStatus(OutputStream *output, MgmtSrvr &mgmsrv, enum ndb_mgm_node_type type) { NodeId nodeId = 0; - mgmsrv.updateStatus(); while(mgmsrv.getNextNodeId(&nodeId, type)) { enum ndb_mgm_node_status status; Uint32 startPhase = 0, @@ -1018,6 +1017,7 @@ MgmApiSession::getStatus(Parser<MgmApiSession>::Context &, m_output->println("node status"); SLEEP_ERROR_INSERTED(6); m_output->println("nodes: %d", noOfNodes); + m_mgmsrv.updateStatus(); SLEEP_ERROR_INSERTED(7); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_NDB); printNodeStatus(m_output, m_mgmsrv, NDB_MGM_NODE_TYPE_MGM); diff --git a/storage/ndb/src/ndbapi/ClusterMgr.cpp b/storage/ndb/src/ndbapi/ClusterMgr.cpp index 448bc1025e8..f5cc44f70d7 100644 --- a/storage/ndb/src/ndbapi/ClusterMgr.cpp +++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp @@ -204,7 +204,10 @@ ClusterMgr::forceHB() theFacade.sendSignalUnCond(&signal, nodeId); } - NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000); + /* Wait for nodes to reply - if any heartbeats was sent */ + if (!waitForHBFromNodes.isclear()) + NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000); + waitingForHB= false; #ifdef DEBUG_REG ndbout << "Still waiting for HB from " << waitForHBFromNodes.getText(buf) << endl; diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index a0ff0314246..c1aba0b35c6 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -5360,12 +5360,12 @@ my_wc_mb_cp932(CHARSET_INFO *cs __attribute__((unused)), static int my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e){ - int hi=s[0]; + int hi; if (s >= e) return MY_CS_TOOSMALL; - if (hi < 0x80) + if ((hi= s[0]) < 0x80) { pwc[0]=hi; return 1; diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index fd783015bf4..247fb041896 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -179,20 +179,40 @@ static uchar NEAR sort_order_euc_kr[]= /* Support for Korean(EUC_KR) characters, by powerm90@tinc.co.kr and mrpark@tinc.co.kr */ -#define iseuc_kr(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)) +/* + Unicode mapping is done according to: + ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/KSC/KSC5601.TXT + + Valid multi-byte characters: + + [A1..FE][41..5A,61..7A,81..FE] + + Note, 0x5C is not a valid MB tail, + so escape_with_backslash_is_dangerous is not set. +*/ + +#define iseuc_kr_head(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)) + +#define iseuc_kr_tail1(c) ((uchar) (c) >= 0x41 && (uchar) (c) <= 0x5A) +#define iseuc_kr_tail2(c) ((uchar) (c) >= 0x61 && (uchar) (c) <= 0x7A) +#define iseuc_kr_tail3(c) ((uchar) (c) >= 0x81 && (uchar) (c) <= 0xFE) + +#define iseuc_kr_tail(c) (iseuc_kr_tail1(c) || \ + iseuc_kr_tail2(c) || \ + iseuc_kr_tail3(c)) static uint ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)), const char* p, const char *e) { return ((*(uchar*)(p)<0x80)? 0:\ - iseuc_kr(*(p)) && (e)-(p)>1 && iseuc_kr(*((p)+1))? 2:\ + iseuc_kr_head(*(p)) && (e)-(p)>1 && iseuc_kr_tail(*((p)+1))? 2:\ 0); } static uint mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c) { - return (iseuc_kr(c) ? 2 : 1); + return (iseuc_kr_head(c) ? 2 : 1); } @@ -8654,7 +8674,7 @@ my_well_formed_len_euckr(CHARSET_INFO *cs __attribute__((unused)), /* Single byte ascii character */ b++; } - else if (b < emb && iseuc_kr(*b) && iseuc_kr(b[1])) + else if (b < emb && iseuc_kr_head(*b) && iseuc_kr_tail(b[1])) { /* Double byte character */ b+= 2; diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 6b71f29f0d2..7de00025eda 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -845,6 +845,7 @@ size_t my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), register char *p, *e; long int new_val; uint sign=0; + unsigned long int uval = (unsigned long int) val; e = p = &buffer[sizeof(buffer)-1]; *p= 0; @@ -853,15 +854,16 @@ size_t my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), { if (val < 0) { - val= -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval= (unsigned long int)0 - uval; *dst++= '-'; len--; sign= 1; } } - new_val = (long) ((unsigned long int) val / 10); - *--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10); + new_val = (long) (uval / 10); + *--p = '0'+ (char) (uval - (unsigned long) new_val * 10); val = new_val; while (val != 0) @@ -885,12 +887,14 @@ size_t my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), register char *p, *e; long long_val; uint sign= 0; + ulonglong uval = (ulonglong)val; if (radix < 0) { if (val < 0) { - val = -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; *dst++= '-'; len--; sign= 1; @@ -900,22 +904,22 @@ size_t my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)), e = p = &buffer[sizeof(buffer)-1]; *p= 0; - if (val == 0) + if (uval == 0) { *--p= '0'; len= 1; goto cnv; } - while ((ulonglong) val > (ulonglong) LONG_MAX) + while (uval > (ulonglong) LONG_MAX) { - ulonglong quo=(ulonglong) val/(uint) 10; - uint rem= (uint) (val- quo* (uint) 10); + ulonglong quo= uval/(uint) 10; + uint rem= (uint) (uval- quo* (uint) 10); *--p = '0' + rem; - val= quo; + uval= quo; } - long_val= (long) val; + long_val= (long) uval; while (long_val != 0) { long quo= long_val/10; @@ -1561,14 +1565,18 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), } else addon= (*str >= '5'); - for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++) + if (!dot) { - if (!dot) - shift++; + for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; shift++, str++); + if (str < end && *str == '.') + { + str++; + for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); + } } - if (str < end && *str == '.' && !dot) + else { - str++; + shift= dot - str; for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); } goto exp; diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 1df8221072e..d1579afe4c2 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1019,6 +1019,7 @@ size_t my_l10tostr_ucs2(CHARSET_INFO *cs, register char *p, *db, *de; long int new_val; int sl=0; + unsigned long int uval = (unsigned long int) val; p = &buffer[sizeof(buffer)-1]; *p='\0'; @@ -1028,12 +1029,13 @@ size_t my_l10tostr_ucs2(CHARSET_INFO *cs, if (val < 0) { sl = 1; - val = -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (unsigned long int)0 - uval; } } - new_val = (long) ((unsigned long int) val / 10); - *--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10); + new_val = (long) (uval / 10); + *--p = '0'+ (char) (uval - (unsigned long) new_val * 10); val = new_val; while (val != 0) @@ -1067,34 +1069,36 @@ size_t my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)), register char *p, *db, *de; long long_val; int sl=0; + ulonglong uval= (ulonglong) val; if (radix < 0) { if (val < 0) { sl=1; - val = -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; } } p = &buffer[sizeof(buffer)-1]; *p='\0'; - if (val == 0) + if (uval == 0) { *--p='0'; goto cnv; } - while ((ulonglong) val > (ulonglong) LONG_MAX) + while (uval > (ulonglong) LONG_MAX) { - ulonglong quo=(ulonglong) val/(size_t) 10; - uint rem= (uint) (val- quo* (uint) 10); + ulonglong quo= uval/(uint) 10; + uint rem= (uint) (uval- quo* (uint) 10); *--p = '0' + rem; - val= quo; + uval= quo; } - long_val= (long) val; + long_val= (long) uval; while (long_val != 0) { long quo= long_val/10; diff --git a/strings/int2str.c b/strings/int2str.c index 9fc53032819..fba98aac3f1 100644 --- a/strings/int2str.c +++ b/strings/int2str.c @@ -57,6 +57,7 @@ int2str(register long int val, register char *dst, register int radix, register char *p; long int new_val; char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; + ulong uval= (ulong) val; if (radix < 0) { @@ -65,7 +66,8 @@ int2str(register long int val, register char *dst, register int radix, if (val < 0) { *dst++ = '-'; - val = -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulong)0 - uval; } radix = -radix; } @@ -86,8 +88,8 @@ int2str(register long int val, register char *dst, register int radix, */ p = &buffer[sizeof(buffer)-1]; *p = '\0'; - new_val=(ulong) val / (ulong) radix; - *--p = dig_vec[(uchar) ((ulong) val- (ulong) new_val*(ulong) radix)]; + new_val= uval / (ulong) radix; + *--p = dig_vec[(uchar) (uval- (ulong) new_val*(ulong) radix)]; val = new_val; #ifdef HAVE_LDIV while (val != 0) @@ -133,20 +135,22 @@ char *int10_to_str(long int val,char *dst,int radix) char buffer[65]; register char *p; long int new_val; + unsigned long int uval = (unsigned long int) val; if (radix < 0) /* -10 */ { if (val < 0) { *dst++ = '-'; - val = -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (unsigned long int)0 - uval; } } p = &buffer[sizeof(buffer)-1]; *p = '\0'; - new_val= (long) ((unsigned long int) val / 10); - *--p = '0'+ (char) ((unsigned long int) val - (unsigned long) new_val * 10); + new_val= (long) (uval / 10); + *--p = '0'+ (char) (uval - (unsigned long) new_val * 10); val = new_val; while (val != 0) diff --git a/strings/longlong2str.c b/strings/longlong2str.c index c464abcfccd..d7de5bb0f7c 100644 --- a/strings/longlong2str.c +++ b/strings/longlong2str.c @@ -51,13 +51,15 @@ char *longlong2str(longlong val,char *dst,int radix) char buffer[65]; register char *p; long long_val; + ulonglong uval= (ulonglong) val; if (radix < 0) { if (radix < -36 || radix > -2) return (char*) 0; if (val < 0) { *dst++ = '-'; - val = -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; } radix = -radix; } @@ -65,7 +67,7 @@ char *longlong2str(longlong val,char *dst,int radix) { if (radix > 36 || radix < 2) return (char*) 0; } - if (val == 0) + if (uval == 0) { *dst++='0'; *dst='\0'; @@ -74,14 +76,14 @@ char *longlong2str(longlong val,char *dst,int radix) p = &buffer[sizeof(buffer)-1]; *p = '\0'; - while ((ulonglong) val > (ulonglong) LONG_MAX) + while (uval > (ulonglong) LONG_MAX) { - ulonglong quo=(ulonglong) val/(uint) radix; - uint rem= (uint) (val- quo* (uint) radix); + ulonglong quo= uval/(uint) radix; + uint rem= (uint) (uval- quo* (uint) radix); *--p = _dig_vec_upper[rem]; - val= quo; + uval= quo; } - long_val= (long) val; + long_val= (long) uval; while (long_val != 0) { long quo= long_val/radix; @@ -100,17 +102,19 @@ char *longlong10_to_str(longlong val,char *dst,int radix) char buffer[65]; register char *p; long long_val; + ulonglong uval= (ulonglong) val; if (radix < 0) { if (val < 0) { *dst++ = '-'; - val = -val; + /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ + uval = (ulonglong)0 - uval; } } - if (val == 0) + if (uval == 0) { *dst++='0'; *dst='\0'; @@ -119,14 +123,14 @@ char *longlong10_to_str(longlong val,char *dst,int radix) p = &buffer[sizeof(buffer)-1]; *p = '\0'; - while ((ulonglong) val > (ulonglong) LONG_MAX) + while (uval > (ulonglong) LONG_MAX) { - ulonglong quo=(ulonglong) val/(uint) 10; - uint rem= (uint) (val- quo* (uint) 10); + ulonglong quo= uval/(uint) 10; + uint rem= (uint) (uval- quo* (uint) 10); *--p = _dig_vec_upper[rem]; - val= quo; + uval= quo; } - long_val= (long) val; + long_val= (long) uval; while (long_val != 0) { long quo= long_val/10; diff --git a/support-files/MacOSX/ReadMe.txt b/support-files/MacOSX/ReadMe.txt new file mode 100644 index 00000000000..b3dcba21705 --- /dev/null +++ b/support-files/MacOSX/ReadMe.txt @@ -0,0 +1,8 @@ + +You can find information about how to install on Mac OS X at + + http://dev.mysql.com/doc/refman/5.1/en/mac-os-x-installation.html + +The MySQL Reference Manual is also available in various formats on +http://dev.mysql.com/doc; if you're interested in the DocBook XML +sources go to http://svn.mysql.com. diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 0a2c720b81b..c437748c770 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -36,6 +36,11 @@ pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* db_vrfy.c : .*comparison is always false due to limited range of data type.* # +# readline is not maintained by us +# +.*/cmd-line-utils/readline/.* : .* + +# # Ignore all conversion warnings on windows 64 # (Is safe as we are not yet supporting strings >= 2G) # @@ -77,3 +82,4 @@ mi_packrec.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560- # Wrong compiler warnings # .* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.* +ctype-simple.c : .*unary minus operator applied to unsigned type, result still unsigned.* diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index e0933aff8a4..65e13aaaca0 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -314,7 +314,7 @@ case "$mode" in fi exit $return_value else - log_failure_msg "Couldn't find MySQL manager or server" + log_failure_msg "Couldn't find MySQL manager ($manager) or server ($bindir/mysqld_safe)" fi ;; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 92992aa3a2e..6042ff4a2bf 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -11944,7 +11944,7 @@ static void test_bug5194() MAX_PARAM_COUNT * CHARS_PER_PARAM + 1); param_str= (char*) malloc(COLUMN_COUNT * CHARS_PER_PARAM); - if (bind == 0 || query == 0 || param_str == 0) + if (my_bind == 0 || query == 0 || param_str == 0) { fprintf(stderr, "Can't allocate enough memory for query structs\n"); if (my_bind) |